summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2010-02-24 10:32:22 +0300
committerAlexander Nozdrin <alik@sun.com>2010-02-24 10:32:22 +0300
commit5fb9f61e4faf24cbc364108c0709fa935f2c3a09 (patch)
tree7b877fd684c7e308b5694b7a837885828fa18460 /sql
parent4836199d701af05a9c89563b642c51ee5640e804 (diff)
parent5994f28470c0a2d9fbef329062f482fd0a40243b (diff)
downloadmariadb-git-5fb9f61e4faf24cbc364108c0709fa935f2c3a09.tar.gz
Auto-merge from mysql-next-mr-bugfixing.
Diffstat (limited to 'sql')
-rw-r--r--sql/item_cmpfunc.cc4
-rw-r--r--sql/item_func.cc4
-rw-r--r--sql/lex.h2
-rw-r--r--sql/mysql_priv.h18
-rw-r--r--sql/mysqld.cc137
-rw-r--r--sql/opt_range.cc2
-rw-r--r--sql/share/errmsg-utf8.txt4
-rw-r--r--sql/slave.cc2
-rw-r--r--sql/spatial.cc22
-rw-r--r--sql/sql_base.cc15
-rw-r--r--sql/sql_parse.cc74
-rw-r--r--sql/sql_select.cc2
-rw-r--r--sql/sql_yacc.yy27
-rw-r--r--sql/sys_vars.cc24
14 files changed, 128 insertions, 209 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 1da383ce3e9..ed465cbe280 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -2865,9 +2865,7 @@ bool Item_func_case::fix_fields(THD *thd, Item **ref)
buff should match stack usage from
Item_func_case::val_int() -> Item_func_case::find_item()
*/
-#ifndef EMBEDDED_LIBRARY
uchar buff[MAX_FIELD_WIDTH*2+sizeof(String)*2+sizeof(String*)*2+sizeof(double)*2+sizeof(longlong)*2];
-#endif
bool res= Item_func::fix_fields(thd, ref);
/*
Call check_stack_overrun after fix_fields to be sure that stack variable
@@ -4081,9 +4079,7 @@ Item_cond::fix_fields(THD *thd, Item **ref)
DBUG_ASSERT(fixed == 0);
List_iterator<Item> li(list);
Item *item;
-#ifndef EMBEDDED_LIBRARY
uchar buff[sizeof(char*)]; // Max local vars in function
-#endif
not_null_tables_cache= used_tables_cache= 0;
const_item_cache= 1;
/*
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 75f8b2045b5..e49ee4346b1 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -151,9 +151,7 @@ Item_func::fix_fields(THD *thd, Item **ref)
{
DBUG_ASSERT(fixed == 0);
Item **arg,**arg_end;
-#ifndef EMBEDDED_LIBRARY // Avoid compiler warning
uchar buff[STACK_BUFF_ALLOC]; // Max argument in function
-#endif
used_tables_cache= not_null_tables_cache= 0;
const_item_cache=1;
@@ -2839,9 +2837,7 @@ bool
udf_handler::fix_fields(THD *thd, Item_result_field *func,
uint arg_count, Item **arguments)
{
-#ifndef EMBEDDED_LIBRARY // Avoid compiler warning
uchar buff[STACK_BUFF_ALLOC]; // Max argument in function
-#endif
DBUG_ENTER("Item_udf_func::fix_fields");
if (check_stack_overrun(thd, STACK_MIN_SIZE, buff))
diff --git a/sql/lex.h b/sql/lex.h
index 5493206c214..fbedddc6941 100644
--- a/sql/lex.h
+++ b/sql/lex.h
@@ -226,7 +226,6 @@ static SYMBOL symbols[] = {
{ "FORCE", SYM(FORCE_SYM)},
{ "FOREIGN", SYM(FOREIGN)},
{ "FOUND", SYM(FOUND_SYM)},
- { "FRAC_SECOND", SYM(FRAC_SECOND_SYM)},
{ "FROM", SYM(FROM)},
{ "FULL", SYM(FULL)},
{ "FULLTEXT", SYM(FULLTEXT_SYM)},
@@ -517,7 +516,6 @@ static SYMBOL symbols[] = {
{ "SQL_NO_CACHE", SYM(SQL_NO_CACHE_SYM)},
{ "SQL_SMALL_RESULT", SYM(SQL_SMALL_RESULT)},
{ "SQL_THREAD", SYM(SQL_THREAD)},
- { "SQL_TSI_FRAC_SECOND", SYM(FRAC_SECOND_SYM)},
{ "SQL_TSI_SECOND", SYM(SECOND_SYM)},
{ "SQL_TSI_MINUTE", SYM(MINUTE_SYM)},
{ "SQL_TSI_HOUR", SYM(HOUR_SYM)},
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 22217f1b405..a006d2a07ff 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -198,12 +198,12 @@ char* query_table_status(THD *thd,const char *db,const char *table_name);
if (((THD *) Thd) != NULL) \
push_warning_printf(((THD *) Thd), MYSQL_ERROR::WARN_LEVEL_WARN, \
ER_WARN_DEPRECATED_SYNTAX, \
- ER(ER_WARN_DEPRECATED_SYNTAX_WITH_VER), \
- (Old), #VerHi "." #VerLo, (New)); \
+ ER(ER_WARN_DEPRECATED_SYNTAX), \
+ (Old), (New)); \
else \
sql_print_warning("The syntax '%s' is deprecated and will be removed " \
- "in MySQL %s. Please use %s instead.", \
- (Old), #VerHi "." #VerLo, (New)); \
+ "in a future release. Please use %s instead.", \
+ (Old), (New)); \
} while(0)
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *system_charset_info;
@@ -2027,7 +2027,7 @@ extern bool in_bootstrap;
extern uint volatile thread_count, global_read_lock;
extern uint connection_count;
extern my_bool opt_sql_bin_update, opt_safe_user_create, opt_no_mix_types;
-extern my_bool opt_safe_show_db, opt_local_infile, opt_myisam_use_mmap;
+extern my_bool opt_local_infile, opt_myisam_use_mmap;
extern my_bool opt_slave_compressed_protocol, use_temp_pool;
extern uint slave_exec_mode_options;
extern ulonglong slave_type_conversions_options;
@@ -2534,14 +2534,14 @@ inline bool is_user_table(TABLE * table)
#ifndef EMBEDDED_LIBRARY
extern "C" void unireg_abort(int exit_code) __attribute__((noreturn));
void kill_delayed_threads(void);
-bool check_stack_overrun(THD *thd, long margin, uchar *dummy);
#else
extern "C" void unireg_clear(int exit_code);
#define unireg_abort(exit_code) do { unireg_clear(exit_code); DBUG_RETURN(exit_code); } while(0)
inline void kill_delayed_threads(void) {}
-#define check_stack_overrun(A, B, C) 0
#endif
+bool check_stack_overrun(THD *thd, long margin, uchar *dummy);
+
/* This must match the path length limit in the ER_NOT_RW_DIR error msg. */
#define ER_NOT_RW_DIR_PATHSIZE 200
bool is_usable_directory(THD *thd, const char *varname,
@@ -2639,7 +2639,6 @@ enum options_mysqld
OPT_BOOTSTRAP,
OPT_CONSOLE,
OPT_DEBUG_SYNC_TIMEOUT,
- OPT_DELAY_KEY_WRITE_ALL,
OPT_ISAM_LOG,
OPT_KEY_BUFFER_SIZE,
OPT_KEY_CACHE_AGE_THRESHOLD,
@@ -2658,19 +2657,16 @@ enum options_mysqld
OPT_SAFE,
OPT_SERVER_ID,
OPT_SKIP_HOST_CACHE,
- OPT_SKIP_LOCK,
OPT_SKIP_NEW,
OPT_SKIP_PRIOR,
OPT_SKIP_RESOLVE,
OPT_SKIP_STACK_TRACE,
- OPT_SKIP_SYMLINKS,
OPT_SLOW_QUERY_LOG,
OPT_SSL_CA,
OPT_SSL_CAPATH,
OPT_SSL_CERT,
OPT_SSL_CIPHER,
OPT_SSL_KEY,
- OPT_UPDATE_LOG,
OPT_WANT_CORE,
OPT_ENGINE_CONDITION_PUSHDOWN
};
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 20478349c08..6bd133660b3 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -52,6 +52,10 @@
#include "sp_rcontext.h"
#include "sp_cache.h"
+#ifdef HAVE_POLL_H
+#include <poll.h>
+#endif
+
#define mysqld_charset &my_charset_latin1
/* stack traces are only supported on linux intel */
@@ -4011,21 +4015,13 @@ static int init_server_components()
Implementation of the above :
- If mysqld is started with --log-update and --log-bin,
ignore --log-update (print a warning), push a warning when SQL_LOG_UPDATE
- is used, and turn off --sql-bin-update-same.
+ is used,
This will completely ignore SQL_LOG_UPDATE
- If mysqld is started with --log-update only,
change it to --log-bin (with the filename passed to log-update,
plus '-bin') (print a warning), push a warning when SQL_LOG_UPDATE is
- used, and turn on --sql-bin-update-same.
+ used.
This will translate SQL_LOG_UPDATE to SQL_LOG_BIN.
-
- Note that we tell the user that --sql-bin-update-same is deprecated and
- does nothing, and we don't take into account if he used this option or
- not; but internally we give this variable a value to have the behaviour
- we want (i.e. have SQL_LOG_UPDATE influence SQL_LOG_BIN or not).
- As sql-bin-update-same, log-update and log-bin cannot be changed by the
- user after starting the server (they are not variables), the user will
- not later interfere with the settings we do here.
*/
if (opt_bin_log)
{
@@ -5351,26 +5347,47 @@ void handle_connections_sockets()
{
my_socket sock,new_sock;
uint error_count=0;
- uint max_used_connection= (uint) (max(ip_sock,unix_sock)+1);
- fd_set readFDs,clientFDs;
THD *thd;
struct sockaddr_storage cAddr;
- int ip_flags=0,socket_flags=0,flags;
+ int ip_flags=0,socket_flags=0,flags,retval;
st_vio *vio_tmp;
+#ifdef HAVE_POLL
+ int socket_count= 0;
+ struct pollfd fds[2]; // for ip_sock and unix_sock
+#else
+ fd_set readFDs,clientFDs;
+ uint max_used_connection= (uint) (max(ip_sock,unix_sock)+1);
+#endif
+
DBUG_ENTER("handle_connections_sockets");
LINT_INIT(new_sock);
+#ifndef HAVE_POLL
FD_ZERO(&clientFDs);
+#endif
+
if (ip_sock != INVALID_SOCKET)
{
+#ifdef HAVE_POLL
+ fds[socket_count].fd= ip_sock;
+ fds[socket_count].events= POLLIN;
+ socket_count++;
+#else
FD_SET(ip_sock,&clientFDs);
+#endif
#ifdef HAVE_FCNTL
ip_flags = fcntl(ip_sock, F_GETFL, 0);
#endif
}
#ifdef HAVE_SYS_UN_H
+#ifdef HAVE_POLL
+ fds[socket_count].fd= unix_sock;
+ fds[socket_count].events= POLLIN;
+ socket_count++;
+#else
FD_SET(unix_sock,&clientFDs);
+#endif
#ifdef HAVE_FCNTL
socket_flags=fcntl(unix_sock, F_GETFL, 0);
#endif
@@ -5380,12 +5397,15 @@ void handle_connections_sockets()
MAYBE_BROKEN_SYSCALL;
while (!abort_loop)
{
- readFDs=clientFDs;
-#ifdef HPUX10
- if (select(max_used_connection,(int*) &readFDs,0,0,0) < 0)
- continue;
+#ifdef HAVE_POLL
+ retval= poll(fds, socket_count, -1);
#else
- if (select((int) max_used_connection,&readFDs,0,0,0) < 0)
+ readFDs=clientFDs;
+
+ retval= select((int) max_used_connection,&readFDs,0,0,0);
+#endif
+
+ if (retval < 0)
{
if (socket_errno != SOCKET_EINTR)
{
@@ -5395,7 +5415,7 @@ void handle_connections_sockets()
MAYBE_BROKEN_SYSCALL
continue;
}
-#endif /* HPUX10 */
+
if (abort_loop)
{
MAYBE_BROKEN_SYSCALL;
@@ -5403,6 +5423,21 @@ void handle_connections_sockets()
}
/* Is this a new connection request ? */
+#ifdef HAVE_POLL
+ for (int i= 0; i < socket_count; ++i)
+ {
+ if (fds[i].revents & POLLIN)
+ {
+ sock= fds[i].fd;
+#ifdef HAVE_FCNTL
+ flags= fcntl(sock, F_GETFL, 0);
+#else
+ flags= 0;
+#endif // HAVE_FCNTL
+ break;
+ }
+ }
+#else // HAVE_POLL
#ifdef HAVE_SYS_UN_H
if (FD_ISSET(unix_sock,&readFDs))
{
@@ -5410,11 +5445,12 @@ void handle_connections_sockets()
flags= socket_flags;
}
else
-#endif
+#endif // HAVE_SYS_UN_H
{
sock = ip_sock;
flags= ip_flags;
}
+#endif // HAVE_POLL
#if !defined(NO_FCNTL_NONBLOCK)
if (!(test_flags & TEST_BLOCKING))
@@ -5978,12 +6014,6 @@ struct my_option my_long_options[]=
0, 0, 0},
{"core-file", OPT_WANT_CORE, "Write core on errors.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
- {"default-character-set", 'C', "Set the default character set (deprecated option, use --character-set-server instead).",
- (uchar**) &default_character_set_name, (uchar**) &default_character_set_name,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
- {"default-collation", 0, "Set the default collation (deprecated option, use --collation-server instead).",
- (uchar**) &default_collation_name, (uchar**) &default_collation_name,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
/* default-storage-engine should have "MyISAM" as def_value. Instead
of initializing it here it is done in init_common_variables() due
to a compiler bug in Sun Studio compiler. */
@@ -5993,9 +6023,6 @@ struct my_option my_long_options[]=
{"default-time-zone", 0, "Set the default time zone.",
(uchar**) &default_tz_name, (uchar**) &default_tz_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
- {"delay-key-write-for-all-tables", OPT_DELAY_KEY_WRITE_ALL,
- "Don't flush key buffers between writes for any MyISAM table (Deprecated option, use --delay-key-write=all instead).",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_OPENSSL
{"des-key-file", 0,
"Load keys for des_encrypt() and des_encrypt from given file.",
@@ -6009,10 +6036,6 @@ struct my_option my_long_options[]=
(uchar**) &disconnect_slave_event_count, 0, GET_INT, REQUIRED_ARG, 0, 0, 0,
0, 0, 0},
#endif /* HAVE_REPLICATION */
- {"enable-locking", 0,
- "Deprecated option, use --external-locking instead.",
- (uchar**) &opt_external_locking, (uchar**) &opt_external_locking,
- 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_STACK_TRACE_ON_SEGV
{"enable-pstack", 0, "Print a symbolic stack trace on failure.",
(uchar**) &opt_do_pstack, (uchar**) &opt_do_pstack, 0, GET_BOOL, NO_ARG, 0, 0,
@@ -6065,9 +6088,6 @@ struct my_option my_long_options[]=
{"log-isam", OPT_ISAM_LOG, "Log all MyISAM changes to file.",
(uchar**) &myisam_log_filename, (uchar**) &myisam_log_filename, 0, GET_STR,
OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"log-long-format", '0',
- "Log some extra information to update log. Please note that this option is deprecated; see --log-short-format option.",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"log-short-format", 0,
"Don't log extra information to update and slow-query logs.",
(uchar**) &opt_short_log_format, (uchar**) &opt_short_log_format,
@@ -6100,11 +6120,6 @@ struct my_option my_long_options[]=
REQUIRED_ARG, TC_LOG_MIN_SIZE, TC_LOG_MIN_SIZE, ULONG_MAX, 0,
TC_LOG_PAGE_SIZE, 0},
#endif
- {"log-update", OPT_UPDATE_LOG,
- "The update log is deprecated since version 5.0, is replaced by the binary \
-log and this option justs turns on --log-bin instead.",
- (uchar**) &opt_update_logname, (uchar**) &opt_update_logname, 0, GET_STR,
- OPT_ARG, 0, 0, 0, 0, 0, 0},
{"master-info-file", 0,
"The location and name of the file that remembers the master and where the I/O replication \
thread is in the master's binlogs.",
@@ -6168,11 +6183,6 @@ Can't be set to 1 if --log-slave-updates is used.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"safe-mode", OPT_SAFE, "Skip some optimize stages (for testing).",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-#ifndef TO_BE_DELETED
- {"safe-show-database", 0,
- "Deprecated option; use GRANT SHOW DATABASES instead...",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-#endif
{"safe-user-create", 0,
"Don't allow new user creation by the user who has no write privileges to the mysql.user table.",
(uchar**) &opt_safe_user_create, (uchar**) &opt_safe_user_create, 0, GET_BOOL,
@@ -6185,9 +6195,6 @@ Can't be set to 1 if --log-slave-updates is used.",
(uchar**)&sf_malloc_mem_limit, (uchar**)&sf_malloc_mem_limit, 0, GET_UINT,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"set-variable", 'O',
- "Change the value of a variable. Please note that this option is deprecated;you can set variables directly with --variable-name=value.",
- 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"show-slave-auth-info", 0,
"Show user and password in SHOW SLAVE HOSTS on this master",
(uchar**) &opt_show_slave_auth_info, (uchar**) &opt_show_slave_auth_info, 0,
@@ -6200,9 +6207,6 @@ Can't be set to 1 if --log-slave-updates is used.",
#endif
{"skip-host-cache", OPT_SKIP_HOST_CACHE, "Don't cache host names.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"skip-locking", OPT_SKIP_LOCK,
- "Deprecated option, use --skip-external-locking instead.",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip-name-resolve", OPT_SKIP_RESOLVE,
"Don't resolve hostnames. All hostnames are IP's or 'localhost'.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -6214,8 +6218,6 @@ Can't be set to 1 if --log-slave-updates is used.",
{"skip-stack-trace", OPT_SKIP_STACK_TRACE,
"Don't print a stack trace on failure.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
0, 0, 0, 0},
- {"skip-symlink", OPT_SKIP_SYMLINKS, "Don't allow symlinking of tables. Deprecated option. Use --skip-symbolic-links instead.",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip-thread-priority", OPT_SKIP_PRIOR,
"Don't give threads different priorities. This option is deprecated "
"because it has no effect; the implied behavior is already the default.",
@@ -6227,10 +6229,6 @@ Can't be set to 1 if --log-slave-updates is used.",
(uchar**) &opt_sporadic_binlog_dump_fail, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
#endif /* HAVE_REPLICATION */
- {"sql-bin-update-same", 0,
- "The update log is deprecated since version 5.0, is replaced by the "
- "binary log and this option does nothing anymore.",
- 0, 0, 0, GET_DISABLED, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_OPENSSL
{"ssl", 0,
"Enable SSL for connection (automatically enabled with other flags).",
@@ -6289,20 +6287,12 @@ Can't be set to 1 if --log-slave-updates is used.",
0, 0},
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
- {"warnings", 'W', "Deprecated; use --log-warnings instead.",
- (uchar**) &global_system_variables.log_warnings,
- (uchar**) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG,
- 1, 0, ULONG_MAX, 0, 0, 0},
{"plugin-load", 0,
"Optional semicolon-separated list of plugins to load, where each plugin is "
"identified as name=library, where name is the plugin name and library "
"is the plugin library in plugin_dir.",
(uchar**) &opt_plugin_load, (uchar**) &opt_plugin_load, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"record_buffer", 0, "Deprecated; use --read-buffer-size instead.",
- (uchar**) &global_system_variables.read_buff_size,
- (uchar**) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG,
- 128*1024L, IO_SIZE*2, INT_MAX32, 0, IO_SIZE, 0},
{"table_cache", 0, "Deprecated; use --table-open-cache instead.",
(uchar**) &table_cache_size, (uchar**) &table_cache_size, 0, GET_ULONG,
REQUIRED_ARG, TABLE_OPEN_CACHE_DEFAULT, 1, 512*1024L, 0, 1, 0},
@@ -7216,9 +7206,6 @@ mysqld_get_one_option(int optid,
case (int) OPT_ISAM_LOG:
opt_myisam_log=1;
break;
- case (int) OPT_UPDATE_LOG:
- opt_update_log=1;
- break;
case (int) OPT_BIN_LOG:
opt_bin_log= test(argument != disabled_my_option);
break;
@@ -7339,9 +7326,6 @@ mysqld_get_one_option(int optid,
"and will be removed in MySQL 7.0. This option has no effect "
"as the implied behavior is already the default.");
break;
- case (int) OPT_SKIP_LOCK:
- opt_external_locking=0;
- break;
case (int) OPT_SKIP_HOST_CACHE:
opt_specialflag|= SPECIAL_NO_HOST_CACHE;
break;
@@ -7354,9 +7338,6 @@ mysqld_get_one_option(int optid,
case (int) OPT_SKIP_STACK_TRACE:
test_flags|=TEST_NO_STACKTRACE;
break;
- case (int) OPT_SKIP_SYMLINKS:
- my_use_symdir=0;
- break;
case (int) OPT_BIND_ADDRESS:
{
struct addrinfo *res_lst, hints;
@@ -7389,12 +7370,6 @@ mysqld_get_one_option(int optid,
case OPT_SERVER_ID:
server_id_supplied = 1;
break;
- case OPT_DELAY_KEY_WRITE_ALL:
- if (argument != disabled_my_option)
- delay_key_write_options= DELAY_KEY_WRITE_ALL;
- else
- delay_key_write_options= DELAY_KEY_WRITE_NONE;
- break;
case OPT_ONE_THREAD:
thread_handling= SCHEDULER_ONE_THREAD_PER_CONNECTION;
break;
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index b9ea8c7c991..68285563239 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -2266,9 +2266,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
keys_to_use.intersect(head->keys_in_use_for_query);
if (!keys_to_use.is_clear_all())
{
-#ifndef EMBEDDED_LIBRARY // Avoid compiler warning
uchar buff[STACK_BUFF_ALLOC];
-#endif
MEM_ROOT alloc;
SEL_TREE *tree= NULL;
KEY_PART *key_parts;
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index 40b842c813e..7ea8c75e43e 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -5018,10 +5018,8 @@ ER_UNKNOWN_STORAGE_ENGINE 42000
ger "Unbekannte Speicher-Engine '%s'"
por "Motor de tabela desconhecido '%s'"
spa "Desconocido motor de tabla '%s'"
-# When using this error code, use ER(ER_WARN_DEPRECATED_SYNTAX_WITH_VER)
-# for the message string. See, for example, code in mysql_priv.h.
ER_WARN_DEPRECATED_SYNTAX
- eng "'%s' is deprecated; use '%s' instead"
+ eng "'%s' is deprecated and will be removed in a future release. Please use %s instead"
ger "'%s' ist veraltet. Bitte benutzen Sie '%s'"
por "'%s' é desatualizado. Use '%s' em seu lugar"
spa "'%s' está desaprobado, use '%s' en su lugar"
diff --git a/sql/slave.cc b/sql/slave.cc
index 337117a8d86..45c73a3e190 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1602,7 +1602,7 @@ static void write_ignored_events_info_to_relay_log(THD *thd, Master_info *mi)
" to the relay log, SHOW SLAVE STATUS may be"
" inaccurate");
rli->relay_log.harvest_bytes_written(&rli->log_space_total);
- if (flush_master_info(mi, TRUE, FALSE))
+ if (flush_master_info(mi, TRUE, TRUE))
sql_print_error("Failed to flush master info file");
delete ev;
}
diff --git a/sql/spatial.cc b/sql/spatial.cc
index 671b8544b8a..9a31b099e92 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.cc
@@ -1612,9 +1612,8 @@ int Gis_multi_polygon::area(double *ar, const char **end_of_data) const
int Gis_multi_polygon::centroid(String *result) const
{
uint32 n_polygons;
- bool first_loop= 1;
Gis_polygon p;
- double UNINIT_VAR(res_area), UNINIT_VAR(res_cx), UNINIT_VAR(res_cy);
+ double res_area= 0.0, res_cx= 0.0, res_cy= 0.0;
double cur_area, cur_cx, cur_cy;
const char *data= m_data;
@@ -1631,20 +1630,13 @@ int Gis_multi_polygon::centroid(String *result) const
p.centroid_xy(&cur_cx, &cur_cy))
return 1;
- if (!first_loop)
- {
- double sum_area= res_area + cur_area;
- res_cx= (res_area * res_cx + cur_area * cur_cx) / sum_area;
- res_cy= (res_area * res_cy + cur_area * cur_cy) / sum_area;
- }
- else
- {
- first_loop= 0;
- res_area= cur_area;
- res_cx= cur_cx;
- res_cy= cur_cy;
- }
+ res_area+= cur_area;
+ res_cx+= cur_area * cur_cx;
+ res_cy+= cur_area * cur_cy;
}
+
+ res_cx/= res_area;
+ res_cy/= res_area;
return create_point(result, res_cx, res_cy);
}
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 6ff7085f740..d5a664df0d0 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -4168,9 +4168,18 @@ open_and_process_table(THD *thd, LEX *lex, TABLE_LIST *tables,
TABLE_LIST is processed. This code works only during re-execution.
*/
if (tables->view)
- goto process_view_routines;
- if (!mysql_schema_table(thd, lex, tables) &&
- !check_and_update_table_version(thd, tables, tables->table->s))
+ {
+ /*
+ We still need to take a MDL lock on the merged view to protect
+ it from concurrent changes.
+ */
+ if (!open_table_get_mdl_lock(thd, tables, &tables->mdl_request,
+ ot_ctx, flags))
+ goto process_view_routines;
+ /* Fall-through to return error. */
+ }
+ else if (!mysql_schema_table(thd, lex, tables) &&
+ !check_and_update_table_version(thd, tables, tables->table->s))
{
goto end;
}
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index b0d8614dc84..714e3af5296 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -4132,6 +4132,47 @@ create_sp_error:
case SQLCOM_DROP_PROCEDURE:
case SQLCOM_DROP_FUNCTION:
{
+#ifdef HAVE_DLOPEN
+ if (lex->sql_command == SQLCOM_DROP_FUNCTION &&
+ ! lex->spname->m_explicit_name)
+ {
+ /* DROP FUNCTION <non qualified name> */
+ udf_func *udf = find_udf(lex->spname->m_name.str,
+ lex->spname->m_name.length);
+ if (udf)
+ {
+ if (check_access(thd, DELETE_ACL, "mysql", NULL, NULL, 1, 0))
+ goto error;
+
+ if (!(res = mysql_drop_function(thd, &lex->spname->m_name)))
+ {
+ my_ok(thd);
+ break;
+ }
+ my_error(ER_SP_DROP_FAILED, MYF(0),
+ "FUNCTION (UDF)", lex->spname->m_name.str);
+ goto error;
+ }
+
+ if (lex->spname->m_db.str == NULL)
+ {
+ if (lex->drop_if_exists)
+ {
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_SP_DOES_NOT_EXIST, ER(ER_SP_DOES_NOT_EXIST),
+ "FUNCTION (UDF)", lex->spname->m_name.str);
+ res= FALSE;
+ my_ok(thd);
+ break;
+ }
+ my_error(ER_SP_DOES_NOT_EXIST, MYF(0),
+ "FUNCTION (UDF)", lex->spname->m_name.str);
+ goto error;
+ }
+ /* Fall thought to test for a stored function */
+ }
+#endif
+
int sp_result;
int type= (lex->sql_command == SQLCOM_DROP_PROCEDURE ?
TYPE_ENUM_PROCEDURE : TYPE_ENUM_FUNCTION);
@@ -4178,34 +4219,6 @@ create_sp_error:
}
#endif
}
- else
- {
-#ifdef HAVE_DLOPEN
- if (lex->sql_command == SQLCOM_DROP_FUNCTION)
- {
- udf_func *udf = find_udf(lex->spname->m_name.str,
- lex->spname->m_name.length);
- if (udf)
- {
- if (check_access(thd, DELETE_ACL, "mysql", NULL, NULL, 1, 0))
- goto error;
-
- if (!(res = mysql_drop_function(thd, &lex->spname->m_name)))
- {
- my_ok(thd);
- break;
- }
- }
- }
-#endif
- if (lex->spname->m_db.str)
- sp_result= SP_KEY_NOT_FOUND;
- else
- {
- my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0));
- goto error;
- }
- }
res= sp_result;
switch (sp_result) {
case SP_OK:
@@ -4217,7 +4230,7 @@ create_sp_error:
res= write_bin_log(thd, TRUE, thd->query(), thd->query_length());
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_SP_DOES_NOT_EXIST, ER(ER_SP_DOES_NOT_EXIST),
- SP_COM_STRING(lex), lex->spname->m_name.str);
+ SP_COM_STRING(lex), lex->spname->m_qname.str);
if (!res)
my_ok(thd);
break;
@@ -5171,7 +5184,6 @@ bool check_global_access(THD *thd, ulong want_access)
Check stack size; Send error if there isn't enough stack to continue
****************************************************************************/
-#ifndef EMBEDDED_LIBRARY
#if STACK_DIRECTION < 0
#define used_stack(A,B) (long) (A - B)
@@ -5209,7 +5221,7 @@ bool check_stack_overrun(THD *thd, long margin,
#endif
return 0;
}
-#endif /* EMBEDDED_LIBRARY */
+
#define MY_YACC_INIT 1000 // Start with big alloc
#define MY_YACC_MAX 32000 // Because of 'short'
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index c37aeb39f6c..468f81a7d87 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -2516,9 +2516,7 @@ static ha_rows get_quick_record_count(THD *thd, SQL_SELECT *select,
{
int error;
DBUG_ENTER("get_quick_record_count");
-#ifndef EMBEDDED_LIBRARY // Avoid compiler warning
uchar buff[STACK_BUFF_ALLOC];
-#endif
if (check_stack_overrun(thd, STACK_MIN_SIZE, buff))
DBUG_RETURN(0); // Fatal error flag is set
if (select)
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 61f3d3b50ee..f03694cb359 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -968,7 +968,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token FOREIGN /* SQL-2003-R */
%token FOR_SYM /* SQL-2003-R */
%token FOUND_SYM /* SQL-2003-R */
-%token FRAC_SECOND_SYM
%token FROM
%token FULL /* SQL-2003-R */
%token FULLTEXT_SYM
@@ -1494,8 +1493,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%type <date_time_type> date_time_type;
%type <interval> interval
-%type <interval_time_st> interval_time_st
-
%type <interval_time_st> interval_time_stamp
%type <db_type> storage_engines known_storage_engines
@@ -9535,7 +9532,7 @@ using_list:
;
interval:
- interval_time_st {}
+ interval_time_stamp {}
| DAY_HOUR_SYM { $$=INTERVAL_DAY_HOUR; }
| DAY_MICROSECOND_SYM { $$=INTERVAL_DAY_MICROSECOND; }
| DAY_MINUTE_SYM { $$=INTERVAL_DAY_MINUTE; }
@@ -9550,27 +9547,6 @@ interval:
;
interval_time_stamp:
- interval_time_st {}
- | FRAC_SECOND_SYM
- {
- $$=INTERVAL_MICROSECOND;
- /*
- FRAC_SECOND was mistakenly implemented with
- a wrong resolution. According to the ODBC
- standard it should be nanoseconds, not
- microseconds. Changing it to nanoseconds
- in MySQL would mean making TIMESTAMPDIFF
- and TIMESTAMPADD to return DECIMAL, since
- the return value would be too big for BIGINT
- Hence we just deprecate the incorrect
- implementation without changing its
- resolution.
- */
- WARN_DEPRECATED(yythd, 6, 2, "FRAC_SECOND", "MICROSECOND");
- }
- ;
-
-interval_time_st:
DAY_SYM { $$=INTERVAL_DAY; }
| WEEK_SYM { $$=INTERVAL_WEEK; }
| HOUR_SYM { $$=INTERVAL_HOUR; }
@@ -12307,7 +12283,6 @@ keyword_sp:
| FILE_SYM {}
| FIRST_SYM {}
| FIXED_SYM {}
- | FRAC_SECOND_SYM {}
| GEOMETRY_SYM {}
| GEOMETRYCOLLECTION {}
| GET_FORMAT {}
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 4575ca79049..ba970925fc6 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -2205,30 +2205,6 @@ static Sys_var_bit Sys_log_binlog(
DEFAULT(TRUE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_has_super),
ON_UPDATE(fix_sql_log_bin));
-static bool deprecated_log_update(sys_var *self, THD *thd, set_var *var)
-{
- /*
- The update log is not supported anymore since 5.0.
- See sql/mysqld.cc/, comments in function init_server_components() for an
- explaination of the different warnings we send below
- */
-
- if (opt_sql_bin_update)
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
- ER_UPDATE_LOG_DEPRECATED_TRANSLATED,
- ER(ER_UPDATE_LOG_DEPRECATED_TRANSLATED));
- else
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
- ER_UPDATE_LOG_DEPRECATED_IGNORED,
- ER(ER_UPDATE_LOG_DEPRECATED_IGNORED));
- return check_has_super(self, thd, var);
-}
-static Sys_var_bit Sys_log_update(
- "sql_log_update", "alias for sql_log_bin",
- SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_BIN_LOG,
- DEFAULT(TRUE), NO_MUTEX_GUARD, NOT_IN_BINLOG,
- ON_CHECK(deprecated_log_update), ON_UPDATE(fix_sql_log_bin));
-
static Sys_var_bit Sys_sql_warnings(
"sql_warnings", "sql_warnings",
SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_WARNINGS,