diff --git a/VERSION b/VERSION index f85cac84d7e..17335ff3fc5 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 -MYSQL_VERSION_PATCH=9 +MYSQL_VERSION_PATCH=10 MYSQL_VERSION_EXTRA= diff --git a/client/client_priv.h b/client/client_priv.h index 1a81768adc4..cc589e55d52 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -85,6 +85,7 @@ enum options_client OPT_WRITE_BINLOG, OPT_DUMP_DATE, OPT_INIT_COMMAND, OPT_PLUGIN_DIR, + OPT_DEFAULT_AUTH, OPT_DEFAULT_PLUGIN, OPT_MAX_CLIENT_OPTION }; diff --git a/client/mysql.cc b/client/mysql.cc index 241cca49a5d..8fea1b054f3 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -162,7 +162,7 @@ static int wait_time = 5; static STATUS status; static ulong select_limit,max_join_size,opt_connect_timeout=0; static char mysql_charsets_dir[FN_REFLEN+1]; -static char *opt_plugin_dir= 0, *opt_default_auth; +static char *opt_plugin_dir= 0, *opt_default_auth= 0; static const char *xmlmeta[] = { "&", "&", "<", "<", @@ -1564,7 +1564,7 @@ static struct my_option my_long_options[] = {"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.", (uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"default_auth", OPT_PLUGIN_DIR, + {"default_auth", OPT_DEFAULT_AUTH, "Default authentication client-side plugin to use.", (uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 4fbf08102bd..b364acd5e61 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -45,6 +45,8 @@ static DYNAMIC_STRING ds_args; static DYNAMIC_STRING conn_args; static char *opt_password= 0; +static char *opt_plugin_dir= 0, *opt_default_auth= 0; + static my_bool tty_password= 0; static char opt_tmpdir[FN_REFLEN] = ""; @@ -88,6 +90,10 @@ static struct my_option my_long_options[]= {"default-character-set", OPT_DEFAULT_CHARSET, "Set the default character set.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"default_auth", OPT_DEFAULT_AUTH, + "Default authentication client-side plugin to use.", + (uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"force", 'f', "Force execution of mysqlcheck even if mysql_upgrade " "has already been executed for the current version of MySQL.", &opt_force, &opt_force, 0, @@ -102,6 +108,9 @@ static struct my_option my_long_options[]= {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif + {"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.", + (uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"port", 'P', "Port number to use for connection or 0 for default to, in " "order of preference, my.cnf, $MYSQL_TCP_PORT, " #if MYSQL_PORT_DEFAULT == 0 @@ -283,6 +292,8 @@ get_one_option(int optid, const struct my_option *opt, case 'S': /* --socket */ case OPT_MYSQL_PROTOCOL: /* --protocol */ case OPT_SHARED_MEMORY_BASE_NAME: /* --shared-memory-base-name */ + case OPT_PLUGIN_DIR: /* --plugin-dir */ + case OPT_DEFAULT_AUTH: /* --default-auth */ add_one_option(&conn_args, opt, argument); break; } diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 2c10fdbe853..580caa38c0d 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -42,7 +42,7 @@ static uint tcp_port = 0, option_wait = 0, option_silent=0, nr_iterations; static uint opt_count_iterations= 0, my_end_arg; static ulong opt_connect_timeout, opt_shutdown_timeout; static char * unix_port=0; -static char *opt_plugin_dir= 0, *opt_default_auth; +static char *opt_plugin_dir= 0, *opt_default_auth= 0; #ifdef HAVE_SMEM static char *shared_memory_base_name=0; @@ -208,7 +208,7 @@ static struct my_option my_long_options[] = {"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.", (uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"default_auth", OPT_PLUGIN_DIR, + {"default_auth", OPT_DEFAULT_AUTH, "Default authentication client-side plugin to use.", (uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -413,6 +413,9 @@ int main(int argc,char *argv[]) if (interval) /* --sleep=interval given */ { + if (opt_count_iterations && --nr_iterations == 0) + break; + /* If connection was dropped (unintentionally, or due to SHUTDOWN), re-establish it if --wait ("retry-connect") was given and user diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index bf4920c6f77..91b075a8970 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -79,6 +79,8 @@ static char* host = 0; static int port= 0; static uint my_end_arg; static const char* sock= 0; +static char *opt_plugin_dir= 0, *opt_default_auth= 0; + #ifdef HAVE_SMEM static char *shared_memory_base_name= 0; #endif @@ -1039,6 +1041,10 @@ static struct my_option my_long_options[] = {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", &debug_info_flag, &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"default_auth", OPT_DEFAULT_AUTH, + "Default authentication client-side plugin to use.", + (uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"disable-log-bin", 'D', "Disable binary log. This is useful, if you " "enabled --to-last-log and are sending the output to the same MySQL server. " "This way you could avoid an endless loop. You would also like to use it " @@ -1064,6 +1070,9 @@ static struct my_option my_long_options[] = 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', "Password to connect to remote server.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.", + (uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"port", 'P', "Port number to use for connection or 0 for default to, in " "order of preference, my.cnf, $MYSQL_TCP_PORT, " #if MYSQL_PORT_DEFAULT == 0 @@ -1381,6 +1390,12 @@ static Exit_status safe_connect() return ERROR_STOP; } + if (opt_plugin_dir && *opt_plugin_dir) + mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir); + + if (opt_default_auth && *opt_default_auth) + mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth); + if (opt_protocol) mysql_options(mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol); #ifdef HAVE_SMEM diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 7b188d7ce18..f38d674ae8d 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -40,6 +40,7 @@ static int my_end_arg; static char * opt_mysql_unix_port = 0; static char *opt_password = 0, *current_user = 0, *default_charset= 0, *current_host= 0; +static char *opt_plugin_dir= 0, *opt_default_auth= 0; static int first_error = 0; DYNAMIC_ARRAY tables4repair; #ifdef HAVE_SMEM @@ -99,6 +100,10 @@ static struct my_option my_long_options[] = {"default-character-set", OPT_DEFAULT_CHARSET, "Set the default character set.", &default_charset, &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"default_auth", OPT_DEFAULT_AUTH, + "Default authentication client-side plugin to use.", + (uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"fast",'F', "Check only tables that haven't been closed properly.", &opt_fast, &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -136,6 +141,9 @@ static struct my_option my_long_options[] = {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif + {"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.", + (uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"port", 'P', "Port number to use for connection or 0 for default to, in " "order of preference, my.cnf, $MYSQL_TCP_PORT, " #if MYSQL_PORT_DEFAULT == 0 @@ -796,6 +804,13 @@ static int dbConnect(char *host, char *user, char *passwd) if (shared_memory_base_name) mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name); #endif + + if (opt_plugin_dir && *opt_plugin_dir) + mysql_options(&mysql_connection, MYSQL_PLUGIN_DIR, opt_plugin_dir); + + if (opt_default_auth && *opt_default_auth) + mysql_options(&mysql_connection, MYSQL_DEFAULT_AUTH, opt_default_auth); + mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset); if (!(sock = mysql_real_connect(&mysql_connection, host, user, passwd, NULL, opt_mysql_port, opt_mysql_unix_port, 0))) diff --git a/client/mysqldump.c b/client/mysqldump.c index 2d38e94f0fb..66f0c2801f5 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -137,7 +137,7 @@ FILE *stderror_file=0; static char *shared_memory_base_name=0; #endif static uint opt_protocol= 0; -static char *opt_plugin_dir= 0, *opt_default_auth; +static char *opt_plugin_dir= 0, *opt_default_auth= 0; /* Dynamic_string wrapper functions. In this file use these @@ -503,7 +503,7 @@ static struct my_option my_long_options[] = {"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.", (uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"default_auth", OPT_PLUGIN_DIR, + {"default_auth", OPT_DEFAULT_AUTH, "Default authentication client-side plugin to use.", (uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -2237,6 +2237,15 @@ static uint get_table_structure(char *table, char *db, char *table_type, const char *insert_option; char name_buff[NAME_LEN+3],table_buff[NAME_LEN*2+3]; char table_buff2[NAME_LEN*2+3], query_buff[QUERY_LENGTH]; + const char *show_fields_stmt= "SELECT `COLUMN_NAME` AS `Field`, " + "`COLUMN_TYPE` AS `Type`, " + "`IS_NULLABLE` AS `Null`, " + "`COLUMN_KEY` AS `Key`, " + "`COLUMN_DEFAULT` AS `Default`, " + "`EXTRA` AS `Extra`, " + "`COLUMN_COMMENT` AS `Comment` " + "FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE " + "TABLE_SCHEMA = '%s' AND TABLE_NAME = '%s'"; FILE *sql_file= md_result_file; int len; MYSQL_RES *result; @@ -2504,8 +2513,8 @@ static uint get_table_structure(char *table, char *db, char *table_type, verbose_msg("%s: Warning: Can't set SQL_QUOTE_SHOW_CREATE option (%s)\n", my_progname, mysql_error(mysql)); - my_snprintf(query_buff, sizeof(query_buff), "show fields from %s", - result_table); + my_snprintf(query_buff, sizeof(query_buff), show_fields_stmt, db, table); + if (mysql_query_with_error_report(mysql, &result, query_buff)) DBUG_RETURN(0); diff --git a/client/mysqlimport.c b/client/mysqlimport.c index aea1cb79e74..7966766c1eb 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -60,6 +60,7 @@ static char *opt_password=0, *current_user=0, *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME; static uint opt_mysql_port= 0, opt_protocol= 0; static char * opt_mysql_unix_port=0; +static char *opt_plugin_dir= 0, *opt_default_auth= 0; static longlong opt_ignore_lines= -1; #include @@ -90,6 +91,10 @@ static struct my_option my_long_options[] = {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", &debug_info_flag, &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"default_auth", OPT_DEFAULT_AUTH, + "Default authentication client-side plugin to use.", + (uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"delete", 'd', "First delete all rows from table.", &opt_delete, &opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"fields-terminated-by", OPT_FTB, @@ -139,6 +144,9 @@ static struct my_option my_long_options[] = {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif + {"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.", + (uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"port", 'P', "Port number to use for connection or 0 for default to, in " "order of preference, my.cnf, $MYSQL_TCP_PORT, " #if MYSQL_PORT_DEFAULT == 0 @@ -429,6 +437,13 @@ static MYSQL *db_connect(char *host, char *database, if (shared_memory_base_name) mysql_options(mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name); #endif + + if (opt_plugin_dir && *opt_plugin_dir) + mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir); + + if (opt_default_auth && *opt_default_auth) + mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth); + mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset); if (!(mysql_real_connect(mysql,host,user,passwd, database,opt_mysql_port,opt_mysql_unix_port, diff --git a/client/mysqlshow.c b/client/mysqlshow.c index 8cd70db1424..f8a32aae2c0 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -34,6 +34,7 @@ static my_bool debug_info_flag= 0, debug_check_flag= 0; static uint my_end_arg= 0; static uint opt_verbose=0; static char *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME; +static char *opt_plugin_dir= 0, *opt_default_auth= 0; #ifdef HAVE_SMEM static char *shared_memory_base_name=0; @@ -124,6 +125,12 @@ int main(int argc, char **argv) #endif mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset); + if (opt_plugin_dir && *opt_plugin_dir) + mysql_options(&mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir); + + if (opt_default_auth && *opt_default_auth) + mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth); + if (!(mysql_real_connect(&mysql,host,user,opt_password, (first_argument_uses_wildcards) ? "" : argv[0],opt_mysql_port,opt_mysql_unix_port, @@ -182,6 +189,10 @@ static struct my_option my_long_options[] = {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", &debug_info_flag, &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"default_auth", OPT_DEFAULT_AUTH, + "Default authentication client-side plugin to use.", + (uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Connect to host.", &host, &host, 0, GET_STR, @@ -195,6 +206,9 @@ static struct my_option my_long_options[] = "Password to use when connecting to server. If password is not given, it's " "solicited on the tty.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.", + (uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"port", 'P', "Port number to use for connection or 0 for default to, in " "order of preference, my.cnf, $MYSQL_TCP_PORT, " #if MYSQL_PORT_DEFAULT == 0 diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 01d96f1f75e..237fa18c226 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -122,6 +122,7 @@ static char *host= NULL, *opt_password= NULL, *user= NULL, *pre_system= NULL, *post_system= NULL, *opt_mysql_unix_port= NULL; +static char *opt_plugin_dir= 0, *opt_default_auth= 0; const char *delimiter= "\n"; @@ -338,6 +339,12 @@ int main(int argc, char **argv) #endif mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset); + if (opt_plugin_dir && *opt_plugin_dir) + mysql_options(&mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir); + + if (opt_default_auth && *opt_default_auth) + mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth); + if (!opt_only_print) { if (!(mysql_real_connect(&mysql, host, user, opt_password, @@ -581,6 +588,10 @@ static struct my_option my_long_options[] = GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"debug-info", 'T', "Print some debug info at exit.", &debug_info_flag, &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"default_auth", OPT_DEFAULT_AUTH, + "Default authentication client-side plugin to use.", + (uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"delimiter", 'F', "Delimiter to use in SQL statements supplied in file or command line.", &delimiter, &delimiter, 0, GET_STR, REQUIRED_ARG, @@ -620,6 +631,9 @@ static struct my_option my_long_options[] = {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif + {"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.", + (uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"port", 'P', "Port number to use for connection.", &opt_mysql_port, &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, 0}, diff --git a/cmake/character_sets.cmake b/cmake/character_sets.cmake index d51444ec433..1cf63ed1462 100644 --- a/cmake/character_sets.cmake +++ b/cmake/character_sets.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 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 @@ -13,17 +13,19 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -#Charsets and collations +# Charsets and collations IF(NOT DEFAULT_CHARSET) -SET(DEFAULT_CHARSET "latin1") + SET(DEFAULT_CHARSET "latin1") ENDIF() -IF(NOT DEFAULT_COLLATIONS) -SET(DEFAULT_COLLATION "latin1_swedish_ci") +IF(NOT DEFAULT_COLLATION) + SET(DEFAULT_COLLATION "latin1_swedish_ci") ENDIF() SET(CHARSETS ${DEFAULT_CHARSET} latin1 utf8 utf8mb4) -SET(CHARSETS_COMPLEX big5 cp1250 cp932 eucjpms euckr gb2312 gbk latin1 latin2 sjis tis620 ucs2 ujis utf8 utf8mb4 utf16 utf32) +SET(CHARSETS_COMPLEX + big5 cp1250 cp932 eucjpms euckr gb2312 gbk latin1 latin2 + sjis tis620 ucs2 ujis utf8 utf8mb4 utf16 utf32) SET(CHARSETS_AVAILABLE binary armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257 diff --git a/config.h.cmake b/config.h.cmake index 204e1032410..65ebd077da6 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -1,6 +1,5 @@ -/* Copyright (C) 2009, 2011, Oracle and/or its affiliates. All rights - reserved - +/* 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 the Free Software Foundation; version 2 of the License. @@ -516,8 +515,8 @@ #cmakedefine CYBOZU 1 /* Character sets and collations */ -#cmakedefine MYSQL_DEFAULT_CHARSET_NAME "latin1" -#cmakedefine MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci" +#cmakedefine MYSQL_DEFAULT_CHARSET_NAME "@MYSQL_DEFAULT_CHARSET_NAME@" +#cmakedefine MYSQL_DEFAULT_COLLATION_NAME "@MYSQL_DEFAULT_COLLATION_NAME@" #cmakedefine USE_MB 1 #cmakedefine USE_MB_IDENT 1 diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c index 89fd4104c6f..25ec8beb59f 100644 --- a/extra/my_print_defaults.c +++ b/extra/my_print_defaults.c @@ -193,7 +193,7 @@ int main(int argc, char **argv) } for (argument= arguments+1 ; *argument ; argument++) - if (*argument != args_separator) /* skip arguments separator */ + if (!my_getopt_is_args_separator(*argument)) /* skip arguments separator */ puts(*argument); my_free(load_default_groups); free_defaults(arguments); diff --git a/include/my_sys.h b/include/my_sys.h index b5aa8696767..8d0c4e0afd0 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -819,7 +819,8 @@ extern void *memdup_root(MEM_ROOT *root,const void *str, size_t len); extern int get_defaults_options(int argc, char **argv, char **defaults, char **extra_defaults, char **group_suffix); -extern const char *args_separator; +extern my_bool my_getopt_use_args_separator; +extern my_bool my_getopt_is_args_separator(const char* arg); extern int my_load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv, const char ***); extern int load_defaults(const char *conf_file, const char **groups, diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index 22378ebe174..7ffc88745ea 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -10,9 +10,7 @@ innodb.innodb_information_schema # Bug#48883 2010-05-11 alik Test "innod main.func_math @freebsd # Bug#43020 2010-05-04 alik main.func_math fails on FreeBSD in PB2 main.gis # Bug#52208 2010-11-24 alik gis fails on some platforms (Solaris, HP-UX, Linux) main.gis-rtree @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server -main.information_schema # Bug#47449 2009-09-19 alik main.information_schema and innodb.innodb_information_schema fail sporadically main.lock_multi_bug38499 # Bug#47448 2009-09-19 alik main.lock_multi_bug38499 times out sporadically -main.lowercase_table2 @darwin # Bug#55509 2010-07-26 alik main.lowercase_table2 fails on Mac OSX (again) main.outfile_loaddata @solaris # Bug#46895 2010-01-20 alik Test "outfile_loaddata" fails (reproducible) main.signal_demo3 @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun main.sp @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun diff --git a/mysql-test/extra/rpl_tests/rpl_show_binlog_events.inc b/mysql-test/extra/rpl_tests/rpl_show_binlog_events.inc new file mode 100644 index 00000000000..4530f8c639a --- /dev/null +++ b/mysql-test/extra/rpl_tests/rpl_show_binlog_events.inc @@ -0,0 +1,17 @@ +# Include file for rpl_show_relaylog_events.inc + +--let $log_type= BINLOG +if ($is_relay_log) { + --let $log_type= RELAYLOG +} +--let $args= +if ($binlog_file != '') { + --let $args= IN +} +if ($binlog_limit) { + --let $args= $args LIMIT $binlog_limit +} +--echo ******** [$CURRENT_CONNECTION] SHOW $log_type EVENTS $args ******** +--source include/show_events.inc + + diff --git a/mysql-test/extra/rpl_tests/rpl_show_log_events_with_varying_options.inc b/mysql-test/extra/rpl_tests/rpl_show_log_events_with_varying_options.inc new file mode 100644 index 00000000000..411f388aaf3 --- /dev/null +++ b/mysql-test/extra/rpl_tests/rpl_show_log_events_with_varying_options.inc @@ -0,0 +1,11 @@ +# Include file for rpl_show_log_events.inc + +--let $binlog_limit= +--source extra/rpl_tests/rpl_show_binlog_events.inc +--let $binlog_limit= 1 +--source extra/rpl_tests/rpl_show_binlog_events.inc +--let $binlog_limit= 1,3 +--source extra/rpl_tests/rpl_show_binlog_events.inc +--let $binlog_limit= +--let $binlog_file= +--source extra/rpl_tests/rpl_show_binlog_events.inc diff --git a/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc b/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc index d32dd485e19..a56e08ece42 100644 --- a/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc +++ b/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc @@ -1,103 +1,62 @@ +-- connection master +-- source include/rpl_reset.inc + -- connection master CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (2); INSERT INTO t1 VALUES (3); -INSERT INTO t1 VALUES (4); -INSERT INTO t1 VALUES (5); -INSERT INTO t1 VALUES (6); --- echo [MASTER] ********* SOW BINLOG EVENTS IN ... ********* --- source include/show_binlog_events.inc +# PART I +# +# SHOWs contents of binary logs on the master and both, binary and +# relay logs, on the slave. +# --- echo [MASTER] ********* SOW BINLOG EVENTS ********* -let $binlog_file= ; --- source include/show_binlog_events.inc +--let $is_relay_log= 0 +--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) +--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc --- echo [MASTER] ********* SOW BINLOG EVENTS ... LIMIT rows ********* -let $binlog_limit= 3; --- source include/show_binlog_events.inc +--sync_slave_with_master +--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) +--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc --- echo [MASTER] ********* SOW BINLOG EVENTS ... LIMIT offset,rows ********* -let $binlog_limit= 1,4; --- source include/show_binlog_events.inc +--let $is_relay_log= 1 +--let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1) +--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc -# clear show_binlog_event/show_relaylog_events parameters -let $binlog_limit= ; - --- sync_slave_with_master - --- echo [SLAVE] ********* SOW BINLOG EVENTS IN ... ********* --- source include/show_binlog_events.inc - --- echo [SLAVE] ********* SOW BINLOG EVENTS ********* -let $binlog_file= ; --- source include/show_binlog_events.inc - --- echo [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT rows ********* -let $binlog_limit= 3; --- source include/show_binlog_events.inc - --- echo [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT offset,rows ********* -let $binlog_limit= 1,4; --- source include/show_binlog_events.inc - -# clear show_binlog_event/show_relaylog_events parameters -let $binlog_limit= ; - --- echo [SLAVE] ********* SOW RELAYLOG EVENTS IN ... ********* -let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1); --- source include/show_relaylog_events.inc - --- echo [SLAVE] ********* SOW RELAYLOG EVENTS ********* -let $binlog_file= ; --- source include/show_relaylog_events.inc - --- echo [MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT rows ********* -let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1); -let $binlog_limit= 3; --- source include/show_relaylog_events.inc - --- echo [MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT offset,rows ********* -let $binlog_limit= 1,3; --- source include/show_relaylog_events.inc +# +# PART II +# +# Although this second part of the test may seem redudant it is +# actually needed to assert that SHOW RELAYLOG EVENTS works properly +# with respect to the ordering of the relay log in relay-log.index. +# +# If no file is specified with "IN" then first relay log file in +# relay-log.index (ie, the oldest one) should be picked and its +# contents displayed. The same happens for SHOW BINLOG EVENTS, so we +# show them both. All in all, this is the reason for re-assert after +# MASTER and SLAVE's FLUSH LOGS operations. +# FLUSH LOGS; -let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1); - -- connection master FLUSH LOGS; DROP TABLE t1; -# clear show_binlog_event/show_relaylog_events parameters -let $binlog_file= ; -let $binlog_limit= ; +--let $is_relay_log= 0 +--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) +--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc --- echo [MASTER] ********* SOW BINLOG EVENTS IN ... ********* -let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1); --- source include/show_binlog_events.inc +--sync_slave_with_master +--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) +--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc --- echo [MASTER] ********* SOW BINLOG EVENTS ********* -let $binlog_file= ; --- source include/show_binlog_events.inc +--let $is_relay_log= 1 +--let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1) +--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc --- sync_slave_with_master - --- echo [SLAVE] ********* SOW BINLOG EVENTS IN ... ********* -let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1); --- source include/show_binlog_events.inc - --- echo [SLAVE] ********* SOW BINLOG EVENTS ********* -let $binlog_file= ; --- source include/show_binlog_events.inc - --- echo [SLAVE] ********* SOW RELAYLOG EVENTS IN ... ********* --- source include/show_relaylog_events.inc - --- echo [SLAVE] ********* SOW RELAYLOG EVENTS ********* -let $binlog_file= ; --- source include/show_relaylog_events.inc # clear show_binlog_event/show_relaylog_events parameters let $binlog_file= ; diff --git a/mysql-test/include/restart_slave_sql.inc b/mysql-test/include/restart_slave_sql.inc new file mode 100644 index 00000000000..ee6c6d7ced6 --- /dev/null +++ b/mysql-test/include/restart_slave_sql.inc @@ -0,0 +1,43 @@ +# ==== Purpose ==== +# +# Provide a earier way to restart SQL thread when you want to stop sql thread +# and then start it immediately. +# +# Sources stop_slave_sql.inc to stop SQL thread on the current connection. +# Then issues START SLAVE SQL_THREAD and then waits until +# the SQL threads have started, or until a timeout is reached. +# +# Please use this instead of 'STOP|START SLAVE SQL_THREAD', to reduce the risk of +# test case bugs. +# +# +# ==== Usage ==== +# +# [--let $slave_timeout= NUMBER] +# [--let $rpl_debug= 1] +# --source include/restart_slave_sql.inc +# +# Parameters: +# $slave_timeout +# See include/wait_for_slave_param.inc +# +# $rpl_debug +# See include/rpl_init.inc + + +--let $include_filename= restart_slave.inc +--source include/begin_include_file.inc + + +if (!$rpl_debug) +{ + --disable_query_log +} + +source include/stop_slave_sql.inc; +START SLAVE SQL_THREAD; +source include/wait_for_slave_sql_to_start.inc; + + +--let $include_filename= restart_slave.inc +--source include/end_include_file.inc \ No newline at end of file diff --git a/mysql-test/include/rpl_connection_master.inc b/mysql-test/include/rpl_connection_master.inc new file mode 100644 index 00000000000..e54e34071c8 --- /dev/null +++ b/mysql-test/include/rpl_connection_master.inc @@ -0,0 +1,2 @@ +let $rpl_connection_name= master; +source include/rpl_connection.inc; \ No newline at end of file diff --git a/mysql-test/include/rpl_connection_slave.inc b/mysql-test/include/rpl_connection_slave.inc new file mode 100644 index 00000000000..ef3876394d6 --- /dev/null +++ b/mysql-test/include/rpl_connection_slave.inc @@ -0,0 +1,2 @@ +let $rpl_connection_name= slave; +source include/rpl_connection.inc; \ No newline at end of file diff --git a/mysql-test/include/rpl_connection_slave1.inc b/mysql-test/include/rpl_connection_slave1.inc new file mode 100644 index 00000000000..8aee6defbdd --- /dev/null +++ b/mysql-test/include/rpl_connection_slave1.inc @@ -0,0 +1,2 @@ +let $rpl_connection_name= slave1; +source include/rpl_connection.inc; \ No newline at end of file diff --git a/mysql-test/include/rpl_start_server.inc b/mysql-test/include/rpl_start_server.inc index c59c7759910..ac8106f141c 100644 --- a/mysql-test/include/rpl_start_server.inc +++ b/mysql-test/include/rpl_start_server.inc @@ -45,7 +45,15 @@ if ($rpl_server_parameters) --source include/rpl_connection.inc # Write file to make mysql-test-run.pl start up the server again ---exec echo "$_rpl_start_server_command" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect +--let WRITE_TO_FILE= $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect +--let WRITE_TO_VAR= $_rpl_start_server_command +perl; +my $file= $ENV{'WRITE_TO_FILE'}; +my $var= $ENV{'WRITE_TO_VAR'}; +open WRITE_FILE, ">> $file" or die "Error opening $file: $!"; +print WRITE_FILE $var, "\n" or die "Error appending to $file: $!"; +close WRITE_FILE or die "Error closing $file: $!"; +EOF --source include/rpl_reconnect.inc diff --git a/mysql-test/include/rpl_stop_server.inc b/mysql-test/include/rpl_stop_server.inc index e1f8839dd69..a90981d6de8 100644 --- a/mysql-test/include/rpl_stop_server.inc +++ b/mysql-test/include/rpl_stop_server.inc @@ -44,7 +44,9 @@ if ($rpl_debug) # Write file to make mysql-test-run.pl expect the "crash", but don't start # it until it's told to ---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect +wait +EOF # Send shutdown to the connected server and give # it 10 seconds to die before zapping it diff --git a/mysql-test/include/setup_fake_relay_log.inc b/mysql-test/include/setup_fake_relay_log.inc index da3ce8e6038..4f1d4f6f162 100644 --- a/mysql-test/include/setup_fake_relay_log.inc +++ b/mysql-test/include/setup_fake_relay_log.inc @@ -74,6 +74,7 @@ let $_fake_relay_index= $_fake_datadir/$_fake_filename.index; let $_fake_relay_log_purge= `SELECT @@global.relay_log_purge`; RESET SLAVE; +let $_orphan_relay_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1); # Create relay log file. --copy_file $fake_relay_log $_fake_relay_log @@ -102,6 +103,8 @@ RESET SLAVE; # Setup replication from existing relay log. eval CHANGE MASTER TO MASTER_HOST='dummy.localdomain', RELAY_LOG_FILE='$_fake_filename-fake.000001', RELAY_LOG_POS=4; +# remove the orphan log file (became spurious) +-- remove_file $_fake_datadir/$_orphan_relay_file --let $include_filename= setup_fake_relay_log.inc --source include/end_include_file.inc diff --git a/mysql-test/r/client_xml.result b/mysql-test/r/client_xml.result index aa4bdb2bd61..7f74a092af7 100644 --- a/mysql-test/r/client_xml.result +++ b/mysql-test/r/client_xml.result @@ -21,9 +21,9 @@ insert into t1 values (1, 2, 'a&b ab'); - - - + + + diff --git a/mysql-test/r/ctype_many.result b/mysql-test/r/ctype_many.result index 0b061f507a7..4ea5efab159 100644 --- a/mysql-test/r/ctype_many.result +++ b/mysql-test/r/ctype_many.result @@ -1684,6 +1684,21 @@ ARMENIAN CAPIT ECH 2 ARMENIAN CAPIT ZA 2 DROP TABLE t1; # +# Start of 5.1 tests +# +# +# Bug#58371 Assertion failed: !s.uses_buffer_owned_by(this) with format string function +# +SET NAMES latin1; +DO CONVERT(CAST(SUBSTRING_INDEX(FORMAT(1,'1111'), FORMAT('','Zpq'),1) +AS BINARY(0)) USING utf8); +Warnings: +Warning 1292 Truncated incorrect INTEGER value: 'Zpq' +Warning 1292 Truncated incorrect BINARY(0) value: '1.' +# +# End of 5.1 tests +# +# # Start of 5.5 tests # # diff --git a/mysql-test/r/func_like.result b/mysql-test/r/func_like.result index 552ff564a89..39590eb1c99 100644 --- a/mysql-test/r/func_like.result +++ b/mysql-test/r/func_like.result @@ -182,4 +182,9 @@ INSERT INTO t2 VALUES (1), (2), (3); SELECT 1 FROM t2 JOIN t1 ON 1 LIKE a GROUP BY a; 1 DROP TABLE t1, t2; +# +# Bug#59149 valgrind warnings with "like .. escape .." function +# +SELECT '' LIKE '1' ESCAPE COUNT(1); +ERROR HY000: Incorrect arguments to ESCAPE End of 5.1 tests diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 31648aae7b0..3149a2a3344 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -641,3 +641,18 @@ INSERT INTO t1 (SELECT -pi()); Warnings: Warning 1265 Data truncated for column 'a' at row 1 DROP TABLE t1; +# +# Bug #59241 invalid memory read +# in do_div_mod with doubly assigned variables +# +SELECT ((@a:=@b:=1.0) div (@b:=@a:=get_format(datetime, 'usa'))); +((@a:=@b:=1.0) div (@b:=@a:=get_format(datetime, 'usa'))) +NULL +Warnings: +Warning 1366 Incorrect decimal value: '' for column '' at row -1 +# +# Bug #59498 div function broken in mysql-trunk +# +SELECT 1 div null; +1 div null +NULL diff --git a/mysql-test/r/mysqladmin.result b/mysql-test/r/mysqladmin.result index 57927f8aa67..748152bffcc 100644 --- a/mysql-test/r/mysqladmin.result +++ b/mysql-test/r/mysqladmin.result @@ -2,3 +2,11 @@ mysqld is alive mysqladmin: unknown variable 'database=db1' Warning: mysqladmin: unknown variable 'loose-database=db2' mysqld is alive +# +# Bug#58221 : mysqladmin --sleep=x --count=x keeps looping +# +# Executing mysqladmin with --sleep=1 and --count=2. +# Done. +# Displaying the output : +mysqld is alive +mysqld is alive diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result index 60ba06c8f7e..6659a291e0b 100644 --- a/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-test/r/mysqld--help-notwin.result @@ -20,6 +20,7 @@ The following options may be given as the first argument: Offset added to Auto-increment columns. Used when auto-increment-increment != 1 --autocommit Set default value for autocommit (0 or 1) + (Defaults to on; use --skip-autocommit to disable.) --automatic-sp-privileges Creating and dropping stored procedures alters ACLs (Defaults to on; use --skip-automatic-sp-privileges to disable.) @@ -732,6 +733,7 @@ abort-slave-event-count 0 allow-suspicious-udfs FALSE auto-increment-increment 1 auto-increment-offset 1 +autocommit TRUE automatic-sp-privileges TRUE back-log 50 big-tables FALSE diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index dfb53937245..240c29294e2 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -20,6 +20,7 @@ The following options may be given as the first argument: Offset added to Auto-increment columns. Used when auto-increment-increment != 1 --autocommit Set default value for autocommit (0 or 1) + (Defaults to on; use --skip-autocommit to disable.) --automatic-sp-privileges Creating and dropping stored procedures alters ACLs (Defaults to on; use --skip-automatic-sp-privileges to disable.) @@ -736,6 +737,7 @@ abort-slave-event-count 0 allow-suspicious-udfs FALSE auto-increment-increment 1 auto-increment-offset 1 +autocommit TRUE automatic-sp-privileges TRUE back-log 50 big-tables FALSE diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 892501f2b28..dd3ea5e9716 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -14,7 +14,7 @@ INSERT INTO t1 VALUES (1), (2); - + @@ -150,9 +150,9 @@ INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES"); - - - + + + @@ -178,7 +178,7 @@ INSERT INTO t1 VALUES ("1\""), ("\"2"); - + @@ -1612,10 +1612,10 @@ CREATE TABLE `t2` ( - + - + @@ -1623,10 +1623,10 @@ CREATE TABLE `t2` ( - + - + @@ -3644,8 +3644,8 @@ INSERT INTO t1 VALUES(1,0xff00fef0); - - + + @@ -4576,5 +4576,20 @@ LENGTH(a) 800 DROP TABLE t1, t2; # +# Bug #13618 : mysqldump --xml ommit comment on table field +# +CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE COMMENT'; + + + + + + + + + + +DROP TABLE `comment_table`; +# # End of 5.1 tests # diff --git a/mysql-test/r/plugin_auth.result b/mysql-test/r/plugin_auth.result index b155b296ac1..fa6908530b7 100644 --- a/mysql-test/r/plugin_auth.result +++ b/mysql-test/r/plugin_auth.result @@ -319,7 +319,7 @@ Proxied_user With_grant 1 FLUSH PRIVILEGES; # -# Bug#58139 : default-auth option not recognized in MySQL standardi +# Bug#58139 : default-auth option not recognized in MySQL standard # command line clients # # Executing 'mysql' @@ -328,4 +328,6 @@ FLUSH PRIVILEGES; # Executing 'mysqladmin' mysqld is alive # Executing 'mysqldump' +# Executing 'mysql_upgrade' +The --upgrade-system-tables option was used, databases won't be touched. End of 5.5 tests diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index d42cb680112..feeba25c536 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -1325,6 +1325,17 @@ Tables_in_test Table_type été BASE TABLE drop table `été`; set names latin1; +# +# Bug#4374 SHOW TABLE STATUS FROM ignores collation_connection +# Character set: Latin-1 (ISO-8859-1) +# +SET NAMES latin1; +CREATE DATABASE `ä`; +CREATE TABLE `ä`.`ä` (a int) ENGINE=Memory; +SHOW TABLE STATUS FROM `ä` LIKE 'ä'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +ä MEMORY 10 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +DROP DATABASE `ä`; show columns from `#mysql50#????????`; Got one of the listed errors DROP TABLE IF EXISTS t1; diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result index 6b7ba57ce2e..4568775d3fd 100644 --- a/mysql-test/r/xml.result +++ b/mysql-test/r/xml.result @@ -1113,6 +1113,17 @@ SELECT UPDATEXML(NULL, (LPAD(0.1111E-15, '2011', 1)), 1); ERROR 22007: Illegal double '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' value found during parsing SELECT EXTRACTVALUE('', LPAD(0.1111E-15, '2011', 1)); ERROR 22007: Illegal double '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' value found during parsing +# +# Bug #44332 my_xml_scan reads behind the end of buffer +# +SELECT UPDATEXML(CONVERT(_latin1'<' USING utf8),'1','1'); +UPDATEXML(CONVERT(_latin1'<' USING utf8),'1','1') +NULL +Warnings: +Warning 1525 Incorrect XML value: 'parse error at line 1 pos 2: END-OF-INPUT unexpected (ident or '/' wanted)' +SELECT UPDATEXML(CONVERT(_latin1'", 3); p->cur++) - {} - if (!memcmp(p->cur, "-->", 3)) - p->cur+=3; + for (; p->cur < p->end; p->cur++) + { + if (!my_xml_parser_prefix_cmp(p, C_STRING_WITH_LEN("-->"))) + { + p->cur+= 3; + break; + } + } a->end=p->cur; lex=MY_XML_COMMENT; } - else if (!memcmp(p->cur, "cur+= 9; for (; p->cur < p->end - 2 ; p->cur++)