mirror of
https://github.com/MariaDB/server.git
synced 2026-04-23 00:35:32 +02:00
mysql-5.5.18 merge
This commit is contained in:
commit
0e007344ea
1160 changed files with 12806 additions and 6189 deletions
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -107,6 +107,14 @@ ENDIF()
|
|||
|
||||
MYSQL_ADD_EXECUTABLE(mysqld ${MYSQLD_SOURCE} DESTINATION ${INSTALL_SBINDIR} COMPONENT Server)
|
||||
|
||||
IF(APPLE)
|
||||
# Add CoreServices framework since some dloadable plugins may need it
|
||||
FIND_LIBRARY(CORESERVICES NAMES CoreServices)
|
||||
IF(CORESERVICES)
|
||||
TARGET_LINK_LIBRARIES(mysqld ${CORESERVICES})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(NOT WITHOUT_DYNAMIC_PLUGINS)
|
||||
SET_TARGET_PROPERTIES(mysqld PROPERTIES ENABLE_EXPORTS TRUE)
|
||||
GET_TARGET_PROPERTY(mysqld_link_flags mysqld LINK_FLAGS)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef AUTHORS_INCLUDED
|
||||
#define AUTHORS_INCLUDED
|
||||
|
||||
/* Copyright (C) 2005-2006 MySQL AB
|
||||
/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2003 MySQL AB
|
||||
/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
#ifndef CLIENT_SETTINGS_INCLUDED
|
||||
|
|
@ -23,9 +23,18 @@
|
|||
#include <thr_alarm.h>
|
||||
#include <sql_common.h>
|
||||
|
||||
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | \
|
||||
CLIENT_SECURE_CONNECTION | CLIENT_TRANSACTIONS | \
|
||||
CLIENT_PROTOCOL_41 | CLIENT_SECURE_CONNECTION)
|
||||
/*
|
||||
Note: CLIENT_CAPABILITIES is also defined in libmysql/client_settings.h.
|
||||
When adding capabilities here, consider if they should be also added to
|
||||
the libmysql version.
|
||||
*/
|
||||
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | \
|
||||
CLIENT_LONG_FLAG | \
|
||||
CLIENT_SECURE_CONNECTION | \
|
||||
CLIENT_TRANSACTIONS | \
|
||||
CLIENT_PROTOCOL_41 | \
|
||||
CLIENT_SECURE_CONNECTION | \
|
||||
CLIENT_PLUGIN_AUTH)
|
||||
|
||||
#define read_user_name(A) {}
|
||||
#undef _CUSTOMCONFIG_
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#ifndef CONTRIBUTORS_INCLUDED
|
||||
#define CONTRIBUTORS_INCLUDED
|
||||
|
||||
/* Copyright (C) 2006 MySQL AB
|
||||
/* Copyright (c) 2006 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
Use is subject to license terms.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc.
|
||||
/* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/**
|
||||
== Debug Sync Facility ==
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef DEBUG_SYNC_INCLUDED
|
||||
#define DEBUG_SYNC_INCLUDED
|
||||
|
||||
/* Copyright (C) 2008 Sun Microsystems, Inc.
|
||||
/* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/**
|
||||
@file
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
|
||||
/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2001-2003, 2005 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#include "my_global.h" // HAVE_*
|
||||
#include "sql_priv.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
|
||||
/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
|
||||
/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#define MYSQL_LEX 1
|
||||
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef _EVENT_DATA_OBJECTS_H_
|
||||
#define _EVENT_DATA_OBJECTS_H_
|
||||
/* Copyright (C) 2004-2006 MySQL AB
|
||||
/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/**
|
||||
@addtogroup Event_Scheduler
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
/*
|
||||
Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#include "sql_priv.h"
|
||||
#include "unireg.h"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef _EVENT_DB_REPOSITORY_H_
|
||||
#define _EVENT_DB_REPOSITORY_H_
|
||||
/* Copyright (C) 2004-2006 MySQL AB
|
||||
|
||||
/*
|
||||
Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -13,7 +15,8 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
@addtogroup Event_Scheduler
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
/*
|
||||
Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#include "sql_priv.h"
|
||||
#include "unireg.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
/*
|
||||
Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#ifndef _EVENT_PARSE_DATA_H_
|
||||
#define _EVENT_PARSE_DATA_H_
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#include "sql_priv.h"
|
||||
#include "unireg.h"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef _EVENT_QUEUE_H_
|
||||
#define _EVENT_QUEUE_H_
|
||||
/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/**
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2004, 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef _EVENT_SCHEDULER_H_
|
||||
#define _EVENT_SCHEDULER_H_
|
||||
/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/**
|
||||
@addtogroup Event_Scheduler
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
/*
|
||||
Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
|
||||
/*
|
||||
Copyright (c) 2000, 2011, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009-2011 Monty Program Ab
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
|
@ -11,7 +13,8 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
@file
|
||||
|
|
|
|||
10
sql/field.h
10
sql/field.h
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef FIELD_INCLUDED
|
||||
#define FIELD_INCLUDED
|
||||
/* Copyright (c) 2000, 2010 Oracle and/or its affiliates.
|
||||
/* Copyright (c) 2000, 2011 Oracle and/or its affiliates.
|
||||
Copyright (c) 2009-2011 Monty Program Ab
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -1943,7 +1943,13 @@ public:
|
|||
int store(longlong nr, bool unsigned_val);
|
||||
int store_decimal(const my_decimal *);
|
||||
uint size_of() const { return sizeof(*this); }
|
||||
int reset(void) { return !maybe_null() || Field_blob::reset(); }
|
||||
|
||||
/**
|
||||
Non-nullable GEOMETRY types cannot have defaults,
|
||||
but the underlying blob must still be reset.
|
||||
*/
|
||||
int reset(void) { return Field_blob::reset() || !maybe_null(); }
|
||||
|
||||
geometry_type get_geometry_type() { return geom_type; };
|
||||
};
|
||||
#endif /*HAVE_SPATIAL*/
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2003 MySQL AB
|
||||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -178,7 +178,10 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions)
|
|||
((Field_timestamp*) field)->set_time();
|
||||
return 0; // Ok to set time to NULL
|
||||
}
|
||||
|
||||
// Note: we ignore any potential failure of reset() here.
|
||||
field->reset();
|
||||
|
||||
if (field == field->table->next_number_field)
|
||||
{
|
||||
field->table->auto_increment_field_not_null= FALSE;
|
||||
|
|
|
|||
|
|
@ -145,8 +145,6 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
|
|||
error= 1;
|
||||
bzero((char*) ¶m,sizeof(param));
|
||||
param.sort_length= sortlength(thd, sortorder, s_length, &multi_byte_charset);
|
||||
/* filesort cannot handle zero-length records. */
|
||||
DBUG_ASSERT(param.sort_length);
|
||||
param.ref_length= table->file->ref_length;
|
||||
if (!(table->file->ha_table_flags() & HA_FAST_KEY_READ) &&
|
||||
!table->fulltext_searched && !sort_positions)
|
||||
|
|
@ -258,6 +256,10 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
|
|||
else
|
||||
{
|
||||
thd->query_plan_flags|= QPLAN_FILESORT_DISK;
|
||||
|
||||
/* filesort cannot handle zero-length records during merge. */
|
||||
DBUG_ASSERT(param.sort_length != 0);
|
||||
|
||||
if (table_sort.buffpek && table_sort.buffpek_len < maxbuffer)
|
||||
{
|
||||
my_free(table_sort.buffpek);
|
||||
|
|
@ -999,21 +1001,10 @@ static void make_sortkey(register SORTPARAM *param,
|
|||
if (addonf->null_bit && field->is_null())
|
||||
{
|
||||
nulls[addonf->null_offset]|= addonf->null_bit;
|
||||
#ifdef HAVE_valgrind
|
||||
bzero(to, addonf->length);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef HAVE_valgrind
|
||||
uchar *end= field->pack(to, field->ptr);
|
||||
uint length= (uint) ((to + addonf->length) - end);
|
||||
DBUG_ASSERT((int) length >= 0);
|
||||
if (length)
|
||||
bzero(end, length);
|
||||
#else
|
||||
(void) field->pack(to, field->ptr);
|
||||
#endif
|
||||
}
|
||||
to+= addonf->length;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
|
||||
/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
|
||||
/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (C) 2000-2007 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
/*
|
||||
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/**
|
||||
@file
|
||||
|
|
@ -84,6 +85,8 @@ So, we can read full search-structure as 32-bit word
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
|
||||
|
||||
struct hash_lex_struct
|
||||
{
|
||||
int first_char;
|
||||
|
|
@ -374,24 +377,9 @@ int main(int argc,char **argv)
|
|||
/* Broken up to indicate that it's not advice to you, gentle reader. */
|
||||
printf("/*\n\n Do " "not " "edit " "this " "file " "directly!\n\n*/\n");
|
||||
|
||||
printf("\
|
||||
/* Copyright (C) 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.\n\
|
||||
\n\
|
||||
This program is free software; you can redistribute it and/or modify\n\
|
||||
it under the terms of the GNU General Public License as published by\n\
|
||||
the Free Software Foundation; version 2 of the License.\n\
|
||||
\n\
|
||||
This program is distributed in the hope that it will be useful,\n\
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
|
||||
GNU General Public License for more details.\n\
|
||||
\n\
|
||||
You should have received a copy of the GNU General Public License\n\
|
||||
along with this program; see the file COPYING. If not, write to the\n\
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston\n\
|
||||
MA 02110-1301 USA. */\n\
|
||||
\n\
|
||||
");
|
||||
puts("/*");
|
||||
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));
|
||||
puts("*/");
|
||||
|
||||
/* Broken up to indicate that it's not advice to you, gentle reader. */
|
||||
printf("/* Do " "not " "edit " "this " "file! This is generated by "
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2004 MySQL AB
|
||||
/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/*
|
||||
Functions to read and parse geometrical data.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef GSTREAM_INCLUDED
|
||||
#define GSTREAM_INCLUDED
|
||||
|
||||
/* Copyright (C) 2000-2004 MySQL AB
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
#include "my_global.h" /* NULL, NullS */
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11026,7 +11026,8 @@ mysql_declare_plugin(ndbcluster)
|
|||
0x0100 /* 1.0 */,
|
||||
ndb_status_variables_export,/* status variables */
|
||||
system_variables, /* system variables */
|
||||
NULL /* config options */
|
||||
NULL, /* config options */
|
||||
0, /* flags */
|
||||
}
|
||||
mysql_declare_plugin_end;
|
||||
maria_declare_plugin(ndbcluster)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#ifndef HA_NDBCLUSTER_INCLUDED
|
||||
#define HA_NDBCLUSTER_INCLUDED
|
||||
|
||||
/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
/* Copyright (c) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc.
|
||||
Use is subject to license terms.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -14,7 +15,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/*
|
||||
This file defines the NDB Cluster handler: the interface between MySQL and
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
/*
|
||||
Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +12,8 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "sql_priv.h"
|
||||
#include "unireg.h" // REQUIRED: for other includes
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#ifndef HA_NDBCLUSTER_BINLOG_INCLUDED
|
||||
#define HA_NDBCLUSTER_BINLOG_INCLUDED
|
||||
|
||||
/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
/* Copyright (c) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc.
|
||||
Use is subject to license terms.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -14,7 +15,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "sql_class.h" /* THD */
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
/*
|
||||
Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +12,8 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
This handler was developed by Mikael Ronstrom for version 5.1 of MySQL.
|
||||
|
|
@ -7220,7 +7222,8 @@ mysql_declare_plugin(partition)
|
|||
0x0100, /* 1.0 */
|
||||
NULL, /* status variables */
|
||||
NULL, /* system variables */
|
||||
NULL /* config options */
|
||||
NULL, /* config options */
|
||||
0, /* flags */
|
||||
}
|
||||
mysql_declare_plugin_end;
|
||||
maria_declare_plugin(partition)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#ifndef HA_PARTITION_INCLUDED
|
||||
#define HA_PARTITION_INCLUDED
|
||||
|
||||
/* Copyright 2005-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
|
||||
/*
|
||||
Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -14,7 +15,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma interface /* gcc class implementation */
|
||||
|
|
|
|||
|
|
@ -362,6 +362,7 @@ int ha_init_errors(void)
|
|||
SETMSG(HA_ERR_AUTOINC_ERANGE, ER_DEFAULT(ER_WARN_DATA_OUT_OF_RANGE));
|
||||
SETMSG(HA_ERR_TOO_MANY_CONCURRENT_TRXS, ER_DEFAULT(ER_TOO_MANY_CONCURRENT_TRXS));
|
||||
SETMSG(HA_ERR_INDEX_COL_TOO_LONG, ER_DEFAULT(ER_INDEX_COLUMN_TOO_LONG));
|
||||
SETMSG(HA_ERR_INDEX_CORRUPT, ER_DEFAULT(ER_INDEX_CORRUPT));
|
||||
SETMSG(HA_ERR_DISK_FULL, ER_DEFAULT(ER_DISK_FULL));
|
||||
|
||||
/* Register the error messages for use with my_error(). */
|
||||
|
|
@ -3010,6 +3011,12 @@ void handler::print_error(int error, myf errflag)
|
|||
case HA_ERR_INDEX_COL_TOO_LONG:
|
||||
textno= ER_INDEX_COLUMN_TOO_LONG;
|
||||
break;
|
||||
case HA_ERR_INDEX_CORRUPT:
|
||||
textno= ER_INDEX_CORRUPT;
|
||||
break;
|
||||
case HA_ERR_UNDO_REC_TOO_BIG:
|
||||
textno= ER_UNDO_RECORD_TOO_BIG;
|
||||
break;
|
||||
default:
|
||||
{
|
||||
/* The error was "unknown" to this function.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef HANDLER_INCLUDED
|
||||
#define HANDLER_INCLUDED
|
||||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
|
||||
/*
|
||||
Copyright (c) 2000, 2011, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009-2011 Monty Program Ab
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
|
|
@ -15,8 +16,8 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
02110-1301 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* Definitions for parameters to do with handler-routines */
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2001, 2005 MySQL AB
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2003, 2005 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
|
||||
/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2005 MySQL AB
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
|
||||
/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
/*
|
||||
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||
|
|
@ -5109,14 +5110,14 @@ mark_non_agg_field:
|
|||
SELECT_LEX *select_lex= cached_table ?
|
||||
cached_table->select_lex : context->select_lex;
|
||||
if (!thd->lex->in_sum_func)
|
||||
select_lex->full_group_by_flag|= NON_AGG_FIELD_USED;
|
||||
select_lex->set_non_agg_field_used(true);
|
||||
else
|
||||
{
|
||||
if (outer_fixed)
|
||||
thd->lex->in_sum_func->outer_fields.push_back(this);
|
||||
else if (thd->lex->in_sum_func->nest_level !=
|
||||
thd->lex->current_select->nest_level)
|
||||
select_lex->full_group_by_flag|= NON_AGG_FIELD_USED;
|
||||
select_lex->set_non_agg_field_used(true);
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2901,11 +2901,35 @@ void Item_func_case::agg_num_lengths(Item *arg)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
Check if (*place) and new_value points to different Items and call
|
||||
THD::change_item_tree() if needed.
|
||||
|
||||
This function is a workaround for implementation deficiency in
|
||||
Item_func_case. The problem there is that the 'args' attribute contains
|
||||
Items from different expressions.
|
||||
|
||||
The function must not be used elsewhere and will be remove eventually.
|
||||
*/
|
||||
|
||||
static void change_item_tree_if_needed(THD *thd,
|
||||
Item **place,
|
||||
Item *new_value)
|
||||
{
|
||||
if (*place == new_value)
|
||||
return;
|
||||
|
||||
thd->change_item_tree(place, new_value);
|
||||
}
|
||||
|
||||
|
||||
void Item_func_case::fix_length_and_dec()
|
||||
{
|
||||
Item **agg;
|
||||
uint nagg;
|
||||
uint found_types= 0;
|
||||
THD *thd= current_thd;
|
||||
|
||||
if (!(agg= (Item**) sql_alloc(sizeof(Item*)*(ncases+1))))
|
||||
return;
|
||||
|
||||
|
|
@ -2930,9 +2954,10 @@ void Item_func_case::fix_length_and_dec()
|
|||
Some of the items might have been changed to Item_func_conv_charset.
|
||||
*/
|
||||
for (nagg= 0 ; nagg < ncases / 2 ; nagg++)
|
||||
args[nagg * 2 + 1]= agg[nagg];
|
||||
change_item_tree_if_needed(thd, &args[nagg * 2 + 1], agg[nagg]);
|
||||
|
||||
if (else_expr_num != -1)
|
||||
args[else_expr_num]= agg[nagg++];
|
||||
change_item_tree_if_needed(thd, &args[else_expr_num], agg[nagg++]);
|
||||
}
|
||||
else
|
||||
collation.set_numeric();
|
||||
|
|
@ -2992,9 +3017,10 @@ void Item_func_case::fix_length_and_dec()
|
|||
arrray, because some of the items might have been changed to converters
|
||||
(e.g. Item_func_conv_charset, or Item_string for constants).
|
||||
*/
|
||||
args[first_expr_num]= agg[0];
|
||||
change_item_tree_if_needed(thd, &args[first_expr_num], agg[0]);
|
||||
|
||||
for (nagg= 0; nagg < ncases / 2; nagg++)
|
||||
args[nagg * 2]= agg[nagg + 1];
|
||||
change_item_tree_if_needed(thd, &args[nagg * 2], agg[nagg + 1]);
|
||||
}
|
||||
|
||||
for (i= 0; i <= (uint)TIME_RESULT; i++)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2000, 2010 Oracle and/or its affiliates.
|
||||
/*
|
||||
Copyright (c) 2000, 2011, Oracle and/or its affiliates.
|
||||
Copyright (c) 2011 Monty Program Ab
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2000, 2010 Oracle and/or its affiliates.
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2011, Monty Program Ab
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/* Functions to create an item. Used by sql/sql_yacc.yy */
|
||||
|
||||
|
|
|
|||
|
|
@ -1752,8 +1752,13 @@ longlong Item_func_int_div::val_int()
|
|||
return 0;
|
||||
}
|
||||
|
||||
my_decimal truncated;
|
||||
const bool do_truncate= true;
|
||||
if (my_decimal_round(E_DEC_FATAL_ERROR, &tmp, 0, do_truncate, &truncated))
|
||||
DBUG_ASSERT(false);
|
||||
|
||||
longlong res;
|
||||
if (my_decimal2int(E_DEC_FATAL_ERROR, &tmp, unsigned_flag, &res) &
|
||||
if (my_decimal2int(E_DEC_FATAL_ERROR, &truncated, unsigned_flag, &res) &
|
||||
E_DEC_OVERFLOW)
|
||||
raise_integer_overflow();
|
||||
return res;
|
||||
|
|
@ -5152,8 +5157,9 @@ longlong Item_func_get_user_var::val_int()
|
|||
|
||||
*/
|
||||
|
||||
int get_var_with_binlog(THD *thd, enum_sql_command sql_command,
|
||||
LEX_STRING &name, user_var_entry **out_entry)
|
||||
static int
|
||||
get_var_with_binlog(THD *thd, enum_sql_command sql_command,
|
||||
LEX_STRING &name, user_var_entry **out_entry)
|
||||
{
|
||||
BINLOG_USER_VAR_EVENT *user_var_event;
|
||||
user_var_entry *var_entry;
|
||||
|
|
@ -5283,7 +5289,7 @@ void Item_func_get_user_var::fix_length_and_dec()
|
|||
'var_entry' is NULL only if there occured an error during the call to
|
||||
get_var_with_binlog.
|
||||
*/
|
||||
if (var_entry)
|
||||
if (!error && var_entry)
|
||||
{
|
||||
m_cached_result_type= var_entry->type;
|
||||
unsigned_flag= var_entry->unsigned_flag;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2003-2006 MySQL AB
|
||||
/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#include "sql_priv.h"
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef ITEM_ROW_INCLUDED
|
||||
#define ITEM_ROW_INCLUDED
|
||||
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
class Item_row: public Item
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
/*
|
||||
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +12,8 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
@file
|
||||
|
|
@ -2317,7 +2319,7 @@ String *Item_func_format::val_str_ascii(String *str)
|
|||
return 0; /* purecov: inspected */
|
||||
nr= my_double_round(nr, (longlong) dec, FALSE, FALSE);
|
||||
str->set_real(nr, dec, &my_charset_numeric);
|
||||
if (isnan(nr))
|
||||
if (isnan(nr) || my_isinf(nr))
|
||||
return str;
|
||||
str_length=str->length();
|
||||
}
|
||||
|
|
@ -2373,6 +2375,7 @@ String *Item_func_format::val_str_ascii(String *str)
|
|||
For short values without thousands (<1000)
|
||||
replace decimal point to localized value.
|
||||
*/
|
||||
DBUG_ASSERT(dec_length <= str_length);
|
||||
((char*) str->ptr())[str_length - dec_length]= lc->decimal_point;
|
||||
}
|
||||
return str;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2002, 2010, Oracle and/or its affiliates.
|
||||
/* Copyright (c) 2002, 2011, Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2011, Monty Program Ab
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/**
|
||||
@file
|
||||
|
|
@ -38,6 +39,7 @@
|
|||
#include "set_var.h"
|
||||
#include "sql_select.h"
|
||||
#include "sql_parse.h" // check_stack_overrun
|
||||
#include "sql_test.h"
|
||||
|
||||
double get_post_group_estimate(JOIN* join, double join_op_rows);
|
||||
|
||||
|
|
@ -2617,7 +2619,8 @@ subselect_single_select_engine(THD *thd_arg, st_select_lex *select,
|
|||
select_result_interceptor *result_arg,
|
||||
Item_subselect *item_arg)
|
||||
:subselect_engine(thd_arg, item_arg, result_arg),
|
||||
prepared(0), executed(0), select_lex(select), join(0)
|
||||
prepared(0), executed(0), optimize_error(0),
|
||||
select_lex(select), join(0)
|
||||
{
|
||||
select_lex->master_unit()->item= item_arg;
|
||||
}
|
||||
|
|
@ -2630,7 +2633,7 @@ int subselect_single_select_engine::get_identifier()
|
|||
void subselect_single_select_engine::cleanup()
|
||||
{
|
||||
DBUG_ENTER("subselect_single_select_engine::cleanup");
|
||||
prepared= executed= 0;
|
||||
prepared= executed= optimize_error= 0;
|
||||
join= 0;
|
||||
result->cleanup();
|
||||
select_lex->uncacheable&= ~UNCACHEABLE_DEPENDENT_INJECTED;
|
||||
|
|
@ -2861,6 +2864,10 @@ int join_read_next_same_or_null(READ_RECORD *info);
|
|||
int subselect_single_select_engine::exec()
|
||||
{
|
||||
DBUG_ENTER("subselect_single_select_engine::exec");
|
||||
|
||||
if (optimize_error)
|
||||
DBUG_RETURN(1);
|
||||
|
||||
char const *save_where= thd->where;
|
||||
SELECT_LEX *save_select= thd->lex->current_select;
|
||||
thd->lex->current_select= select_lex;
|
||||
|
|
@ -2872,7 +2879,7 @@ int subselect_single_select_engine::exec()
|
|||
if (join->optimize())
|
||||
{
|
||||
thd->where= save_where;
|
||||
executed= 1;
|
||||
optimize_error= 1;
|
||||
thd->lex->current_select= save_select;
|
||||
DBUG_RETURN(join->error ? join->error : 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef ITEM_SUBSELECT_INCLUDED
|
||||
#define ITEM_SUBSELECT_INCLUDED
|
||||
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/* subselect Item */
|
||||
|
||||
|
|
@ -663,6 +663,7 @@ class subselect_single_select_engine: public subselect_engine
|
|||
{
|
||||
bool prepared; /* simple subselect is prepared */
|
||||
bool executed; /* simple subselect is executed */
|
||||
bool optimize_error; ///< simple subselect optimization failed
|
||||
st_select_lex *select_lex; /* corresponding select_lex */
|
||||
JOIN * join; /* corresponding JOIN structure */
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
|
||||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2011, Monty Program Ab
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -259,10 +260,10 @@ bool Item_sum::check_sum_func(THD *thd, Item **ref)
|
|||
in_sum_func->outer_fields.push_back(field);
|
||||
}
|
||||
else
|
||||
sel->full_group_by_flag|= NON_AGG_FIELD_USED;
|
||||
sel->set_non_agg_field_used(true);
|
||||
}
|
||||
if (sel->nest_level > aggr_level &&
|
||||
(sel->full_group_by_flag & SUM_FUNC_USED) &&
|
||||
(sel->agg_func_used()) &&
|
||||
!sel->group_list.elements)
|
||||
{
|
||||
my_message(ER_MIX_OF_GROUP_FUNC_AND_FIELDS,
|
||||
|
|
@ -271,7 +272,7 @@ bool Item_sum::check_sum_func(THD *thd, Item **ref)
|
|||
}
|
||||
}
|
||||
}
|
||||
aggr_sel->full_group_by_flag|= SUM_FUNC_USED;
|
||||
aggr_sel->set_agg_func_used(true);
|
||||
update_used_tables();
|
||||
thd->lex->in_sum_func= in_sum_func;
|
||||
return FALSE;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef ITEM_SUM_INCLUDED
|
||||
#define ITEM_SUM_INCLUDED
|
||||
/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
/* Copyright (c) 2000, 2011 Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2011 Monty Program Ab
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -13,7 +14,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
/* classes for sum functions */
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (C) 2000-2003 MySQL AB
|
||||
/*
|
||||
Copyright (c) 2000, 2011, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009-2011, Monty Program Ab
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -12,7 +13,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -1320,7 +1321,7 @@ bool get_interval_value(Item *args,interval_type int_type, INTERVAL *interval)
|
|||
else
|
||||
{
|
||||
String *res;
|
||||
if (!(res=args->val_str(&str_value)))
|
||||
if (!(res= args->val_str_ascii(&str_value)))
|
||||
return (1);
|
||||
|
||||
/* record negative intervalls in interval->neg */
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2005-2006 MySQL AB
|
||||
/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -1982,6 +1982,9 @@ static int my_xpath_parse_UnionExpr(MY_XPATH *xpath)
|
|||
static int
|
||||
my_xpath_parse_FilterExpr_opt_slashes_RelativeLocationPath(MY_XPATH *xpath)
|
||||
{
|
||||
Item *context= xpath->context;
|
||||
int rc;
|
||||
|
||||
if (!my_xpath_parse_FilterExpr(xpath))
|
||||
return 0;
|
||||
|
||||
|
|
@ -1995,8 +1998,22 @@ my_xpath_parse_FilterExpr_opt_slashes_RelativeLocationPath(MY_XPATH *xpath)
|
|||
return 0;
|
||||
}
|
||||
|
||||
my_xpath_parse_term(xpath, MY_XPATH_LEX_SLASH);
|
||||
return my_xpath_parse_RelativeLocationPath(xpath);
|
||||
/*
|
||||
The context for the next relative path is the nodeset
|
||||
returned by FilterExpr
|
||||
*/
|
||||
xpath->context= xpath->item;
|
||||
|
||||
/* treat double slash (//) as /descendant-or-self::node()/ */
|
||||
if (my_xpath_parse_term(xpath, MY_XPATH_LEX_SLASH))
|
||||
xpath->context= new Item_nodeset_func_descendantbyname(xpath->context,
|
||||
"*", 1, xpath->pxml, 1);
|
||||
rc= my_xpath_parse_RelativeLocationPath(xpath);
|
||||
|
||||
/* push back the context and restore the item */
|
||||
xpath->item= xpath->context;
|
||||
xpath->context= context;
|
||||
return rc;
|
||||
}
|
||||
static int my_xpath_parse_PathExpr(MY_XPATH *xpath)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#ifndef ITEM_XMLFUNC_INCLUDED
|
||||
#define ITEM_XMLFUNC_INCLUDED
|
||||
|
||||
/* Copyright (C) 2000-2005 MySQL AB
|
||||
/* Copyright (c) 2000-2007 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
Use is subject to license terms.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -14,7 +15,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
/* This file defines all XML functions */
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
/* Functions to handle keys and fields in forms */
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
|
||||
/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2002-2006 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#include "keycaches.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef KEYCACHES_INCLUDED
|
||||
#define KEYCACHES_INCLUDED
|
||||
|
||||
/* Copyright (C) 2002-2006 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#include "sql_list.h"
|
||||
#include <keycache.h>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef LEX_INCLUDED
|
||||
#define LEX_INCLUDED
|
||||
|
||||
/* Copyright (C) 2000-2002 MySQL AB
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
/* This file includes all reserved words and functions */
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
|
||||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
15
sql/lock.h
15
sql/lock.h
|
|
@ -1,3 +1,18 @@
|
|||
/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#ifndef LOCK_INCLUDED
|
||||
#define LOCK_INCLUDED
|
||||
|
||||
|
|
|
|||
16
sql/log.cc
16
sql/log.cc
|
|
@ -7642,22 +7642,6 @@ TC_LOG_BINLOG::set_status_variables(THD *thd)
|
|||
struct st_mysql_storage_engine binlog_storage_engine=
|
||||
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
|
||||
|
||||
mysql_declare_plugin(binlog)
|
||||
{
|
||||
MYSQL_STORAGE_ENGINE_PLUGIN,
|
||||
&binlog_storage_engine,
|
||||
"binlog",
|
||||
"MySQL AB",
|
||||
"This is a pseudo storage engine to represent the binlog in a transaction",
|
||||
PLUGIN_LICENSE_GPL,
|
||||
binlog_init, /* Plugin Init */
|
||||
NULL, /* Plugin Deinit */
|
||||
0x0100 /* 1.0 */,
|
||||
binlog_status_vars_top, /* status variables */
|
||||
binlog_sys_vars, /* system variables */
|
||||
NULL /* config options */
|
||||
}
|
||||
mysql_declare_plugin_end;
|
||||
maria_declare_plugin(binlog)
|
||||
{
|
||||
MYSQL_STORAGE_ENGINE_PLUGIN,
|
||||
|
|
|
|||
168
sql/log_event.cc
168
sql/log_event.cc
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
|
||||
/*
|
||||
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
#ifdef MYSQL_CLIENT
|
||||
|
|
@ -113,6 +114,11 @@ static int rows_event_stmt_cleanup(Relay_log_info const *rli, THD* thd);
|
|||
|
||||
static const char *HA_ERR(int i)
|
||||
{
|
||||
/*
|
||||
This function should only be called in case of an error
|
||||
was detected
|
||||
*/
|
||||
DBUG_ASSERT(i != 0);
|
||||
switch (i) {
|
||||
case HA_ERR_KEY_NOT_FOUND: return "HA_ERR_KEY_NOT_FOUND";
|
||||
case HA_ERR_FOUND_DUPP_KEY: return "HA_ERR_FOUND_DUPP_KEY";
|
||||
|
|
@ -165,7 +171,7 @@ static const char *HA_ERR(int i)
|
|||
case HA_ERR_CORRUPT_EVENT: return "HA_ERR_CORRUPT_EVENT";
|
||||
case HA_ERR_ROWS_EVENT_APPLY : return "HA_ERR_ROWS_EVENT_APPLY";
|
||||
}
|
||||
return 0;
|
||||
return "No Error!";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -186,7 +192,7 @@ static void inline slave_rows_error_report(enum loglevel level, int ha_error,
|
|||
TABLE *table, const char * type,
|
||||
const char *log_name, ulong pos)
|
||||
{
|
||||
const char *handler_error= HA_ERR(ha_error);
|
||||
const char *handler_error= (ha_error ? HA_ERR(ha_error) : NULL);
|
||||
char buff[MAX_SLAVE_ERRMSG], *slider;
|
||||
const char *buff_end= buff + sizeof(buff);
|
||||
uint len;
|
||||
|
|
@ -8236,7 +8242,8 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
|
|||
|
||||
error= do_exec_row(rli);
|
||||
|
||||
DBUG_PRINT("info", ("error: %s", HA_ERR(error)));
|
||||
if (error)
|
||||
DBUG_PRINT("info", ("error: %s", HA_ERR(error)));
|
||||
DBUG_ASSERT(error != HA_ERR_RECORD_DELETED);
|
||||
|
||||
table->in_use = old_thd;
|
||||
|
|
@ -9101,6 +9108,97 @@ int Table_map_log_event::rewrite_db(const char* new_db, size_t new_len,
|
|||
*/
|
||||
|
||||
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
|
||||
|
||||
enum enum_tbl_map_status
|
||||
{
|
||||
/* no duplicate identifier found */
|
||||
OK_TO_PROCESS= 0,
|
||||
|
||||
/* this table map must be filtered out */
|
||||
FILTERED_OUT= 1,
|
||||
|
||||
/* identifier mapping table with different properties */
|
||||
SAME_ID_MAPPING_DIFFERENT_TABLE= 2,
|
||||
|
||||
/* a duplicate identifier was found mapping the same table */
|
||||
SAME_ID_MAPPING_SAME_TABLE= 3
|
||||
};
|
||||
|
||||
/*
|
||||
Checks if this table map event should be processed or not. First
|
||||
it checks the filtering rules, and then looks for duplicate identifiers
|
||||
in the existing list of rli->tables_to_lock.
|
||||
|
||||
It checks that there hasn't been any corruption by verifying that there
|
||||
are no duplicate entries with different properties.
|
||||
|
||||
In some cases, some binary logs could get corrupted, showing several
|
||||
tables mapped to the same table_id, 0 (see: BUG#56226). Thus we do this
|
||||
early sanity check for such cases and avoid that the server crashes
|
||||
later.
|
||||
|
||||
In some corner cases, the master logs duplicate table map events, i.e.,
|
||||
same id, same database name, same table name (see: BUG#37137). This is
|
||||
different from the above as it's the same table that is mapped again
|
||||
to the same identifier. Thus we cannot just check for same ids and
|
||||
assume that the event is corrupted we need to check every property.
|
||||
|
||||
NOTE: in the event that BUG#37137 ever gets fixed, this extra check
|
||||
will still be valid because we would need to support old binary
|
||||
logs anyway.
|
||||
|
||||
@param rli The relay log info reference.
|
||||
@param table_list A list element containing the table to check against.
|
||||
@return OK_TO_PROCESS
|
||||
if there was no identifier already in rli->tables_to_lock
|
||||
|
||||
FILTERED_OUT
|
||||
if the event is filtered according to the filtering rules
|
||||
|
||||
SAME_ID_MAPPING_DIFFERENT_TABLE
|
||||
if the same identifier already maps a different table in
|
||||
rli->tables_to_lock
|
||||
|
||||
SAME_ID_MAPPING_SAME_TABLE
|
||||
if the same identifier already maps the same table in
|
||||
rli->tables_to_lock.
|
||||
*/
|
||||
static enum_tbl_map_status
|
||||
check_table_map(Relay_log_info const *rli, RPL_TABLE_LIST *table_list)
|
||||
{
|
||||
DBUG_ENTER("check_table_map");
|
||||
enum_tbl_map_status res= OK_TO_PROCESS;
|
||||
|
||||
if (rli->sql_thd->slave_thread /* filtering is for slave only */ &&
|
||||
(!rpl_filter->db_ok(table_list->db) ||
|
||||
(rpl_filter->is_on() && !rpl_filter->tables_ok("", table_list))))
|
||||
res= FILTERED_OUT;
|
||||
else
|
||||
{
|
||||
for(RPL_TABLE_LIST *ptr= static_cast<RPL_TABLE_LIST*>(rli->tables_to_lock);
|
||||
ptr;
|
||||
ptr= static_cast<RPL_TABLE_LIST*>(ptr->next_local))
|
||||
{
|
||||
if (ptr->table_id == table_list->table_id)
|
||||
{
|
||||
|
||||
if (strcmp(ptr->db, table_list->db) ||
|
||||
strcmp(ptr->alias, table_list->table_name) ||
|
||||
ptr->lock_type != TL_WRITE) // the ::do_apply_event always sets TL_WRITE
|
||||
res= SAME_ID_MAPPING_DIFFERENT_TABLE;
|
||||
else
|
||||
res= SAME_ID_MAPPING_SAME_TABLE;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DBUG_PRINT("debug", ("check of table map ended up with: %u", res));
|
||||
|
||||
DBUG_RETURN(res);
|
||||
}
|
||||
|
||||
int Table_map_log_event::do_apply_event(Relay_log_info const *rli)
|
||||
{
|
||||
RPL_TABLE_LIST *table_list;
|
||||
|
|
@ -9127,18 +9225,11 @@ int Table_map_log_event::do_apply_event(Relay_log_info const *rli)
|
|||
tname_mem, strlen(tname_mem),
|
||||
tname_mem, TL_WRITE);
|
||||
|
||||
table_list->table_id= m_table_id;
|
||||
table_list->table_id= DBUG_EVALUATE_IF("inject_tblmap_same_id_maps_diff_table", 0, m_table_id);
|
||||
table_list->updating= 1;
|
||||
|
||||
int error= 0;
|
||||
|
||||
if (rli->sql_thd->slave_thread /* filtering is for slave only */ &&
|
||||
(!rpl_filter->db_ok(table_list->db) ||
|
||||
(rpl_filter->is_on() && !rpl_filter->tables_ok("", table_list))))
|
||||
{
|
||||
my_free(memory);
|
||||
}
|
||||
else
|
||||
DBUG_PRINT("debug", ("table: %s is mapped to %u", table_list->table_name, table_list->table_id));
|
||||
enum_tbl_map_status tblmap_status= check_table_map(rli, table_list);
|
||||
if (tblmap_status == OK_TO_PROCESS)
|
||||
{
|
||||
DBUG_ASSERT(thd->lex->query_tables != table_list);
|
||||
|
||||
|
|
@ -9168,8 +9259,48 @@ int Table_map_log_event::do_apply_event(Relay_log_info const *rli)
|
|||
const_cast<Relay_log_info*>(rli)->tables_to_lock_count++;
|
||||
/* 'memory' is freed in clear_tables_to_lock */
|
||||
}
|
||||
else // FILTERED_OUT, SAME_ID_MAPPING_*
|
||||
{
|
||||
/*
|
||||
If mapped already but with different properties, we raise an
|
||||
error.
|
||||
If mapped already but with same properties we skip the event.
|
||||
If filtered out we skip the event.
|
||||
|
||||
DBUG_RETURN(error);
|
||||
In all three cases, we need to free the memory previously
|
||||
allocated.
|
||||
*/
|
||||
if (tblmap_status == SAME_ID_MAPPING_DIFFERENT_TABLE)
|
||||
{
|
||||
/*
|
||||
Something bad has happened. We need to stop the slave as strange things
|
||||
could happen if we proceed: slave crash, wrong table being updated, ...
|
||||
As a consequence we push an error in this case.
|
||||
*/
|
||||
|
||||
char buf[256];
|
||||
|
||||
my_snprintf(buf, sizeof(buf),
|
||||
"Found table map event mapping table id %u which "
|
||||
"was already mapped but with different settings.",
|
||||
table_list->table_id);
|
||||
|
||||
if (thd->slave_thread)
|
||||
rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
|
||||
ER(ER_SLAVE_FATAL_ERROR), buf);
|
||||
else
|
||||
/*
|
||||
For the cases in which a 'BINLOG' statement is set to
|
||||
execute in a user session
|
||||
*/
|
||||
my_printf_error(ER_SLAVE_FATAL_ERROR, ER(ER_SLAVE_FATAL_ERROR),
|
||||
MYF(0), buf);
|
||||
}
|
||||
|
||||
my_free(memory);
|
||||
}
|
||||
|
||||
DBUG_RETURN(tblmap_status == SAME_ID_MAPPING_DIFFERENT_TABLE);
|
||||
}
|
||||
|
||||
Log_event::enum_skip_reason
|
||||
|
|
@ -10187,7 +10318,8 @@ int Rows_log_event::find_row(const Relay_log_info *rli)
|
|||
restart_rnd_next:
|
||||
error= table->file->ha_rnd_next(table->record[0]);
|
||||
|
||||
DBUG_PRINT("info", ("error: %s", HA_ERR(error)));
|
||||
if (error)
|
||||
DBUG_PRINT("info", ("error: %s", HA_ERR(error)));
|
||||
switch (error) {
|
||||
|
||||
case 0:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/**
|
||||
@addtogroup Replication
|
||||
|
|
|
|||
|
|
@ -1,3 +1,17 @@
|
|||
/* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#include "sql_priv.h"
|
||||
#ifndef MYSQL_CLIENT
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (C) 2009 Sun Microsystems, Inc.
|
||||
/* Copyright (c) 2009 Sun Microsystems, Inc.
|
||||
Use is subject to license terms.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/*
|
||||
main() for mysqld.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2007-2008 MySQL AB
|
||||
/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
#include "mdl.h"
|
||||
|
|
|
|||
27
sql/mdl.h
27
sql/mdl.h
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef MDL_H
|
||||
#define MDL_H
|
||||
/* Copyright (C) 2007-2008 MySQL AB
|
||||
/* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#if defined(__IBMC__) || defined(__IBMCPP__)
|
||||
/* Further down, "next_in_lock" and "next_in_context" have the same type,
|
||||
|
|
@ -153,11 +153,24 @@ enum enum_mdl_type {
|
|||
|
||||
/** Duration of metadata lock. */
|
||||
|
||||
enum enum_mdl_duration { MDL_STATEMENT= 0,
|
||||
MDL_TRANSACTION,
|
||||
MDL_EXPLICIT,
|
||||
/* This should be the last ! */
|
||||
MDL_DURATION_END };
|
||||
enum enum_mdl_duration {
|
||||
/**
|
||||
Locks with statement duration are automatically released at the end
|
||||
of statement or transaction.
|
||||
*/
|
||||
MDL_STATEMENT= 0,
|
||||
/**
|
||||
Locks with transaction duration are automatically released at the end
|
||||
of transaction.
|
||||
*/
|
||||
MDL_TRANSACTION,
|
||||
/**
|
||||
Locks with explicit duration survive the end of statement and transaction.
|
||||
They have to be released explicitly by calling MDL_context::release_lock().
|
||||
*/
|
||||
MDL_EXPLICIT,
|
||||
/* This should be the last ! */
|
||||
MDL_DURATION_END };
|
||||
|
||||
|
||||
/** Maximal length of key for metadata locking subsystem. */
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef MESSAGE_INCLUDED
|
||||
#define MESSAGE_INCLUDED
|
||||
/* Copyright 2008 Sun Microsystems, Inc.
|
||||
/* Copyright (c) 2008, 2009 Sun Microsystems, Inc.
|
||||
Use is subject to license terms.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -13,7 +14,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/*
|
||||
To change or add messages mysqld writes to the Windows error log, run
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2004 MySQL AB
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/**
|
||||
@file
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2005-2006 MySQL AB
|
||||
/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#include <my_global.h>
|
||||
#include "sql_priv.h"
|
||||
|
|
|
|||
|
|
@ -99,12 +99,8 @@ public:
|
|||
{
|
||||
len= DECIMAL_BUFF_LENGTH;
|
||||
buf= buffer;
|
||||
#if !defined (HAVE_valgrind) && !defined(DBUG_OFF)
|
||||
/* Set buffer to 'random' value to find wrong buffer usage */
|
||||
for (uint i= 0; i < DECIMAL_BUFF_LENGTH; i++)
|
||||
buffer[i]= i;
|
||||
#endif
|
||||
}
|
||||
|
||||
my_decimal()
|
||||
{
|
||||
init();
|
||||
|
|
@ -119,8 +115,6 @@ public:
|
|||
void swap(my_decimal &rhs)
|
||||
{
|
||||
swap_variables(my_decimal, *this, rhs);
|
||||
/* Swap the buffer pointers back */
|
||||
swap_variables(decimal_digit_t *, buf, rhs.buf);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2111,8 +2111,12 @@ static my_socket activate_tcp_port(uint port)
|
|||
unireg_abort(1); /* purecov: tested */
|
||||
}
|
||||
|
||||
for (a= ai; a != NULL && ip_sock == INVALID_SOCKET; a= a->ai_next)
|
||||
for (a= ai; a != NULL; a= a->ai_next)
|
||||
{
|
||||
ip_sock= socket(a->ai_family, a->ai_socktype, a->ai_protocol);
|
||||
if (ip_sock != INVALID_SOCKET)
|
||||
break;
|
||||
}
|
||||
|
||||
if (ip_sock == INVALID_SOCKET)
|
||||
{
|
||||
|
|
@ -7189,7 +7193,7 @@ static void usage(void)
|
|||
if (!default_collation_name)
|
||||
default_collation_name= (char*) default_charset_info->name;
|
||||
print_version();
|
||||
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
|
||||
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));
|
||||
puts("Starts the MySQL database server.\n");
|
||||
printf("Usage: %s [OPTIONS]\n", my_progname);
|
||||
if (!opt_verbose)
|
||||
|
|
@ -8078,12 +8082,15 @@ fn_format_relative_to_data_home(char * to, const char *name,
|
|||
bool is_secure_file_path(char *path)
|
||||
{
|
||||
char buff1[FN_REFLEN], buff2[FN_REFLEN];
|
||||
size_t opt_secure_file_priv_len;
|
||||
/*
|
||||
All paths are secure if opt_secure_file_path is 0
|
||||
*/
|
||||
if (!opt_secure_file_priv)
|
||||
return TRUE;
|
||||
|
||||
opt_secure_file_priv_len= strlen(opt_secure_file_priv);
|
||||
|
||||
if (strlen(path) >= FN_REFLEN)
|
||||
return FALSE;
|
||||
|
||||
|
|
@ -8099,7 +8106,21 @@ bool is_secure_file_path(char *path)
|
|||
return FALSE;
|
||||
}
|
||||
convert_dirname(buff2, buff1, NullS);
|
||||
return is_prefix(buff2, opt_secure_file_priv) ? TRUE : FALSE;
|
||||
if (!lower_case_file_system)
|
||||
{
|
||||
if (strncmp(opt_secure_file_priv, buff2, opt_secure_file_priv_len))
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (files_charset_info->coll->strnncoll(files_charset_info,
|
||||
(uchar *) buff2, strlen(buff2),
|
||||
(uchar *) opt_secure_file_priv,
|
||||
opt_secure_file_priv_len,
|
||||
TRUE))
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
|
||||
/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#ifndef MYSQLD_SUFFIX_INCLUDED
|
||||
#define MYSQLD_SUFFIX_INCLUDED
|
||||
|
||||
/* Copyright (C) 2000-2004 MySQL AB
|
||||
/* Copyright (c) 2000-2004, 2006, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
Use is subject to license terms.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -14,7 +15,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/**
|
||||
@file
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
|
||||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2011, Monty Program Ab
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/*
|
||||
TODO:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
/* classes to use when handling where clause */
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2000, 2010 Oracle and/or its affiliates.
|
||||
/* Copyright (c) 2000, 2011 Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2011 Monty Program Ab
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/**
|
||||
@file
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* -*- C++ -*- */
|
||||
/* Copyright (C) 2004 MySQL AB
|
||||
/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#ifndef _PARSE_FILE_H_
|
||||
#define _PARSE_FILE_H_
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PARTITION_ELEMENT_INCLUDED
|
||||
#define PARTITION_ELEMENT_INCLUDED
|
||||
|
||||
/* Copyright 2005-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
|
||||
/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2006, 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/* Some general useful functions */
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PARTITION_INFO_INCLUDED
|
||||
#define PARTITION_INFO_INCLUDED
|
||||
|
||||
/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
|
||||
/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/*
|
||||
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/* password checking routines */
|
||||
/*****************************************************************************
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2002, 2004-2005 MySQL AB
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
|
||||
/* Procedures (functions with changes output of select) */
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PROCEDURE_INCLUDED
|
||||
#define PROCEDURE_INCLUDED
|
||||
|
||||
/* Copyright (C) 2000-2005 MySQL AB
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/* When using sql procedures */
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* Copyright (c) 2000, 2011 Oracle and/or its affiliates.
|
||||
Copyright (c) 2011 Monty Program Ab
|
||||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
|
||||
Copyright (c) 2011, Monty Program Ab
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/**
|
||||
@file
|
||||
|
|
@ -368,9 +368,8 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
|
|||
buff[]: sql_errno:2 + ('#':1 + SQLSTATE_LENGTH:5) + MYSQL_ERRMSG_SIZE:512
|
||||
*/
|
||||
uint error;
|
||||
uchar converted_err[MYSQL_ERRMSG_SIZE];
|
||||
uint32 converted_err_len;
|
||||
uchar buff[2+1+SQLSTATE_LENGTH+MYSQL_ERRMSG_SIZE], *pos;
|
||||
char converted_err[MYSQL_ERRMSG_SIZE];
|
||||
char buff[2+1+SQLSTATE_LENGTH+MYSQL_ERRMSG_SIZE], *pos;
|
||||
|
||||
DBUG_ENTER("send_error_packet");
|
||||
|
||||
|
|
@ -390,19 +389,16 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
|
|||
{
|
||||
/* The first # is to make the protocol backward compatible */
|
||||
buff[2]= '#';
|
||||
pos= (uchar*) strmov((char*) buff+3, sqlstate);
|
||||
pos= strmov(buff+3, sqlstate);
|
||||
}
|
||||
|
||||
converted_err_len= convert_error_message((char*)converted_err,
|
||||
sizeof(converted_err),
|
||||
thd->variables.character_set_results,
|
||||
err, strlen(err),
|
||||
system_charset_info, &error);
|
||||
length= (uint) (strmake((char*) pos, (char*)converted_err,
|
||||
MYSQL_ERRMSG_SIZE - 1) - (char*) buff);
|
||||
err= (char*) buff;
|
||||
convert_error_message(converted_err, sizeof(converted_err),
|
||||
thd->variables.character_set_results,
|
||||
err, strlen(err), system_charset_info, &error);
|
||||
/* Converted error message is always null-terminated. */
|
||||
length= (uint) (strmake(pos, converted_err, MYSQL_ERRMSG_SIZE - 1) - buff);
|
||||
|
||||
DBUG_RETURN(net_write_command(net,(uchar) 255, (uchar*) "", 0, (uchar*) err,
|
||||
DBUG_RETURN(net_write_command(net,(uchar) 255, (uchar*) "", 0, (uchar*) buff,
|
||||
length));
|
||||
}
|
||||
|
||||
|
|
@ -1038,7 +1034,7 @@ bool Protocol_text::store(const char *from, size_t length,
|
|||
CHARSET_INFO *tocs= this->thd->variables.character_set_results;
|
||||
#ifndef DBUG_OFF
|
||||
DBUG_PRINT("info", ("Protocol_text::store field %u (%u): %.*s", field_pos,
|
||||
field_count, (int) length, (length == 0? "" : from)));
|
||||
field_count, (int) length, (length == 0 ? "" : from)));
|
||||
DBUG_ASSERT(field_pos < field_count);
|
||||
DBUG_ASSERT(field_types == 0 ||
|
||||
field_types[field_pos] == MYSQL_TYPE_DECIMAL ||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PROTOCOL_INCLUDED
|
||||
#define PROTOCOL_INCLUDED
|
||||
|
||||
/* Copyright (C) 2002-2006 MySQL AB
|
||||
/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#ifdef USE_PRAGMA_INTERFACE
|
||||
#pragma interface /* gcc class implementation */
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#ifdef USE_PRAGMA_INTERFACE
|
||||
#pragma implementation /* gcc class implementation */
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef SQL_RECORDS_H
|
||||
#define SQL_RECORDS_H
|
||||
/* Copyright (C) 2008 Sun/MySQL
|
||||
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#ifdef USE_PRAGMA_INTERFACE
|
||||
#pragma interface /* gcc class implementation */
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2001-2006 MySQL AB & Sasha, 2008-2009 Sun Microsystems, Inc
|
||||
/* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/**
|
||||
@file
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef REPL_FAILSAFE_INCLUDED
|
||||
#define REPL_FAILSAFE_INCLUDED
|
||||
|
||||
/* Copyright (C) 2001-2005 MySQL AB & Sasha, 2008-2009 Sun Microsystems, Inc
|
||||
/* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#ifdef HAVE_REPLICATION
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue