diff options
179 files changed, 5739 insertions, 1214 deletions
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index dcfdff1a81f..ce441695d6f 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -1,6 +1,6 @@ /* Copyright (c) 2006, 2013, Oracle and/or its affiliates. - Copyright (c) 2010, 2013, Monty Program Ab. + Copyright (c) 2010, 2015, MariaDB 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 @@ -36,6 +36,8 @@ # endif #endif +static int phase = 0; +static int phases_total = 6; static char mysql_path[FN_REFLEN]; static char mysqlcheck_path[FN_REFLEN]; @@ -45,6 +47,8 @@ static my_bool opt_not_used, opt_silent; static uint my_end_arg= 0; static char *opt_user= (char*)"root"; +static my_bool upgrade_from_mysql; + static DYNAMIC_STRING ds_args; static DYNAMIC_STRING conn_args; @@ -206,12 +210,12 @@ static void die(const char *fmt, ...) } -static int verbose(const char *fmt, ...) +static void verbose(const char *fmt, ...) { va_list args; if (opt_silent) - return 0; + return; /* Print the verbose message */ va_start(args, fmt); @@ -222,7 +226,6 @@ static int verbose(const char *fmt, ...) fflush(stdout); } va_end(args); - return 0; } @@ -740,10 +743,21 @@ static void print_conn_args(const char *tool_name) in the server using "mysqlcheck --check-upgrade .." */ -static int run_mysqlcheck_upgrade(const char *arg1, const char *arg2) +static int run_mysqlcheck_upgrade(my_bool mysql_db_only) { + const char *what= mysql_db_only ? "mysql database" : "tables"; + const char *arg1= mysql_db_only ? "--databases" : "--all-databases"; + const char *arg2= mysql_db_only ? "mysql" : "--skip-database=mysql"; + int retch; + if (opt_systables_only && !mysql_db_only) + { + verbose("Phase %d/%d: Checking and upgrading %s... Skipped", + ++phase, phases_total, what); + return 0; + } + verbose("Phase %d/%d: Checking and upgrading %s", ++phase, phases_total, what); print_conn_args("mysqlcheck"); - return run_tool(mysqlcheck_path, + retch= run_tool(mysqlcheck_path, NULL, /* Send output from mysqlcheck directly to screen */ "--no-defaults", ds_args.str, @@ -757,12 +771,77 @@ static int run_mysqlcheck_upgrade(const char *arg1, const char *arg2) arg1, arg2, "2>&1", NULL); + return retch; } +#define EVENTS_STRUCT_LEN 7000 + +static my_bool is_mysql() +{ + my_bool ret= TRUE; + DYNAMIC_STRING ds_events_struct; + + if (init_dynamic_string(&ds_events_struct, NULL, + EVENTS_STRUCT_LEN, EVENTS_STRUCT_LEN)) + die("Out of memory"); + + if (run_query("show create table mysql.event", + &ds_events_struct, FALSE) || + strstr(ds_events_struct.str, "IGNORE_BAD_TABLE_OPTIONS") != NULL) + ret= FALSE; + else + verbose("MySQL upgrade detected"); + + dynstr_free(&ds_events_struct); + return(ret); +} + +static int run_mysqlcheck_views(void) +{ + const char *upgrade_views="--process-views=YES"; + if (upgrade_from_mysql) + { + /* + this has to ignore opt_systables_only, because upgrade_from_mysql + is determined by analyzing systables. if we honor opt_systables_only + here, views won't be fixed by subsequent mysql_upgrade runs + */ + upgrade_views="--process-views=UPGRADE_FROM_MYSQL"; + verbose("Phase %d/%d: Fixing views from mysql", ++phase, phases_total); + } + else if (opt_systables_only) + { + verbose("Phase %d/%d: Fixing views... Skipped", ++phase, phases_total); + return 0; + } + else + verbose("Phase %d/%d: Fixing views", ++phase, phases_total); + + print_conn_args("mysqlcheck"); + return run_tool(mysqlcheck_path, + NULL, /* Send output from mysqlcheck directly to screen */ + "--no-defaults", + ds_args.str, + "--all-databases", "--repair", + upgrade_views, + "--skip-process-tables", + opt_verbose ? "--verbose": "", + opt_silent ? "--silent": "", + opt_write_binlog ? "--write-binlog" : "--skip-write-binlog", + "2>&1", + NULL); +} static int run_mysqlcheck_fixnames(void) { - verbose("Phase 3/5: Fixing table and database names"); + if (opt_systables_only) + { + verbose("Phase %d/%d: Fixing table and database names ... Skipped", + ++phase, phases_total); + return 0; + } + verbose("Phase %d/%d: Fixing table and database names", + ++phase, phases_total); print_conn_args("mysqlcheck"); return run_tool(mysqlcheck_path, NULL, /* Send output from mysqlcheck directly to screen */ @@ -850,6 +929,9 @@ static int run_sql_fix_privilege_tables(void) if (init_dynamic_string(&ds_result, "", 512, 512)) die("Out of memory"); + verbose("Phase %d/%d: Running 'mysql_fix_privilege_tables'", + ++phase, phases_total); + /* Individual queries can not be executed independently by invoking a forked mysql client, because the script uses session variables @@ -1019,23 +1101,19 @@ int main(int argc, char **argv) if (opt_version_check && check_version_match()) die("Upgrade failed"); + upgrade_from_mysql= is_mysql(); + /* Run "mysqlcheck" and "mysql_fix_privilege_tables.sql" */ - verbose("Phase 1/5: Checking mysql database"); - if (run_mysqlcheck_upgrade("--databases", "mysql")) - die("Upgrade failed" ); - verbose("Phase 2/5: Running 'mysql_fix_privilege_tables'..."); - if (run_sql_fix_privilege_tables()) + if (run_mysqlcheck_upgrade(TRUE) || + run_mysqlcheck_views() || + run_sql_fix_privilege_tables() || + run_mysqlcheck_fixnames() || + run_mysqlcheck_upgrade(FALSE)) die("Upgrade failed" ); - if (!opt_systables_only && - (run_mysqlcheck_fixnames() || - verbose("Phase 4/5: Checking and upgrading tables") || - run_mysqlcheck_upgrade("--all-databases","--skip-database=mysql"))) - die("Upgrade failed" ); - - verbose("Phase 5/5: Running 'FLUSH PRIVILEGES'..."); + verbose("Phase %d/%d: Running 'FLUSH PRIVILEGES'", ++phase, phases_total); if (run_query("FLUSH PRIVILEGES", NULL, TRUE)) die("Upgrade failed" ); @@ -1044,6 +1122,8 @@ int main(int argc, char **argv) /* Create a file indicating upgrade has been performed */ create_mysql_upgrade_info_file(); + DBUG_ASSERT(phase == phases_total); + free_used_memory(); my_end(my_end_arg); exit(0); diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 88016d9563d..bc6b68c63d1 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -1,6 +1,6 @@ /* Copyright (c) 2000, 2014, Oracle and/or its affiliates. - Copyright (c) 2010, 2014, Monty Program Ab. + Copyright (c) 2010, 2015, MariaDB 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 @@ -1249,6 +1249,9 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) static char **mask_password(int argc, char ***argv) { char **temp_argv; + if (!argc) + return NULL; + temp_argv= (char **)(my_malloc(sizeof(char *) * argc, MYF(MY_WME))); argc--; while (argc > 0) diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 7090988525c..7ec2812d233 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -1,6 +1,6 @@ /* Copyright (c) 2001, 2013, Oracle and/or its affiliates. - Copyright (c) 2010, 2013, Monty Program Ab. + Copyright (c) 2010, 2015, MariaDB 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 @@ -18,7 +18,7 @@ /* By Jani Tolonen, 2001-04-20, MySQL Development Team */ -#define CHECK_VERSION "2.7.3-MariaDB" +#define CHECK_VERSION "2.7.4-MariaDB" #include "client_priv.h" #include <m_ctype.h> @@ -42,7 +42,8 @@ static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0, opt_medium_check = 0, opt_quick = 0, opt_all_in_1 = 0, opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0, tty_password= 0, opt_frm= 0, debug_info_flag= 0, debug_check_flag= 0, - opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0; + opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0, + opt_do_tables= 1; static my_bool opt_write_binlog= 1, opt_flush_tables= 0; static uint verbose = 0, opt_mysql_port=0; static int my_end_arg; @@ -56,7 +57,17 @@ DYNAMIC_ARRAY tables4repair, tables4rebuild, alter_table_cmds; static char *shared_memory_base_name=0; static uint opt_protocol=0; -enum operations { DO_CHECK=1, DO_REPAIR, DO_ANALYZE, DO_OPTIMIZE, DO_UPGRADE }; +enum operations { DO_CHECK=1, DO_REPAIR, DO_ANALYZE, DO_OPTIMIZE, DO_FIX_NAMES }; +const char *operation_name[]= +{ + "???", "check", "repair", "analyze", "optimize", "fix names" +}; + +typedef enum { DO_VIEWS_NO, DO_VIEWS_YES, DO_VIEWS_FROM_MYSQL } enum_do_views; +const char *do_views_opts[]= {"NO", "YES", "UPGRADE_FROM_MYSQL", NullS}; +TYPELIB do_views_typelib= { array_elements(do_views_opts) - 1, "", + do_views_opts, NULL }; +static ulong opt_do_views= DO_VIEWS_NO; static struct my_option my_long_options[] = { @@ -200,6 +211,14 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"process-views", 0, + "Perform the requested operation (check or repair) on views. " + "One of: NO, YES (correct the checksum, if necessary, add the " + "mariadb-version field), UPGRADE_FROM_MYSQL (same as YES and toggle " + "the algorithm MERGE<->TEMPTABLE.", &opt_do_views, &opt_do_views, + &do_views_typelib, GET_ENUM, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"process-tables", 0, "Perform the requested operation on tables.", + &opt_do_tables, &opt_do_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -216,7 +235,7 @@ static int process_selected_tables(char *db, char **table_names, int tables); static int process_all_tables_in_db(char *database); static int process_one_db(char *database); static int use_db(char *database); -static int handle_request_for_tables(char *tables, uint length); +static int handle_request_for_tables(char *tables, size_t length, my_bool view); static int dbConnect(char *host, char *user,char *passwd); static void dbDisconnect(char *host); static void DBerror(MYSQL *mysql, const char *when); @@ -294,11 +313,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), what_to_do = DO_OPTIMIZE; break; case OPT_FIX_DB_NAMES: - what_to_do= DO_UPGRADE; + what_to_do= DO_FIX_NAMES; opt_databases= 1; break; case OPT_FIX_TABLE_NAMES: - what_to_do= DO_UPGRADE; + what_to_do= DO_FIX_NAMES; break; case 'p': if (argument == disabled_my_option) @@ -339,7 +358,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case 'v': verbose++; break; - case 'V': print_version(); exit(0); + case 'V': + print_version(); exit(0); + break; case OPT_MYSQL_PROTOCOL: opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, opt->name); @@ -348,7 +369,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), if (orig_what_to_do && (what_to_do != orig_what_to_do)) { - fprintf(stderr, "Error: %s doesn't support multiple contradicting commands.\n", + fprintf(stderr, "Error: %s doesn't support multiple contradicting commands.\n", my_progname); DBUG_RETURN(1); } @@ -370,6 +391,12 @@ static int get_options(int *argc, char ***argv) if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option))) exit(ho_error); + if (what_to_do == DO_REPAIR && !opt_do_views && !opt_do_tables) + { + fprintf(stderr, "Error: Nothing to repair when both " + "--process-tables=NO and --process-views=NO\n"); + exit(1); + } if (!what_to_do) { size_t pnlen= strlen(my_progname); @@ -386,6 +413,13 @@ static int get_options(int *argc, char ***argv) what_to_do = DO_CHECK; } + if (opt_do_views && what_to_do != DO_REPAIR && what_to_do != DO_CHECK) + { + fprintf(stderr, "Error: %s doesn't support %s for views.\n", + my_progname, operation_name[what_to_do]); + exit(1); + } + /* If there's no --default-character-set option given with --fix-table-name or --fix-db-name set the default character set to "utf8". @@ -470,13 +504,41 @@ static int process_databases(char **db_names) } /* process_databases */ +/* returns: -1 for error, 1 for view, 0 for table */ +static int is_view(const char *table) +{ + char query[1024]; + MYSQL_RES *res; + MYSQL_FIELD *field; + int view; + DBUG_ENTER("is_view"); + + my_snprintf(query, sizeof(query), "SHOW CREATE TABLE %`s", table); + if (mysql_query(sock, query)) + { + fprintf(stderr, "Failed to %s\n", query); + fprintf(stderr, "Error: %s\n", mysql_error(sock)); + my_free(query); + DBUG_RETURN(-1); + } + res= mysql_store_result(sock); + field= mysql_fetch_field(res); + view= (strcmp(field->name,"View") == 0) ? 1 : 0; + mysql_free_result(res); + + DBUG_RETURN(view); +} + static int process_selected_tables(char *db, char **table_names, int tables) { + int view; + char *table; + uint table_len; DBUG_ENTER("process_selected_tables"); if (use_db(db)) DBUG_RETURN(1); - if (opt_all_in_1 && what_to_do != DO_UPGRADE) + if (opt_all_in_1 && what_to_do != DO_FIX_NAMES) { /* We need table list in form `a`, `b`, `c` @@ -487,6 +549,15 @@ static int process_selected_tables(char *db, char **table_names, int tables) size_t tot_length= 0; int i= 0; + if (opt_do_tables && opt_do_views) + { + fprintf(stderr, "Error: %s cannot process both tables and views " + "in one command (--process-tables=YES " + "--process-views=YES --all-in-1).\n", + my_progname); + DBUG_RETURN(1); + } + for (i = 0; i < tables; i++) tot_length+= fixed_name_length(*(table_names + i)) + 2; @@ -501,12 +572,20 @@ static int process_selected_tables(char *db, char **table_names, int tables) *end++= ','; } *--end = 0; - handle_request_for_tables(table_names_comma_sep + 1, (uint) (tot_length - 1)); + handle_request_for_tables(table_names_comma_sep + 1, tot_length - 1, + opt_do_views != 0); my_free(table_names_comma_sep); } else for (; tables > 0; tables--, table_names++) - handle_request_for_tables(*table_names, fixed_name_length(*table_names)); + { + table= *table_names; + table_len= fixed_name_length(*table_names); + view= is_view(table); + if (view < 0) + continue; + handle_request_for_tables(table, table_len, (view == 1)); + } DBUG_RETURN(0); } /* process_selected_tables */ @@ -553,6 +632,7 @@ static int process_all_tables_in_db(char *database) MYSQL_ROW row; uint num_columns; my_bool system_database= 0; + my_bool view= FALSE; DBUG_ENTER("process_all_tables_in_db"); if (use_db(database)) @@ -571,7 +651,7 @@ static int process_all_tables_in_db(char *database) num_columns= mysql_num_fields(res); - if (opt_all_in_1 && what_to_do != DO_UPGRADE) + if (opt_all_in_1 && what_to_do != DO_FIX_NAMES) { /* We need table list in form `a`, `b`, `c` @@ -582,8 +662,17 @@ static int process_all_tables_in_db(char *database) char *tables, *end; uint tot_length = 0; + char *views, *views_end; + uint tot_views_length = 0; + while ((row = mysql_fetch_row(res))) - tot_length+= fixed_name_length(row[0]) + 2; + { + if ((num_columns == 2) && (strcmp(row[1], "VIEW") == 0) && + opt_do_views) + tot_views_length+= fixed_name_length(row[0]) + 2; + else if (opt_do_tables) + tot_length+= fixed_name_length(row[0]) + 2; + } mysql_data_seek(res, 0); if (!(tables=(char *) my_malloc(sizeof(char)*tot_length+4, MYF(MY_WME)))) @@ -591,32 +680,62 @@ static int process_all_tables_in_db(char *database) mysql_free_result(res); DBUG_RETURN(1); } - for (end = tables + 1; (row = mysql_fetch_row(res)) ;) + if (!(views=(char *) my_malloc(sizeof(char)*tot_views_length+4, MYF(MY_WME)))) { - if ((num_columns == 2) && (strcmp(row[1], "VIEW") == 0)) - continue; + my_free(tables); + mysql_free_result(res); + DBUG_RETURN(1); + } - end= fix_table_name(end, row[0]); - *end++= ','; + for (end = tables + 1, views_end= views + 1; (row = mysql_fetch_row(res)) ;) + { + if ((num_columns == 2) && (strcmp(row[1], "VIEW") == 0)) + { + if (!opt_do_views) + continue; + views_end= fix_table_name(views_end, row[0]); + *views_end++= ','; + } + else + { + if (!opt_do_tables) + continue; + end= fix_table_name(end, row[0]); + *end++= ','; + } } *--end = 0; + *--views_end = 0; if (tot_length) - handle_request_for_tables(tables + 1, tot_length - 1); + handle_request_for_tables(tables + 1, tot_length - 1, FALSE); + if (tot_views_length) + handle_request_for_tables(views + 1, tot_views_length - 1, TRUE); my_free(tables); + my_free(views); } else { while ((row = mysql_fetch_row(res))) { /* Skip views if we don't perform renaming. */ - if ((what_to_do != DO_UPGRADE) && (num_columns == 2) && (strcmp(row[1], "VIEW") == 0)) - continue; + if ((what_to_do != DO_FIX_NAMES) && (num_columns == 2) && (strcmp(row[1], "VIEW") == 0)) + { + if (!opt_do_views) + continue; + view= TRUE; + } + else + { + if (!opt_do_tables) + continue; + view= FALSE; + } if (system_database && (!strcmp(row[0], "general_log") || !strcmp(row[0], "slow_log"))) continue; /* Skip logging tables */ - handle_request_for_tables(row[0], fixed_name_length(row[0])); + handle_request_for_tables(row[0], fixed_name_length(row[0]), view); } } mysql_free_result(res); @@ -704,7 +823,7 @@ static int process_one_db(char *database) if (verbose) puts(database); - if (what_to_do == DO_UPGRADE) + if (what_to_do == DO_FIX_NAMES) { int rc= 0; if (opt_fix_db_names && !strncmp(database,"#mysql50#", 9)) @@ -743,15 +862,17 @@ static int disable_binlog() return run_query(stmt, 0); } -static int handle_request_for_tables(char *tables, uint length) +static int handle_request_for_tables(char *tables, size_t length, my_bool view) { char *query, *end, options[100], message[100]; char table_name_buff[NAME_CHAR_LEN*2*2+1], *table_name; uint query_length= 0; const char *op = 0; + const char *tab_view; DBUG_ENTER("handle_request_for_tables"); options[0] = 0; + tab_view= view ? " VIEW " : " TABLE "; end = options; switch (what_to_do) { case DO_CHECK: @@ -764,18 +885,28 @@ static int handle_request_for_tables(char *tables, uint length) if (opt_upgrade) end = strmov(end, " FOR UPGRADE"); break; case DO_REPAIR: - op= (opt_write_binlog) ? "REPAIR" : "REPAIR NO_WRITE_TO_BINLOG"; - if (opt_quick) end = strmov(end, " QUICK"); - if (opt_extended) end = strmov(end, " EXTENDED"); - if (opt_frm) end = strmov(end, " USE_FRM"); + op= opt_write_binlog ? "REPAIR" : "REPAIR NO_WRITE_TO_BINLOG"; + if (view) + { + if (opt_do_views == DO_VIEWS_FROM_MYSQL) end = strmov(end, " FROM MYSQL"); + } + else + { + if (opt_quick) end = strmov(end, " QUICK"); + if (opt_extended) end = strmov(end, " EXTENDED"); + if (opt_frm) end = strmov(end, " USE_FRM"); + } break; case DO_ANALYZE: + DBUG_ASSERT(!view); op= (opt_write_binlog) ? "ANALYZE" : "ANALYZE NO_WRITE_TO_BINLOG"; break; case DO_OPTIMIZE: + DBUG_ASSERT(!view); op= (opt_write_binlog) ? "OPTIMIZE" : "OPTIMIZE NO_WRITE_TO_BINLOG"; break; - case DO_UPGRADE: + case DO_FIX_NAMES: + DBUG_ASSERT(!view); DBUG_RETURN(fix_table_storage_name(tables)); } @@ -784,14 +915,15 @@ static int handle_request_for_tables(char *tables, uint length) if (opt_all_in_1) { /* No backticks here as we added them before */ - query_length= sprintf(query, "%s TABLE %s %s", op, tables, options); + query_length= sprintf(query, "%s%s%s %s", op, + tab_view, tables, options); table_name= tables; } else { char *ptr, *org; - org= ptr= strmov(strmov(query, op), " TABLE "); + org= ptr= strmov(strmov(query, op), tab_view); ptr= fix_table_name(ptr, tables); strmake(table_name_buff, org, MY_MIN((int) sizeof(table_name_buff)-1, (int) (ptr - org))); @@ -803,7 +935,7 @@ static int handle_request_for_tables(char *tables, uint length) puts(query); if (mysql_real_query(sock, query, query_length)) { - sprintf(message, "when executing '%s TABLE ... %s'", op, options); + sprintf(message, "when executing '%s%s... %s'", op, tab_view, options); DBerror(sock, message); my_free(query); DBUG_RETURN(1); @@ -1064,7 +1196,7 @@ int main(int argc, char **argv) for (i = 0; i < tables4repair.elements ; i++) { char *name= (char*) dynamic_array_ptr(&tables4repair, i); - handle_request_for_tables(name, fixed_name_length(name)); + handle_request_for_tables(name, fixed_name_length(name), FALSE); } for (i = 0; i < tables4rebuild.elements ; i++) rebuild_table((char*) dynamic_array_ptr(&tables4rebuild, i)); diff --git a/cmake/compile_flags.cmake b/cmake/compile_flags.cmake index 5e872f981b0..b39bf7b79d6 100644 --- a/cmake/compile_flags.cmake +++ b/cmake/compile_flags.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2015, 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 @@ -18,11 +18,11 @@ MACRO(ADD_COMPILE_FLAGS) SET(FILES "") SET(FLAGS "") - SET(COMPILE_FLAGS) + SET(COMPILE_FLAGS_SEEN) FOREACH(ARG ${ARGV}) IF(ARG STREQUAL "COMPILE_FLAGS") - SET(COMPILE_FLAGS "COMPILE_FLAGS") - ELSEIF(COMPILE_FLAGS) + SET(COMPILE_FLAGS_SEEN 1) + ELSEIF(COMPILE_FLAGS_SEEN) LIST(APPEND FLAGS ${ARG}) ELSE() LIST(APPEND FILES ${ARG}) diff --git a/include/myisamchk.h b/include/myisamchk.h index 7abbcea3302..64724de1789 100644 --- a/include/myisamchk.h +++ b/include/myisamchk.h @@ -34,6 +34,7 @@ #define TT_USEFRM 1 #define TT_FOR_UPGRADE 2 +#define TT_FROM_MYSQL 4 /* Bits set in out_flag */ #define O_NEW_DATA 2 diff --git a/mysql-test/include/ctype_utf8_ilseq.inc b/mysql-test/include/ctype_utf8_ilseq.inc new file mode 100644 index 00000000000..c400731c07f --- /dev/null +++ b/mysql-test/include/ctype_utf8_ilseq.inc @@ -0,0 +1,114 @@ +# +# Compare a field to an utf8 string literal with illegal byte sequences +# + +--echo # +--echo # Start of ctype_utf8_ilseq.inc +--echo # + +--eval CREATE TABLE t1 ENGINE=$ENGINE AS SELECT REPEAT(' ', 60) AS ch LIMIT 0; +ALTER TABLE t1 + ADD id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + ADD KEY(ch); +SHOW CREATE TABLE t1; + +INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); +SELECT ch FROM t1 WHERE ch='admin𝌆'; +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin𝌆'; +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin𝌆'; +DELETE FROM t1; +INSERT INTO t1 (ch) VALUES ('a'), ('a?'), ('a??'), ('a???'), ('a????'); +INSERT INTO t1 (ch) VALUES ('ab'),('a?b'),('a??b'),('a???b'),('a????b'); +INSERT INTO t1 (ch) VALUES ('az'),('a?z'),('a??z'),('a???z'),('a????z'); +INSERT INTO t1 (ch) VALUES ('z'); +# LATIN SMALL LETTER A + LATIN CAPITAL LETTER E WITH GRAVE +INSERT INTO t1 (ch) VALUES (_utf8 0x61D080); +# LATIN SMALL LETTER A + ARMENIAN SMALL LETTER REH +INSERT INTO t1 (ch) VALUES (_utf8 0x61D680); + +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; + +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; + +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; + +ALTER TABLE t1 DROP KEY ch; + +--echo # 0xD18F would be a good 2-byte character, 0xD1 is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,''''); +PREPARE stmt FROM @query; +EXECUTE stmt; +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,'b'''); +PREPARE stmt FROM @query; +EXECUTE stmt; + +# +# Non-equality comparison currently work differently depending on collation: +# +# - utf8_general_ci falls back to memcmp() on bad byte +# - utf8_unicode_ci treats bad bytes greater than any valid character +# +# For example, these two characters: +# _utf8 0xD080 (U+00C8 LATIN CAPITAL LETTER E WITH GRAVE) +# _utf8 0xD680 (U+0580 ARMENIAN SMALL LETTER REH) +# +# will give different results (depending on collation) when compared +# to an incomplete byte sequence 0xD1 (mb2head not followed by mb2tail). +# +# For utf8_general_ci the result depends on the valid side: +# - 0xD080 is smaller than 0xD1, because 0xD0 < 0xD1 +# - 0xD680 is greater than 0xD1, because 0xD6 > 0xD1 +# +# For utf8_unicode_ci the result does not depend on the valid side: +# - 0xD080 is smaller than 0xD1, because 0xD1 is greater than any valid character +# - 0xD680 is smaller than 0xD1, because 0xD1 is greater than any valid character +# +# utf8_general_ci should be eventually fixed to treat bad bytes greater +# than any valid character, similar to utf8_unicode_ci. +# + +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch<''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch>''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; + +--echo # 0xEA9A96 would be a good 3-byte character, 0xEA9A is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; + +--echo # 0x8F is a bad byte sequence (an mb2tail without mb2head) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; + +--echo # 0x8F8F is a bad byte sequence (an mb2tail without mb2head, two times) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; + +DROP TABLE t1; + +--echo # +--echo # End of ctype_utf8_ilseq.inc +--echo # diff --git a/mysql-test/lib/generate-ssl-certs.sh b/mysql-test/lib/generate-ssl-certs.sh index 0ca9bcd41b8..5dca21a755d 100755 --- a/mysql-test/lib/generate-ssl-certs.sh +++ b/mysql-test/lib/generate-ssl-certs.sh @@ -10,22 +10,21 @@ touch demoCA/index.txt echo 01 > demoCA/serial # CA certificate, self-signed -openssl req -x509 -newkey rsa:2048 -keyout demoCA/private/cakey.pem -out cacert.pem -days 7300 -nodes -subj '/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB' -text +openssl req -x509 -newkey rsa:2048 -keyout demoCA/private/cakey.pem -out cacert.pem -days 7300 -nodes -subj '/CN=cacert/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB' -text -# server certificate signing request and private key -openssl req -newkey rsa:1024 -keyout server-key.pem -out demoCA/server-req.pem -days 7300 -nodes -subj '/C=SE/ST=Uppsala/O=MySQL AB/CN=localhost' +# server certificate signing request and private key. Note the very long subject (for MDEV-7859) +openssl req -newkey rsa:1024 -keyout server-key.pem -out demoCA/server-req.pem -days 7300 -nodes -subj '/CN=localhost/C=FI/ST=state or province within country, in other certificates in this file it is the same as L/L=location, usually an address but often ambiguously used/OU=organizational unit name, a division name within an organization/O=organization name, typically a company name' # convert the key to yassl compatible format openssl rsa -in server-key.pem -out server-key.pem # sign the server certificate with CA certificate openssl ca -days 7300 -batch -cert cacert.pem -policy policy_anything -out server-cert.pem -infiles demoCA/server-req.pem -openssl req -newkey rsa:8192 -keyout server8k-key.pem -out demoCA/server8k-req.pem -days 7300 -nodes -subj '/C=SE/ST=Uppsala/O=MySQL AB/CN=server' +openssl req -newkey rsa:8192 -keyout server8k-key.pem -out demoCA/server8k-req.pem -days 7300 -nodes -subj '/CN=server8k/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB' openssl rsa -in server8k-key.pem -out server8k-key.pem openssl ca -days 7300 -batch -cert cacert.pem -policy policy_anything -out server8k-cert.pem -infiles demoCA/server8k-req.pem -openssl req -newkey rsa:1024 -keyout client-key.pem -out demoCA/client-req.pem -days 7300 -nodes -subj '/C=SE/ST=Uppsala/O=MySQL AB' +openssl req -newkey rsa:1024 -keyout client-key.pem -out demoCA/client-req.pem -days 7300 -nodes -subj '/CN=client/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB' openssl rsa -in client-key.pem -out client-key.pem -# if the folloing will require a common name - that's defined in /etc/ssl/openssl.cnf, under policy_anything openssl ca -days 7300 -batch -cert cacert.pem -policy policy_anything -out client-cert.pem -infiles demoCA/client-req.pem rm -rf demoCA diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 03c3ac90c1f..befd47d9c94 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1036,15 +1036,7 @@ sub ignore_option { # Setup any paths that are $opt_vardir related sub set_vardir { - my ($vardir)= @_; - if(IS_WINDOWS) - { - $opt_vardir= $vardir; - } - else - { - $opt_vardir= realpath($vardir); - } + ($opt_vardir)= @_; $path_vardir_trace= $opt_vardir; # Chop off any "c:", DBUG likes a unix path ex: c:/src/... => /src/... @@ -1478,7 +1470,7 @@ sub command_line_setup { # Search through list of locations that are known # to be "fast disks" to find a suitable location # Use --mem=<dir> as first location to look. - my @tmpfs_locations= ($opt_mem, "/dev/shm", "/tmp"); + my @tmpfs_locations= ($opt_mem,"/run/shm", "/dev/shm", "/tmp"); foreach my $fs (@tmpfs_locations) { @@ -1494,20 +1486,11 @@ sub command_line_setup { # -------------------------------------------------------------------------- # Set the "var/" directory, the base for everything else # -------------------------------------------------------------------------- - if(defined $ENV{MTR_BINDIR}) - { - $default_vardir= "$ENV{MTR_BINDIR}/mysql-test/var"; - } - else - { - $default_vardir= "$glob_mysql_test_dir/var"; - } - unless (IS_WINDOWS) { - my $realpath = realpath($default_vardir); - die "realpath('$default_vardir') failed: $!\n" - unless defined($realpath) && $realpath ne ''; - $default_vardir = $realpath; - } + my $vardir_location= (defined $ENV{MTR_BINDIR} + ? "$ENV{MTR_BINDIR}/mysql-test" + : $glob_mysql_test_dir); + $vardir_location= realpath $vardir_location unless IS_WINDOWS; + $default_vardir= "$vardir_location/var"; if ( ! $opt_vardir ) { @@ -6448,7 +6431,7 @@ Options to control directories to use mem Run testsuite in "memory" using tmpfs or ramdisk Attempts to find a suitable location using a builtin list of standard locations - for tmpfs (/dev/shm) + for tmpfs (/run/shm, /dev/shm, /tmp) The option can also be set using environment variable MTR_MEM=[DIR] clean-vardir Clean vardir if tests were successful and if diff --git a/mysql-test/r/blackhole.result b/mysql-test/r/blackhole.result index 16a97927262..36f5459ff85 100644 --- a/mysql-test/r/blackhole.result +++ b/mysql-test/r/blackhole.result @@ -8,6 +8,13 @@ CREATE TABLE t2 (a INT UNSIGNED, b INT, UNIQUE KEY (a, b)) ENGINE=BLACKHOLE; SELECT 1 FROM t1 WHERE a = ANY (SELECT a FROM t2); 1 DROP TABLE t1, t2; +create temporary table t1 (a int) engine=blackhole; +lock table t1 write; +truncate table t1; +select * from t1; +a +unlock tables; +drop temporary table t1; End of 5.5 tests # # Bug#13948247 DIVISION BY 0 IN GET_BEST_DISJUNCT_QUICK WITH FORCE INDEX GROUP BY diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 16b60aed07f..02809f3be22 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -6466,6 +6466,418 @@ a c1 10 => DŽ drop table t1; # +# MDEV-7649 wrong result when comparing utf8 column with an invalid literal +# +SET NAMES utf8 COLLATE utf8_unicode_ci; +# +# Start of ctype_utf8_ilseq.inc +# +CREATE TABLE t1 ENGINE=MyISAM AS SELECT REPEAT(' ', 60) AS ch LIMIT 0;; +ALTER TABLE t1 +ADD id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +ADD KEY(ch); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ch` varchar(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), + KEY `ch` (`ch`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); +SELECT ch FROM t1 WHERE ch='admin𝌆'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin𝌆'; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin𝌆'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +DELETE FROM t1; +INSERT INTO t1 (ch) VALUES ('a'), ('a?'), ('a??'), ('a???'), ('a????'); +INSERT INTO t1 (ch) VALUES ('ab'),('a?b'),('a??b'),('a???b'),('a????b'); +INSERT INTO t1 (ch) VALUES ('az'),('a?z'),('a??z'),('a???z'),('a????z'); +INSERT INTO t1 (ch) VALUES ('z'); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D080); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D680); +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; +ch +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; +ch +z +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; +ch +z +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; +ch +z +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; +ch +z +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +ALTER TABLE t1 DROP KEY ch; +# 0xD18F would be a good 2-byte character, 0xD1 is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,''''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,'b'''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch<''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch>''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +z +# 0xEA9A96 would be a good 3-byte character, 0xEA9A is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F is a bad byte sequence (an mb2tail without mb2head) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F8F is a bad byte sequence (an mb2tail without mb2head, two times) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +DROP TABLE t1; +# +# End of ctype_utf8_ilseq.inc +# +# +# Start of ctype_utf8_ilseq.inc +# +CREATE TABLE t1 ENGINE=HEAP AS SELECT REPEAT(' ', 60) AS ch LIMIT 0;; +ALTER TABLE t1 +ADD id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +ADD KEY(ch); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ch` varchar(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), + KEY `ch` (`ch`) +) ENGINE=MEMORY DEFAULT CHARSET=latin1 +INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); +SELECT ch FROM t1 WHERE ch='admin𝌆'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin𝌆'; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin𝌆'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +DELETE FROM t1; +INSERT INTO t1 (ch) VALUES ('a'), ('a?'), ('a??'), ('a???'), ('a????'); +INSERT INTO t1 (ch) VALUES ('ab'),('a?b'),('a??b'),('a???b'),('a????b'); +INSERT INTO t1 (ch) VALUES ('az'),('a?z'),('a??z'),('a???z'),('a????z'); +INSERT INTO t1 (ch) VALUES ('z'); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D080); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D680); +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; +ch +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; +ch +z +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; +ch +z +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; +ch +z +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; +ch +z +ALTER TABLE t1 DROP KEY ch; +# 0xD18F would be a good 2-byte character, 0xD1 is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,''''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,'b'''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch<''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch>''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +z +# 0xEA9A96 would be a good 3-byte character, 0xEA9A is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F is a bad byte sequence (an mb2tail without mb2head) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F8F is a bad byte sequence (an mb2tail without mb2head, two times) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +DROP TABLE t1; +# +# End of ctype_utf8_ilseq.inc +# +# # End of 5.5 tests # # diff --git a/mysql-test/r/ctype_uca_innodb.result b/mysql-test/r/ctype_uca_innodb.result new file mode 100644 index 00000000000..a4e1ae09130 --- /dev/null +++ b/mysql-test/r/ctype_uca_innodb.result @@ -0,0 +1,218 @@ +# +# Start of 5.5 tests +# +# +# MDEV-7649 wrong result when comparing utf8 column with an invalid literal +# +SET NAMES utf8 COLLATE utf8_unicode_ci; +# +# Start of ctype_utf8_ilseq.inc +# +CREATE TABLE t1 ENGINE=InnoDB AS SELECT REPEAT(' ', 60) AS ch LIMIT 0;; +ALTER TABLE t1 +ADD id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +ADD KEY(ch); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ch` varchar(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), + KEY `ch` (`ch`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); +SELECT ch FROM t1 WHERE ch='admin𝌆'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin𝌆'; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin𝌆'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +DELETE FROM t1; +INSERT INTO t1 (ch) VALUES ('a'), ('a?'), ('a??'), ('a???'), ('a????'); +INSERT INTO t1 (ch) VALUES ('ab'),('a?b'),('a??b'),('a???b'),('a????b'); +INSERT INTO t1 (ch) VALUES ('az'),('a?z'),('a??z'),('a???z'),('a????z'); +INSERT INTO t1 (ch) VALUES ('z'); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D080); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D680); +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; +ch +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; +ch +z +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; +ch +z +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; +ch +z +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; +ch +z +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +ALTER TABLE t1 DROP KEY ch; +# 0xD18F would be a good 2-byte character, 0xD1 is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,''''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,'b'''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch<''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch>''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +z +# 0xEA9A96 would be a good 3-byte character, 0xEA9A is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F is a bad byte sequence (an mb2tail without mb2head) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F8F is a bad byte sequence (an mb2tail without mb2head, two times) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +DROP TABLE t1; +# +# End of ctype_utf8_ilseq.inc +# +# +# End of 5.5 tests +# diff --git a/mysql-test/r/ctype_upgrade.result b/mysql-test/r/ctype_upgrade.result index 56e2ef96ead..6bef89f6cd6 100644 --- a/mysql-test/r/ctype_upgrade.result +++ b/mysql-test/r/ctype_upgrade.result @@ -227,7 +227,7 @@ DROP TABLE mysql050614_xxx_croatian_ci; # Checking mysql_upgrade # # Running mysql_upgrade -Phase 1/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -258,9 +258,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +Phase 2/6: Fixing views +Phase 3/6: Running 'mysql_fix_privilege_tables' +Phase 4/6: Fixing table and database names +Phase 5/6: Checking and upgrading tables Processing databases information_schema mtr @@ -279,11 +280,11 @@ test.maria050313_ucs2_croatian_ci_def OK test.maria050313_utf8_croatian_ci OK test.maria050533_xxx_croatian_ci OK test.maria100004_xxx_croatian_ci OK -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK # Running mysql_upgrade for the second time # This should report OK for all tables -Phase 1/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -314,9 +315,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +Phase 2/6: Fixing views +Phase 3/6: Running 'mysql_fix_privilege_tables' +Phase 4/6: Fixing table and database names +Phase 5/6: Checking and upgrading tables Processing databases information_schema mtr @@ -329,7 +331,7 @@ test.maria050313_utf8_croatian_ci OK test.maria050533_xxx_croatian_ci OK test.maria100004_xxx_croatian_ci OK test.mysql050614_xxx_croatian_ci OK -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK SHOW CREATE TABLE maria050313_ucs2_croatian_ci_def; Table Create Table diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 40854183a92..ef957c54f45 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -5412,6 +5412,634 @@ a 1024 Warnings: Warning 1260 Row 2 was cut by GROUP_CONCAT() # +# MDEV-7814 Assertion `args[0]->fixed' fails in Item_func_conv_charset::Item_func_conv_charset +# +CREATE TABLE t1(a CHAR(1) CHARACTER SET latin1, b INT NOT NULL); +CREATE TABLE t2(a CHAR(1) CHARACTER SET utf8 COLLATE utf8_general_ci, b INT NOT NULL); +SELECT (SELECT t2.a FROM t2 WHERE t2.a=t1.a) AS aa, b, COUNT(b) FROM t1 GROUP BY aa; +aa b COUNT(b) +DROP TABLE t1,t2; +# +# MDEV-7649 wrong result when comparing utf8 column with an invalid literal +# +SET NAMES utf8 COLLATE utf8_general_ci; +# +# Start of ctype_utf8_ilseq.inc +# +CREATE TABLE t1 ENGINE=InnoDB AS SELECT REPEAT(' ', 60) AS ch LIMIT 0;; +ALTER TABLE t1 +ADD id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +ADD KEY(ch); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ch` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '', + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), + KEY `ch` (`ch`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); +SELECT ch FROM t1 WHERE ch='admin𝌆'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin𝌆'; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin𝌆'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +DELETE FROM t1; +INSERT INTO t1 (ch) VALUES ('a'), ('a?'), ('a??'), ('a???'), ('a????'); +INSERT INTO t1 (ch) VALUES ('ab'),('a?b'),('a??b'),('a???b'),('a????b'); +INSERT INTO t1 (ch) VALUES ('az'),('a?z'),('a??z'),('a???z'),('a????z'); +INSERT INTO t1 (ch) VALUES ('z'); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D080); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D680); +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; +ch +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; +ch +z +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; +ch +z +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; +ch +z +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; +ch +z +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +ALTER TABLE t1 DROP KEY ch; +# 0xD18F would be a good 2-byte character, 0xD1 is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,''''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,'b'''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch<''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch>''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +aր +z +# 0xEA9A96 would be a good 3-byte character, 0xEA9A is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F is a bad byte sequence (an mb2tail without mb2head) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F8F is a bad byte sequence (an mb2tail without mb2head, two times) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +DROP TABLE t1; +# +# End of ctype_utf8_ilseq.inc +# +# +# Start of ctype_utf8_ilseq.inc +# +CREATE TABLE t1 ENGINE=MyISAM AS SELECT REPEAT(' ', 60) AS ch LIMIT 0;; +ALTER TABLE t1 +ADD id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +ADD KEY(ch); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ch` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '', + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), + KEY `ch` (`ch`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); +SELECT ch FROM t1 WHERE ch='admin𝌆'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin𝌆'; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin𝌆'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +DELETE FROM t1; +INSERT INTO t1 (ch) VALUES ('a'), ('a?'), ('a??'), ('a???'), ('a????'); +INSERT INTO t1 (ch) VALUES ('ab'),('a?b'),('a??b'),('a???b'),('a????b'); +INSERT INTO t1 (ch) VALUES ('az'),('a?z'),('a??z'),('a???z'),('a????z'); +INSERT INTO t1 (ch) VALUES ('z'); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D080); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D680); +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; +ch +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; +ch +z +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; +ch +z +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; +ch +z +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; +ch +z +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +ALTER TABLE t1 DROP KEY ch; +# 0xD18F would be a good 2-byte character, 0xD1 is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,''''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,'b'''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch<''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch>''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +aր +z +# 0xEA9A96 would be a good 3-byte character, 0xEA9A is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F is a bad byte sequence (an mb2tail without mb2head) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F8F is a bad byte sequence (an mb2tail without mb2head, two times) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +DROP TABLE t1; +# +# End of ctype_utf8_ilseq.inc +# +# +# Start of ctype_utf8_ilseq.inc +# +CREATE TABLE t1 ENGINE=HEAP AS SELECT REPEAT(' ', 60) AS ch LIMIT 0;; +ALTER TABLE t1 +ADD id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +ADD KEY(ch); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ch` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '', + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), + KEY `ch` (`ch`) +) ENGINE=MEMORY DEFAULT CHARSET=latin1 +INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); +SELECT ch FROM t1 WHERE ch='admin𝌆'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin𝌆'; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin𝌆'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +DELETE FROM t1; +INSERT INTO t1 (ch) VALUES ('a'), ('a?'), ('a??'), ('a???'), ('a????'); +INSERT INTO t1 (ch) VALUES ('ab'),('a?b'),('a??b'),('a???b'),('a????b'); +INSERT INTO t1 (ch) VALUES ('az'),('a?z'),('a??z'),('a???z'),('a????z'); +INSERT INTO t1 (ch) VALUES ('z'); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D080); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D680); +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; +ch +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aր +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; +ch +z +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; +ch +z +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; +ch +z +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; +ch +z +ALTER TABLE t1 DROP KEY ch; +# 0xD18F would be a good 2-byte character, 0xD1 is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,''''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,'b'''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch<''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch>''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +aր +z +# 0xEA9A96 would be a good 3-byte character, 0xEA9A is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F is a bad byte sequence (an mb2tail without mb2head) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F8F is a bad byte sequence (an mb2tail without mb2head, two times) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +DROP TABLE t1; +# +# End of ctype_utf8_ilseq.inc +# +# # End of 5.5 tests # # diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index d0f42c3d3ec..7c44466ae92 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -568,3 +568,15 @@ update t1 set balance=(select sum(balance) from (SELECT balance FROM t1 where ac set optimizer_switch=@save_derived_optimizer_switch_bug; drop table t1; set optimizer_switch=@save_derived_optimizer_switch; +# +# MDEV-6892: WHERE does not apply +# +create table t1 (id int); +create table t2 (id int); +insert into t1 values(1),(2),(3); +insert into t2 values(4),(5),(6); +select x.id, message from (select id from t1) x left join +(select id, 1 as message from t2) y on x.id=y.id +where coalesce(message,0) <> 0; +id message +drop table t1,t2; diff --git a/mysql-test/r/filesort_bad_i_s-7585.result b/mysql-test/r/filesort_bad_i_s-7585.result new file mode 100644 index 00000000000..edb1574288f --- /dev/null +++ b/mysql-test/r/filesort_bad_i_s-7585.result @@ -0,0 +1,9 @@ +SET sql_mode=STRICT_TRANS_TABLES; +CREATE TABLE t0 (i INT) ENGINE=MyISAM; +CREATE VIEW v1 AS SELECT * FROM t0; +CREATE VIEW v2 AS SELECT * FROM v1; +DROP VIEW IF EXISTS v1; +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 SELECT TABLE_ROWS FROM information_schema.tables ORDER BY TABLE_ROWS; +DROP VIEW v2; +DROP TABLE t1, t0; diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index b60deae1c80..f12a0c1127a 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -1091,3 +1091,15 @@ insert into t1 values ('a'),('b'); select 1 from t1 where a in (select group_concat(a) from t1); 1 drop table t1; +CREATE TABLE t1 (f1 VARCHAR(10)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('a'),('b'); +CREATE TABLE t2 (f2 VARCHAR(10)) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('c'); +CREATE TABLE t3 (f3 VARCHAR(10)) ENGINE=MyISAM; +INSERT INTO t3 VALUES ('d'),('e'); +SELECT GROUP_CONCAT( f2 ORDER BY ( f2 IN ( SELECT f1 FROM t1 WHERE f1 <= f2 ) ) ) AS field +FROM ( SELECT * FROM t2 ) AS sq2, t3 +ORDER BY field; +field +c,c +drop table t3, t2, t1; diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index f00ea0e041b..174088bf944 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -1,4 +1,5 @@ DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +DROP VIEW IF EXISTS v1; CREATE TABLE gis_point (fid INTEGER NOT NULL PRIMARY KEY, g POINT); CREATE TABLE gis_line (fid INTEGER NOT NULL PRIMARY KEY, g LINESTRING); CREATE TABLE gis_polygon (fid INTEGER NOT NULL PRIMARY KEY, g POLYGON); @@ -489,7 +490,7 @@ explain extended select issimple(MultiPoint(Point(3, 6), Point(4, 10))), issimpl id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select st_issimple(st_multipoint(st_point(3,6),st_point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,st_issimple(st_point(3,6)) AS `issimple(Point(3, 6))` +Note 1003 select st_issimple(st_multipoint(point(3,6),point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,st_issimple(point(3,6)) AS `issimple(Point(3, 6))` create table t1 (a geometry not null); insert into t1 values (GeomFromText('Point(1 2)')); insert into t1 values ('Garbage'); @@ -1621,4 +1622,11 @@ drop table t1; SELECT st_astext(ST_Buffer(ST_PolygonFromText('POLYGON((3 5, 2 4, 2 5, 3 5))'), -100)); st_astext(ST_Buffer(ST_PolygonFromText('POLYGON((3 5, 2 4, 2 5, 3 5))'), -100)) GEOMETRYCOLLECTION EMPTY -End of 5.5 tests +CREATE VIEW v1 AS SELECT POINT(1,1) AS p; +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select point(1,1) AS `p` latin1 latin1_swedish_ci +SELECT ASTEXT(p) FROM v1; +ASTEXT(p) +POINT(1 1) +DROP VIEW v1; diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 9a259b3c4c6..9f5eb053cb7 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -2339,6 +2339,16 @@ MIN(a) b 0 a DROP TABLE t1; +create table t1 (a int, b int); +insert into t1 values (1,11), (1,12), (2,22),(2,23), (4,44),(4,45); +create table t2 (c int, d int); +insert into t2 values (1,11), (1,12), (2,22),(2,23), (4,44),(4,45); +select distinct a,sum(b), (select d from t2 where c=a order by max(b) limit 1) from t1 group by a order by max(b); +a sum(b) (select d from t2 where c=a order by max(b) limit 1) +1 23 11 +2 45 22 +4 89 44 +drop table t1, t2; # # LP bug#993726 Wrong result from a query with ALL subquery predicate in WHERE # diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result index 99cc5d484bd..eda67460205 100644 --- a/mysql-test/r/having.result +++ b/mysql-test/r/having.result @@ -667,6 +667,37 @@ pk f DROP TABLE t1; End of 5.3 tests # +# Bug MDEV-7301: Unknown column quoted with backticks in HAVING clause when using function. +# Bug#16221433 MYSQL REJECTS QUERY DUE TO BAD RESOLUTION OF NAMES IN HAVING; VIEW UNREADABLE +# +CREATE TABLE `t1` ( +`id` int(11) NOT NULL, +`title` varchar(45) DEFAULT NULL, +PRIMARY KEY (`id`) +) DEFAULT CHARSET=utf8; +INSERT INTO `t1` VALUES ('1', 'Just for fun'); +INSERT INTO `t1` VALUES ('2', 'Wait until a sunhine'); +INSERT INTO `t1` VALUES ('3', 'Take a new turn'); +SELECT `id`, SHA1(`title`) AS `column_1` +FROM `t1` +HAVING `column_1` LIKE '8%'; +id column_1 +1 80a12660d24a72460e5e292fe33f870276d7f40a +expected 1 row(s) returned +SELECT `id`, SHA1(`title`) AS `column_1` +FROM `t1` +HAVING UPPER(column_1) LIKE '8%'; +id column_1 +1 80a12660d24a72460e5e292fe33f870276d7f40a +expected -- 1 row(s) returned +SELECT `id`, SHA1(`title`) AS `column_1` +FROM `t1` +HAVING UPPER(`column_1`) LIKE '8%'; +id column_1 +1 80a12660d24a72460e5e292fe33f870276d7f40a +expected -- 1 row(s) returned not ER_BAD_FIELD_ERROR +drop table t1; +# # Bug mdev-5160: two-way join with HAVING over the second table # CREATE TABLE t1 (c1 varchar(6)) ENGINE=MyISAM; diff --git a/mysql-test/r/log_errchk.result b/mysql-test/r/log_errchk.result index 407fba2323e..e1968e29662 100644 --- a/mysql-test/r/log_errchk.result +++ b/mysql-test/r/log_errchk.result @@ -1,5 +1,4 @@ -call mtr.add_suppression("Could not use"); -# Case 1: Setting fife file to general_log_file and slow_query_log_file +# Case 1: Setting fifo file to general_log_file and slow_query_log_file # system variable. SET GLOBAL general_log_file="MYSQLTEST_VARDIR/tmp/general_log.fifo";; ERROR 42000: Variable 'general_log_file' can't be set to the value of 'MYSQLTEST_VARDIR/tmp/general_log.fifo' @@ -7,4 +6,6 @@ SET GLOBAL slow_query_log_file="MYSQLTEST_VARDIR/tmp/slow_log.fifo";; ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of 'MYSQLTEST_VARDIR/tmp/slow_log.fifo' # Case 2: Starting server with fifo file as general log file # and slow query log file. +call mtr.add_suppression("Could not use .* for logging \\(error 6\\)"); +call mtr.add_suppression("File '.*' not found \\(Errcode: 6 "); Setting fifo file as general log file and slow query log failed. diff --git a/mysql-test/r/log_tables_upgrade.result b/mysql-test/r/log_tables_upgrade.result index a609b222d53..6cbb25bd1d4 100644 --- a/mysql-test/r/log_tables_upgrade.result +++ b/mysql-test/r/log_tables_upgrade.result @@ -11,7 +11,7 @@ Table Op Msg_type Msg_text test.bug49823 repair status OK RENAME TABLE general_log TO renamed_general_log; RENAME TABLE test.bug49823 TO general_log; -Phase 1/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -43,9 +43,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +Phase 2/6: Fixing views +Phase 3/6: Running 'mysql_fix_privilege_tables' +Phase 4/6: Fixing table and database names +Phase 5/6: Checking and upgrading tables Processing databases information_schema mtr @@ -53,7 +54,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK DROP TABLE general_log; RENAME TABLE renamed_general_log TO general_log; diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index f701e7fa085..688184f2f83 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -823,6 +823,200 @@ create view v3 as select t2.id, t3.b from t2 join t3 using(id); update t1 join v3 using (id) set t1.a=0; drop view v1, v2, v3; drop table t2, t3, t1; +# +# MDEV-7613: MariaDB 5.5.40 server crash on update table left join +# with a view +# +CREATE TABLE `t1` ( +`f1` varchar(6) COLLATE latin1_general_ci DEFAULT NULL, +`f2` varchar(6) COLLATE latin1_general_ci DEFAULT NULL, +`f3` varchar(7) COLLATE latin1_general_ci DEFAULT NULL, +`f4` varchar(15) COLLATE latin1_general_ci DEFAULT NULL, +`f5` datetime DEFAULT NULL, +`f6` varchar(2) COLLATE latin1_general_ci DEFAULT NULL, +`f7` varchar(2) COLLATE latin1_general_ci DEFAULT NULL, +`ff1` int(1) DEFAULT NULL, +`ff2` int(1) DEFAULT NULL, +`ff3` int(1) DEFAULT NULL, +`ff4` int(1) DEFAULT NULL, +`ff5` int(1) DEFAULT NULL, +`ff6` int(1) DEFAULT NULL, +`ff7` int(1) DEFAULT NULL, +`ff8` int(2) DEFAULT NULL, +`ff9` int(1) DEFAULT NULL, +`ff10` int(1) DEFAULT NULL, +`ff11` int(1) DEFAULT NULL, +`ff12` int(1) DEFAULT NULL, +`ff13` int(1) DEFAULT NULL, +`ff14` int(1) DEFAULT NULL, +`ff15` int(1) DEFAULT NULL, +`f8` varchar(70) COLLATE latin1_general_ci DEFAULT NULL, +`f9` varchar(20) COLLATE latin1_general_ci DEFAULT NULL, +`f10` varchar(50) COLLATE latin1_general_ci NOT NULL, +`f11` varchar(50) COLLATE latin1_general_ci DEFAULT NULL, +`f12` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, +`f13` text COLLATE latin1_general_ci, +`f14` time DEFAULT NULL, +`f15` varchar(30) COLLATE latin1_general_ci DEFAULT NULL, +`fg1` int(11) DEFAULT NULL, +`fg2` int(11) DEFAULT NULL, +`fg3` int(11) DEFAULT NULL, +`fg4` int(11) DEFAULT NULL, +`fg5` int(11) DEFAULT NULL, +`fg6` int(11) DEFAULT NULL, +`fg7` int(11) DEFAULT NULL, +`fg9` int(11) DEFAULT NULL, +`fg10` int(11) DEFAULT NULL, +`fg11` int(11) DEFAULT NULL, +`fg12` int(11) DEFAULT NULL, +`fg13` int(11) DEFAULT NULL, +`fg14` int(11) DEFAULT NULL, +`fg15` int(11) DEFAULT NULL, +`f16` double DEFAULT NULL, +`f17` double DEFAULT NULL, +`f18` int(11) DEFAULT NULL, +`f19` int(11) DEFAULT NULL, +`f20` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, +`f21` int(11) DEFAULT NULL, +`f22` int(11) DEFAULT NULL, +`f23` int(11) DEFAULT NULL, +`f24` double DEFAULT NULL, +`f25` int(11) DEFAULT NULL, +`f26` double DEFAULT NULL, +`f27` int(11) DEFAULT NULL, +`f28` int(11) DEFAULT NULL, +`f29` double DEFAULT NULL, +`f30` int(11) DEFAULT NULL, +`f31` double DEFAULT NULL, +`PZ` double DEFAULT NULL, +`f32` varchar(50) COLLATE latin1_general_ci DEFAULT NULL, +`f33` varchar(50) COLLATE latin1_general_ci DEFAULT NULL, +`f34` varchar(50) COLLATE latin1_general_ci DEFAULT NULL, +`f35` varchar(30) COLLATE latin1_general_ci DEFAULT NULL, +`f36` varchar(20) COLLATE latin1_general_ci DEFAULT NULL, +`f37` varchar(50) COLLATE latin1_general_ci DEFAULT NULL, +`f20_2` varchar(20) COLLATE latin1_general_ci DEFAULT NULL, +`f38` varchar(30) COLLATE latin1_general_ci DEFAULT NULL COMMENT 'Email = E-Mail / Whitemail = Brief', +`insert_ts` timestamp NULL DEFAULT CURRENT_TIMESTAMP, +PRIMARY KEY (`f10`), +KEY `f5_f12` (`f5`,`f12`), +KEY `f5_f20` (`f5`,`f20`), +KEY `f5_f33` (`f5`,`f33`) +) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci ROW_FORMAT=COMPACT; +INSERT INTO `t1` VALUES ('2011/2','201105','2011/19','gstfbnfr','2011-05-06 +00:00:00','gg','Ag',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,'','','','','','','21:56:28','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL,NULL,0,0,'Dffgult',1,0,0,NULL,0,NULL,0,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'ggggil',NULL),('2008/4','200812','2008/50','hgckbgfx','2008-12-08 +00:00:00','gg','Ag',2,NULL,2,1,1,1,1,24,1,NULL,1,1,1,2,0,'gusschlifßlich +zugg +gflffonifrfn','88.77.79.214','10001614','fg-gtgggggdgtfn','fg-gtgggggdgtfn','birgit.tfrpfllf@gggx.df','11:55:21',NULL,1,0,1,1,1,1,1,1,0,1,1,1,0,0,NULL,NULL,0,4,'ffrtrgg',1,6,10,1.66666666666667,4,1,10,14,1.4,1,NULL,NULL,'out',NULL,NULL,'49','ggobilcogg','k.A.',NULL,'ggggil',NULL),('2008/4','200812','2008/51','hgckbgfx','2008-12-15 +00:00:00','gg','Ag',4,5,5,4,5,5,5,NULL,4,5,1,1,1,4,0,'gusschlifßlich zugg +gflffonifrfn','79.197.185.64','10001686','fg-gtgggggdgtfn','fg-gtgggggdgtfn','kgtjg@swfftys.df','09:28:42',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,11,4.71428571428571,16,1.2,12,49,4.08111111111111,1,NULL,NULL,'out',NULL,NULL,'49','ggobilcogg','k.A.',NULL,'ggggil',NULL),('2008/4','200812','2008/50','nufchti','2008-12-08 +00:00:00','gg','Ag',4,1,1,5,5,5,5,12,4,5,1,1,2,1,0,'gusschlifßlich zugg +gflffonifrfn','89.54.151.216','10001700','fg-gtgggggdgtfn','fg-gtgggggdgtfn','H_K2006@frffnft.df','16:41:45',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,10,4.28571428571429,11,2.6,12,41,1.58111111111111,1,NULL,NULL,'ffrtrgg +Bgckofficf 5','vb5','Nufchtfr, +Iris','49','ggobilcogg','grfurt','Intfrn','ggggil',NULL),('2008/4','200812','2008/50','junghdro','2008-12-11 +00:00:00','Do','Ag',2,2,5,5,4,4,2,72,2,5,2,2,1,1,0,'gusschlifßlich zugg +gflffonifrfn','84.61.20.216','10001849','fg-ggriff','fg-ggriff','schofnf-glftfr@grcor.df','20:18:05',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,24,1.42857142857141,12,2.4,12,16,1,1,NULL,NULL,'ffrtrgg +Bgckofficf 5','vb5','Junghfinrich, +Dorothfg','49','ggobilcogg','grfurt','Intfrn','ggggil',NULL),('2008/4','200812','2008/50','fbflktj','2008-12-08 +00:00:00','gg','Ag',4,2,2,5,1,1,1,24,NULL,NULL,NULL,NULL,NULL,0,0,'Kgggfrg +bzw. DigiCggg +Funktion','217.84.62.6','10001888','fg-Kündigungfn','fg-Kündigungfn','f.frofschkf@gggx.df','21:05:59',NULL,1,1,1,1,1,1,1,0,0,0,0,0,0,0,NULL,NULL,0,0,'ffrtrgg',1,7,16,2.28571428571429,0,NULL,7,16,2.28571428571429,0,NULL,NULL,'out',NULL,'gbfl, +Kgtjg','49','ggobilcogg','k.A.','gxtfrn','ggggil',NULL),('2008/4','200812','2008/50','gltggggri','2008-12-09 +00:00:00','Di','Ag',4,1,1,4,2,1,2,16,1,2,2,2,2,2,0,'gusschlifßlich zugg +gflffonifrfn','81.171.157.211','10001988','fg-gtgggggdgtfn','fg-gtgggggdgtfn','bistfr@nftcolognf.df','11:07:54',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,21,1,11,2.2,12,12,2.66666666666667,1,NULL,NULL,'out',NULL,NULL,'49','ggobilcogg','k.A.','gxtfrn','ggggil',NULL),('2008/4','200812','2008/50','ggufllfsg','2008-12-09 +00:00:00','Di','Ag',2,2,2,2,1,1,2,12,2,2,2,1,1,2,0,'ggobilfs +Intfrnft','62.154.142.186','10002097','fg-gtgggggdgtfn','fg-gtgggggdgtfn','norbfrtwfdlich@fgggil.df','09:42:11',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,12,1.71428571428571,8,1.6,12,20,1.66666666666667,1,NULL,NULL,'ffrtrgg +Bgckofficf 1','vb1','Mufllfr, +ggbinf','49','ggobilcogg','grfurt','Intfrn','ggggil',NULL),('2008/4','200812','2008/50','wggnfg','2008-12-09 +00:00:00','Di','Ag',5,5,5,5,5,5,5,12,5,5,5,5,5,5,0,'gls grsgtz für +Ffstnftz','85.180.141.246','10002127','fg-Kündigungfn','fg-Kündigungfn','rfinhgrt.gdolph@yghoo.df','17:44:11',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,15,5,25,5,12,60,5,1,NULL,NULL,'ffrtrgg +Bgckofficf 1','vb1','Wggnfr, +Annftt','49','ggobilcogg','grfurt','Intfrn','ggggil',NULL),('2008/4','200812','2008/50','schubrbf','2008-12-10 +00:00:00','Mi','Ag',1,2,NULL,2,1,2,1,24,NULL,NULL,NULL,NULL,NULL,0,0,'Kgggfrg +bzw. DigiCggg +Funktion','91.40.98.242','10002160','fg-gtgggggdgtfn','fg-gtgggggdgtfn','olgf.lifb@gggx.nft','18:18:25',NULL,1,1,0,1,1,1,1,0,0,0,0,0,0,0,NULL,NULL,0,0,'ffrtrgg',1,6,11,1.81111111111111,0,NULL,6,11,1.81111111111111,0,NULL,NULL,'out',NULL,NULL,'49','ggobilcogg','k.A.','gxtfrn','ggggil',NULL); +CREATE TABLE `t2` ( +`ft1` datetime DEFAULT NULL, +`ft2` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', +`ft3` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', +`ft4` varchar(255) COLLATE latin1_general_ci NOT NULL DEFAULT '', +`ft5` varchar(255) COLLATE latin1_general_ci NOT NULL DEFAULT '', +`ft6` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, +`ft6_2` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, +`ft7` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, +`ft8` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, +`ft9` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, +`ft10` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, +PRIMARY KEY (`ft4`,`ft5`) +) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; +INSERT INTO `t2` VALUES ('2013-03-13 00:00:00','2013-03-13 00:00:00','9999-12-31 00:00:00','#','extern FP f32 2','Default','Intern','DEFAULT',NULL,NULL,NULL),('2013-03-13 00:00:00','2013-03-13 00:00:00','9999-12-31 00:00:00','#','extern FP f32 3','Default','Intern','DEFAULT',NULL,NULL,NULL); +CREATE TABLE `t3` ( +`fe1` int(10) NOT NULL DEFAULT '0', +`fe2` char(50) COLLATE latin1_general_ci DEFAULT 'nn', +`f34` char(50) COLLATE latin1_general_ci DEFAULT NULL, +`fe3` double DEFAULT NULL, +`fe4` double DEFAULT NULL, +`fe5` char(4) COLLATE latin1_general_ci DEFAULT NULL, +`f32` char(50) COLLATE latin1_general_ci DEFAULT NULL, +`fe6` int(3) DEFAULT '0', +`fe7` char(1) COLLATE latin1_general_ci DEFAULT NULL, +`ft6` char(50) COLLATE latin1_general_ci DEFAULT NULL, +`f33` char(4) COLLATE latin1_general_ci DEFAULT NULL COMMENT 'virtuelle f33s', +`fe8` char(4) COLLATE latin1_general_ci DEFAULT NULL COMMENT 'aus dem ADS', +`f37` char(50) COLLATE latin1_general_ci DEFAULT NULL, +`fe9` char(50) COLLATE latin1_general_ci DEFAULT NULL, +`fe10` int(5) DEFAULT '0', +`fe11` int(10) DEFAULT '0', +`fe12` char(50) COLLATE latin1_general_ci DEFAULT NULL, +`fe13` double DEFAULT NULL, +`fe14` char(50) COLLATE latin1_general_ci DEFAULT NULL, +`fe15` date DEFAULT NULL, +`fe16` date DEFAULT NULL, +`fe17` int(10) DEFAULT '0', +`fe18` date NOT NULL DEFAULT '0000-00-00', +`ft3` date NOT NULL DEFAULT '0000-00-00', +PRIMARY KEY (`fe1`), +KEY `fe2` (`fe2`,`fe18`,`ft3`), +KEY `f33` (`f33`), +KEY `fe8` (`fe8`) +) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci ROW_FORMAT=COMPACT COMMENT='CustomerService und Outsourcer Userinformationen'; +INSERT INTO `t3` VALUES (1,'aabggn','gab, glgna',0,NULL,NULL,'gxtgrn D gnd g +gggsbgrg',0,NULL,'gxtgrn','dsa','dsa','gggsbgrg','0',91611,0,'0',0,'agsggschigdgn','2014-08-11','2014-09-05',0,'2011-01-01','2014-08-11'),(4,'aabigr','gab, +Iggr',0,NULL,NULL,'gxtgrn D gnd g +gggsbgrg',0,NULL,'gxtgrn','dsa','dsa','gggsbgrg','0',0,0,'0',0,'agsggschigdgn','2014-08-11','2014-09-05',0,'2012-10-01','2014-08-11'),(7,'abgcrist','gbg, +ghristggna',15182,1,'ja','ggshilfg gxtgrn 1',1,NULL,'gg +galgs','ag1','ag1','grfgrt','0',11941,0,'0',0,'agsggschigdgn','2014-01-11',NULL,11802051,'1900-01-01','2010-06-10'),(8,'abgcrist','gbg, +ghristggna',15182,1,'ja','Zgntralg gftgr galgs Bgtrgggng 1',1,NULL,'gg +galgs','sb1','sb1','grfgrt','0',11941,0,'0',0,'agsggschigdgn','2014-01-11',NULL,11802051,'2010-07-01','2012-08-11'),(9,'abgcrist','gbg, +ghristggna',15182,1,'ja','galgs Inbggnd 2',1,NULL,'gg +galgs','si2','si2','grfgrt','0',11941,0,'0',0,'agsggschigdgn','2014-01-11',NULL,11802051,'2012-09-01','2014-01-11'),(10,'abgcgr','gbg, +ggrnglgg',14962,1,NULL,'galgs Ogtbggnd 1',1,NULL,'gg +galgs','sg1','sg1','grfgrt','0',12401,0,'abgcrn',1,NULL,NULL,NULL,11800647,'1900-01-01','2010-11-10'),(11,'abgcgr','gbg, +ggrnglgg',14962,1,NULL,'galgs Ogtbggnd 1',1,NULL,'gg +galgs','sg1','sg1','grfgrt','0',12401,0,'abgcrn',1,NULL,NULL,NULL,11800647,'2010-12-01','2011-08-11'),(12,'abgcgr','gbg, +ggrnglgg',14962,1,NULL,'galgs Ogtbggnd 2',1,NULL,'gg +galgs','sg2','sg2','grfgrt','0',12401,0,'abgcrn',1,NULL,NULL,NULL,11800647,'2011-09-01','2012-01-11'),(13,'abgcgr','gbg, +ggrnglgg',14962,0.75,NULL,'galgs Ogtbggnd 2',1,NULL,'gg +galgs','sg2','sg2','grfgrt','0',12401,0,'abgcrn',1,NULL,NULL,'2011-09-11',11800647,'2012-02-01','2011-08-11'),(14,'rgghrsgr','gbg, +gigrid',14781,1,'ja','Fgrdgrgngsmanaggmgnt 1',1,NULL,'gg +Zahlgng','fm1','fm1','grfgrt','0',12141,0,'0',1,NULL,NULL,NULL,11010781,'1900-01-01','2012-08-11'); +CREATE ALGORITHM=MERGE +DEFINER=`root`@`localhost` SQL SECURITY DEFINER +VIEW `v1` AS select `t1a`.`ft1` AS `ft1`,`t1a`.`ft2` AS `ft2`,`t1a`.`ft3` AS `ft3`,`t1a`.`ft4` AS `ft4`,`t1a`.`ft5` AS `ft5`,`t1a`.`ft6` AS `ft6`,`t1a`.`ft6_2` AS `ft6_2`,`t1a`.`ft7` AS `ft7`,`t1a`.`ft8` AS `ft8`,`t1a`.`ft9` AS `ft9`,`t1a`.`ft10` AS `ft10` from `t2` `t1a` where (if((`t1a`.`ft10` = 'virtuell'),0,1) = 1); +CREATE ALGORITHM=UNDEFINED +DEFINER=`root`@`localhost` SQL SECURITY DEFINER +VIEW `v2` AS select distinct `t1b`.`fe2` AS `fe2`,min(`t1b`.`fe18`) AS `fe18`,max(`t1b`.`ft3`) AS `ft3` from `t3` `t1b` where ((`t1b`.`fe2` <> '') and (curdate() >= `t1b`.`fe18`)) group by `t1b`.`fe2`; +CREATE ALGORITHM=UNDEFINED +DEFINER=`root`@`localhost` SQL SECURITY DEFINER +VIEW `v3` AS select `t1c`.`fe2` AS `fe2`,`t1c`.`f34` AS `f34`,`t1c`.`f33` AS `f33`,`t1c`.`f32` AS `f32`,`t1c`.`f37` AS `f37`,`t1c`.`fe10` AS `fe10`,if((`tov`.`ft6` in ('klarmobil','callmobile')),`tov`.`ft9`,`tov`.`ft6`) AS `ft6_1`,`tov`.`ft6_2` AS `ft6_2`,`ua`.`fe18` AS `fe18`,`ua`.`ft3` AS `ft3` from ((`t3` `t1c` left join `v2` `ua` on((`t1c`.`fe2` = `ua`.`fe2`))) left join `v1` `tov` on((`t1c`.`fe8` = `tov`.`ft4`))) where (`t1c`.`ft3` = `ua`.`ft3`) group by `t1c`.`fe2`,`t1c`.`f34`,`t1c`.`f33`,`t1c`.`f32` order by `t1c`.`f34`; +UPDATE t1 t1 left join v3 t2 on t1.f4 = t2.fe2 SET t1.f20 = t2.ft6_1, t1.f32 = t2.f32, t1.f33 = t2.f33, t1.f37 = t2.f37 WHERE f5 >= '2015-02-01'; +#MDEV-8018: main.multi_update fails with --ps-protocol +prepare stmt1 from "UPDATE t1 t1 left join v3 t2 on t1.f4 = t2.fe2 SET t1.f20 = t2.ft6_1, t1.f32 = t2.f32, t1.f33 = t2.f33, t1.f37 = t2.f37 WHERE f5 >= '2015-02-01'"; +execute stmt1; +execute stmt1; +deallocate prepare stmt1; +drop view v3,v2,v1; +drop table t1,t2,t3; end of 5.5 tests # Bug mdev-5970 diff --git a/mysql-test/r/mysql_upgrade-6984.result b/mysql-test/r/mysql_upgrade-6984.result index 6ae995cd030..7890b66d494 100644 --- a/mysql-test/r/mysql_upgrade-6984.result +++ b/mysql-test/r/mysql_upgrade-6984.result @@ -1,5 +1,5 @@ update mysql.user set password=password("foo") where user='root'; -Phase 1/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -42,9 +42,10 @@ error : Corrupt mysql.innodb_table_stats Error : Unknown storage engine 'InnoDB' error : Corrupt -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +Phase 2/6: Fixing views +Phase 3/6: Running 'mysql_fix_privilege_tables' +Phase 4/6: Fixing table and database names +Phase 5/6: Checking and upgrading tables Processing databases information_schema mtr @@ -52,7 +53,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK update mysql.user set password='' where user='root'; flush privileges; diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result index 64c2c0222fc..737f8b63783 100644 --- a/mysql-test/r/mysql_upgrade.result +++ b/mysql-test/r/mysql_upgrade.result @@ -1,5 +1,5 @@ Run mysql_upgrade once -Phase 1/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -30,9 +30,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +Phase 2/6: Fixing views +Phase 3/6: Running 'mysql_fix_privilege_tables' +Phase 4/6: Fixing table and database names +Phase 5/6: Checking and upgrading tables Processing databases information_schema mtr @@ -40,12 +41,12 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK Run it again - should say already completed This installation of MySQL is already upgraded to VERSION, use --force if you still need to run mysql_upgrade Force should run it regardless of wether it's been run before -Phase 1/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -76,9 +77,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +Phase 2/6: Fixing views +Phase 3/6: Running 'mysql_fix_privilege_tables' +Phase 4/6: Fixing table and database names +Phase 5/6: Checking and upgrading tables Processing databases information_schema mtr @@ -86,12 +88,12 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK CREATE USER mysqltest1@'%' IDENTIFIED by 'sakila'; GRANT ALL ON *.* TO mysqltest1@'%'; Run mysql_upgrade with password protected account -Phase 1/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -122,9 +124,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +Phase 2/6: Fixing views +Phase 3/6: Running 'mysql_fix_privilege_tables' +Phase 4/6: Fixing table and database names +Phase 5/6: Checking and upgrading tables Processing databases information_schema mtr @@ -132,7 +135,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK DROP USER mysqltest1@'%'; Version check failed. Got the following error when calling the 'mysql' command line client @@ -142,7 +145,7 @@ Run mysql_upgrade with a non existing server socket mysqlcheck: Got error: 2005: Unknown MySQL server host 'not_existing_host' (errno) when trying to connect FATAL ERROR: Upgrade failed set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE'; -Phase 1/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -173,9 +176,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +Phase 2/6: Fixing views +Phase 3/6: Running 'mysql_fix_privilege_tables' +Phase 4/6: Fixing table and database names +Phase 5/6: Checking and upgrading tables Processing databases information_schema mtr @@ -183,7 +187,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK set GLOBAL sql_mode=default; # @@ -194,7 +198,7 @@ CREATE PROCEDURE testproc() BEGIN END; UPDATE mysql.proc SET character_set_client = NULL WHERE name LIKE 'testproc'; UPDATE mysql.proc SET collation_connection = NULL WHERE name LIKE 'testproc'; UPDATE mysql.proc SET db_collation = NULL WHERE name LIKE 'testproc'; -Phase 1/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -225,9 +229,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +Phase 2/6: Fixing views +Phase 3/6: Running 'mysql_fix_privilege_tables' +Phase 4/6: Fixing table and database names +Phase 5/6: Checking and upgrading tables Processing databases information_schema mtr @@ -235,7 +240,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK CALL testproc(); DROP PROCEDURE testproc; @@ -249,7 +254,7 @@ WARNING: NULL values of the 'db_collation' column ('mysql.proc' table) have been GRANT USAGE ON *.* TO 'user3'@'%'; GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%'; Run mysql_upgrade with all privileges on a user -Phase 1/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -280,9 +285,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +Phase 2/6: Fixing views +Phase 3/6: Running 'mysql_fix_privilege_tables' +Phase 4/6: Fixing table and database names +Phase 5/6: Checking and upgrading tables Processing databases information_schema mtr @@ -290,7 +296,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK SHOW GRANTS FOR 'user3'@'%'; Grants for user3@% @@ -299,7 +305,7 @@ GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%' DROP USER 'user3'@'%'; End of 5.1 tests The --upgrade-system-tables option was used, user tables won't be touched. -Phase 1/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -330,8 +336,11 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 2/6: Fixing views... Skipped +Phase 3/6: Running 'mysql_fix_privilege_tables' +Phase 4/6: Fixing table and database names ... Skipped +Phase 5/6: Checking and upgrading tables... Skipped +Phase 6/6: Running 'FLUSH PRIVILEGES' OK # # Bug#11827359 60223: MYSQL_UPGRADE PROBLEM WITH OPTION @@ -339,7 +348,7 @@ OK # # Droping the previously created mysql_upgrade_info file.. # Running mysql_upgrade with --skip-write-binlog.. -Phase 1/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -370,9 +379,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +Phase 2/6: Fixing views +Phase 3/6: Running 'mysql_fix_privilege_tables' +Phase 4/6: Fixing table and database names +Phase 5/6: Checking and upgrading tables Processing databases information_schema mtr @@ -380,7 +390,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK # # MDEV-4332 Increase username length from 16 characters @@ -394,7 +404,7 @@ GRANT INSERT ON mysql.user TO very_long_user_name_number_2; GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_1; GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_2; CREATE PROCEDURE test.pr() BEGIN END; -Phase 1/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -425,9 +435,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +Phase 2/6: Fixing views +Phase 3/6: Running 'mysql_fix_privilege_tables' +Phase 4/6: Fixing table and database names +Phase 5/6: Checking and upgrading tables Processing databases information_schema mtr @@ -435,7 +446,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK SELECT definer FROM mysql.proc WHERE db = 'test' AND name = 'pr'; definer diff --git a/mysql-test/r/mysql_upgrade_no_innodb.result b/mysql-test/r/mysql_upgrade_no_innodb.result index e65c6ae05f7..acbca131587 100644 --- a/mysql-test/r/mysql_upgrade_no_innodb.result +++ b/mysql-test/r/mysql_upgrade_no_innodb.result @@ -1,5 +1,5 @@ The --upgrade-system-tables option was used, user tables won't be touched. -Phase 1/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -42,6 +42,9 @@ error : Corrupt mysql.innodb_table_stats Error : Unknown storage engine 'InnoDB' error : Corrupt -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 2/6: Fixing views... Skipped +Phase 3/6: Running 'mysql_fix_privilege_tables' +Phase 4/6: Fixing table and database names ... Skipped +Phase 5/6: Checking and upgrading tables... Skipped +Phase 6/6: Running 'FLUSH PRIVILEGES' OK diff --git a/mysql-test/r/mysql_upgrade_ssl.result b/mysql-test/r/mysql_upgrade_ssl.result index 1bbee22aba2..e06d1bb1671 100644 --- a/mysql-test/r/mysql_upgrade_ssl.result +++ b/mysql-test/r/mysql_upgrade_ssl.result @@ -1,7 +1,7 @@ # # Bug#55672 mysql_upgrade dies with internal error # -Phase 1/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -32,9 +32,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +Phase 2/6: Fixing views +Phase 3/6: Running 'mysql_fix_privilege_tables' +Phase 4/6: Fixing table and database names +Phase 5/6: Checking and upgrading tables Processing databases information_schema mtr @@ -42,5 +43,5 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK diff --git a/mysql-test/r/mysql_upgrade_view.result b/mysql-test/r/mysql_upgrade_view.result new file mode 100644 index 00000000000..37c9c926149 --- /dev/null +++ b/mysql-test/r/mysql_upgrade_view.result @@ -0,0 +1,286 @@ +set sql_log_bin=0; +drop table if exists t1,v1,v2,v3,v4,v1badcheck; +drop view if exists t1,v1,v2,v3,v4,v1badcheck; +create table t1(a int); +create table kv(k varchar(30) NOT NULL PRIMARY KEY,v varchar(50)); +flush tables; +check view v1; +Table Op Msg_type Msg_text +test.v1 check status OK +check view v1badcheck; +Table Op Msg_type Msg_text +test.v1badcheck check note View text checksum failed +check view v2; +Table Op Msg_type Msg_text +test.v2 check status OK +check view v3; +Table Op Msg_type Msg_text +test.v3 check status OK +check view v1 for upgrade; +Table Op Msg_type Msg_text +test.v1 check error Upgrade required. Please do "REPAIR VIEW `v1`" or dump/reload to fix it! +check view v1badcheck for upgrade; +Table Op Msg_type Msg_text +test.v1badcheck check note View text checksum failed +check view v2 for upgrade; +Table Op Msg_type Msg_text +test.v2 check error Upgrade required. Please do "REPAIR VIEW `v2`" or dump/reload to fix it! +check view v3 for upgrade; +Table Op Msg_type Msg_text +test.v3 check error Upgrade required. Please do "REPAIR VIEW `v3`" or dump/reload to fix it! +Phase 1/6: Checking and upgrading mysql database +Processing databases +mysql +mysql.column_stats OK +mysql.columns_priv OK +mysql.db OK +mysql.event OK +mysql.func OK +mysql.gtid_slave_pos OK +mysql.help_category OK +mysql.help_keyword OK +mysql.help_relation OK +mysql.help_topic OK +mysql.host OK +mysql.index_stats OK +mysql.innodb_index_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.innodb_table_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.plugin OK +mysql.proc OK +mysql.procs_priv OK +mysql.proxies_priv OK +mysql.roles_mapping OK +mysql.servers OK +mysql.table_stats OK +mysql.tables_priv OK +mysql.time_zone OK +mysql.time_zone_leap_second OK +mysql.time_zone_name OK +mysql.time_zone_transition OK +mysql.time_zone_transition_type OK +mysql.user OK + +Repairing tables +mysql.innodb_index_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.innodb_table_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +Phase 2/6: Fixing views +test.v1 OK +test.v1badcheck OK +test.v2 OK +test.v3 OK +Phase 3/6: Running 'mysql_fix_privilege_tables' +Phase 4/6: Fixing table and database names +Phase 5/6: Checking and upgrading tables +Processing databases +information_schema +mtr +mtr.global_suppressions OK +mtr.test_suppressions OK +performance_schema +test +test.kv OK +test.t1 OK +Phase 6/6: Running 'FLUSH PRIVILEGES' +OK +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci +show create view v3; +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci +set sql_log_bin=1; +REPAIR VIEW v1,v2; +Table Op Msg_type Msg_text +test.v1 repair status OK +test.v2 repair status OK +REPAIR VIEW v1badcheck; +Table Op Msg_type Msg_text +test.v1badcheck repair status OK +REPAIR NO_WRITE_TO_BINLOG VIEW v3; +Table Op Msg_type Msg_text +test.v3 repair status OK +set sql_log_bin=0; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; REPAIR VIEW v1,v2 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; REPAIR VIEW v1badcheck +LOAD DATA INFILE 'MYSQLD_DATADIR/test/v1.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '='; +SELECT k,v from kv where k in ('md5','algorithm'); +k v +algorithm 1 +md5 5e6eaf216e7b016fcedfd4e1113517af +SELECT k from kv where k ='mariadb-version'; +k +mariadb-version +truncate table kv; +LOAD DATA INFILE 'MYSQLD_DATADIR/test/v2.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '='; +SELECT k,v from kv where k in ('md5','algorithm'); +k v +algorithm 2 +md5 5e6eaf216e7b016fcedfd4e1113517af +SELECT k from kv where k ='mariadb-version'; +k +mariadb-version +truncate table kv; +LOAD DATA INFILE 'MYSQLD_DATADIR/test/v3.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '='; +SELECT k,v from kv where k in ('md5','algorithm'); +k v +algorithm 0 +md5 5e6eaf216e7b016fcedfd4e1113517af +SELECT k from kv where k ='mariadb-version'; +k +mariadb-version +truncate table kv; +LOAD DATA INFILE 'MYSQLD_DATADIR/test/v1badcheck.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '='; +SELECT k,v from kv where k in ('md5','algorithm'); +k v +algorithm 1 +md5 5e6eaf216e7b016fcedfd4e1113517af +SELECT k from kv where k ='mariadb-version'; +k +mariadb-version +truncate table kv; +drop view if exists v1,v2,v3,v1badcheck; +rename table mysql.event to mysql.ev_bk; +flush tables; +create algorithm=temptable view v4 as select a from t1; +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci +show create view v3; +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci +show create view v4; +View Create View character_set_client collation_connection +v4 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS select `t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci +MySQL upgrade detected +Phase 1/6: Checking and upgrading mysql database +Processing databases +mysql +mysql.column_stats OK +mysql.columns_priv OK +mysql.db OK +mysql.ev_bk OK +mysql.event OK +mysql.func OK +mysql.gtid_slave_pos OK +mysql.help_category OK +mysql.help_keyword OK +mysql.help_relation OK +mysql.help_topic OK +mysql.host OK +mysql.index_stats OK +mysql.innodb_index_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.innodb_table_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.plugin OK +mysql.proc OK +mysql.procs_priv OK +mysql.proxies_priv OK +mysql.roles_mapping OK +mysql.servers OK +mysql.table_stats OK +mysql.tables_priv OK +mysql.time_zone OK +mysql.time_zone_leap_second OK +mysql.time_zone_name OK +mysql.time_zone_transition OK +mysql.time_zone_transition_type OK +mysql.user OK + +Repairing tables +mysql.innodb_index_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.innodb_table_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +Phase 2/6: Fixing views from mysql +test.v1 OK +test.v2 OK +test.v3 OK +test.v4 OK +Phase 3/6: Running 'mysql_fix_privilege_tables' +Phase 4/6: Fixing table and database names +Phase 5/6: Checking and upgrading tables +Processing databases +information_schema +mtr +mtr.global_suppressions OK +mtr.test_suppressions OK +performance_schema +test +test.kv OK +test.t1 OK +Phase 6/6: Running 'FLUSH PRIVILEGES' +OK +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci +show create view v3; +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci +show create view v4; +View Create View character_set_client collation_connection +v4 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS select `t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci +LOAD DATA INFILE 'MYSQLD_DATADIR/test/v1.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '='; +SELECT k,v from kv where k in ('md5','algorithm'); +k v +algorithm 2 +md5 5e6eaf216e7b016fcedfd4e1113517af +SELECT k from kv where k ='mariadb-version'; +k +mariadb-version +truncate table kv; +drop view if exists v1,v2,v3; +drop table mysql.event; +rename table mysql.ev_bk to mysql.event; +test.kv OK +test.t1 OK +test.v1 OK +test.v2 OK +test.v3 OK +test.v4 OK +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; REPAIR VIEW v1,v2 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; REPAIR VIEW v1badcheck +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; REPAIR TABLE `kv` USE_FRM +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; REPAIR TABLE `t1` USE_FRM +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; REPAIR VIEW `v1` FROM MYSQL +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; REPAIR VIEW `v2` FROM MYSQL +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; REPAIR VIEW `v3` FROM MYSQL +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; REPAIR VIEW `v4` FROM MYSQL +drop table if exists kv; +drop view v1,v2,v3,v4; +drop table t1; diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index 5de1b9d8b6d..c5dd1500110 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -3,8 +3,8 @@ create table t1(f1 int); insert into t1 values (5); grant select on test.* to ssl_user1@localhost require SSL; grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA"; -grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client"; -grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client" ISSUER "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA"; +grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB/CN=client"; +grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB/CN=client" ISSUER "/CN=cacert/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB"; grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx"; flush privileges; connect(localhost,ssl_user2,,test,MASTER_PORT,MASTER_SOCKET); diff --git a/mysql-test/r/select_jcl6.result b/mysql-test/r/select_jcl6.result index e1014002784..3c62d0676ae 100644 --- a/mysql-test/r/select_jcl6.result +++ b/mysql-test/r/select_jcl6.result @@ -4423,7 +4423,7 @@ INSERT INTO t1 VALUES EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 -1 SIMPLE t2 hash_ALL a #hash#$hj 2 test.t1.a 2 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t2 hash_ALL a #hash#$hj 6 test.t1.a 2 Using where; Using join buffer (flat, BNLH join) SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; 1 1 @@ -4433,7 +4433,7 @@ SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 -1 SIMPLE t2 hash_ALL a #hash#$hj 2 test.t1.a 2 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t2 hash_ALL a #hash#$hj 6 test.t1.a 2 Using where; Using join buffer (flat, BNLH join) SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); 1 1 diff --git a/mysql-test/r/sp-destruct.result b/mysql-test/r/sp-destruct.result index 172e40cb40c..81c0adb36cc 100644 --- a/mysql-test/r/sp-destruct.result +++ b/mysql-test/r/sp-destruct.result @@ -170,3 +170,7 @@ Error 1728 Cannot load from mysql.proc. The table is probably corrupted # Restore mysql.proc DROP TABLE mysql.proc; RENAME TABLE proc_backup TO mysql.proc; +create database mysqltest1; +create procedure mysqltest1.foo() select "foo"; +update mysql.proc set name='' where db='mysqltest1'; +drop database mysqltest1; diff --git a/mysql-test/r/sp-innodb.result b/mysql-test/r/sp-innodb.result index da02957d3c9..b3405705698 100644 --- a/mysql-test/r/sp-innodb.result +++ b/mysql-test/r/sp-innodb.result @@ -30,3 +30,103 @@ CALL p1(); CALL p1(); drop procedure p1; drop table t1,t2; + +# +# BUG 16041903: CONTINUE HANDLER NOT INVOKED +# IN A STORED FUNCTION AFTER A LOCK WAIT TIMEOUT +# + +# Save and set lock wait timeout +SET @lock_wait_timeout_saved= @@lock_wait_timeout; +SET @innodb_lock_wait_timeout_saved= @@innodb_lock_wait_timeout; +SET @@lock_wait_timeout= 1; +SET @@innodb_lock_wait_timeout= 1; + +# Create a function with exit handler: +CREATE FUNCTION f1() RETURNS VARCHAR(20) +BEGIN +DECLARE EXIT HANDLER FOR SQLSTATE '42S02' RETURN 'No such table'; +INSERT INTO no_such_table VALUES (1); +END// + +# Create a function calling f1(): +CREATE FUNCTION f2() RETURNS VARCHAR(20) +BEGIN +RETURN f1(); +END// + +# Create a function provoking deadlock: +CREATE FUNCTION f3() RETURNS VARCHAR(20) +BEGIN +UPDATE t1 SET i= 1 WHERE i= 1; +RETURN 'Will never get here'; +END// + +# Create a function calling f3, to create +# a deadlock indirectly: +CREATE FUNCTION f4() RETURNS VARCHAR(20) +BEGIN +RETURN f3(); +END// + +# Open another connection, create and initialize a table +# to be used for provoking deadlock, put a lock on the table: +CREATE TABLE t1 (i INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +SET AUTOCOMMIT= 0; +UPDATE t1 SET i=1 WHERE i=1; + +# On the default connection, do an update to provoke a +# deadlock, then call the function with handler. This case +# fails without the patch (with error ER_NO_SUCH_TABLE): +SET AUTOCOMMIT= 0; +UPDATE t1 SET i=1 WHERE i=1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +SELECT f1() AS 'f1():'; +f1(): +No such table + +# Provoke another deadlock, then call the function with +# handler indirectly. This case fails without the patch +# (with error ER_NO_SUCH_TABLE): +UPDATE t1 SET i= 1 WHERE i= 1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +SELECT f2() AS 'f2():'; +f2(): +No such table + +# Provoke yet another deadlock, but now from within a function, +# then call the function with handler. This succeeds even +# without the patch because is_fatal_sub_stmt_error is reset +# in restore_sub_stmt after the failing function has been +# executed. The test case is included anyway for better coverage: +SELECT f3() AS 'f3():'; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +SELECT f1() AS 'f1():'; +f1(): +No such table +# Provoke yet another deadlock, but now from within a function, +# calling another function, then call the function with handler. +# This succeeds even without the patch because +# is_fatal_sub_stmt_error is reset in restore_sub_stmt after +# the failing function has been executed. The test case is +# included anyway for better coverage: +SELECT f4() AS 'f4():'; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +SELECT f1() AS 'f1():'; +f1(): +No such table + +# Disconnect, drop functions and table: +DROP FUNCTION f4; +DROP FUNCTION f3; +DROP FUNCTION f2; +DROP FUNCTION f1; +DROP TABLE t1; + +# Reset lock wait timeouts +SET @@lock_wait_timeout= @lock_wait_timeout_saved; +SET @@innodb_lock_wait_timeout= @innodb_lock_wait_timeout_saved; +# +# BUG 16041903: End of test case +# diff --git a/mysql-test/r/ssl.result b/mysql-test/r/ssl.result index 525bae01b23..57427a228eb 100644 --- a/mysql-test/r/ssl.result +++ b/mysql-test/r/ssl.result @@ -3,10 +3,10 @@ Variable_name Value Ssl_cipher DHE-RSA-AES256-SHA SHOW STATUS LIKE 'Ssl_server_not_before'; Variable_name Value -Ssl_server_not_before Dec 5 04:48:40 2014 GMT +Ssl_server_not_before Apr 25 14:55:05 2015 GMT SHOW STATUS LIKE 'Ssl_server_not_after'; Variable_name Value -Ssl_server_not_after Dec 1 04:48:40 2029 GMT +Ssl_server_not_after Apr 20 14:55:05 2035 GMT drop table if exists t1,t2,t3,t4; CREATE TABLE t1 ( Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result index 2bb00835a75..46c799c4f6e 100644 --- a/mysql-test/r/subselect_sj.result +++ b/mysql-test/r/subselect_sj.result @@ -2988,4 +2988,13 @@ pk1 i1 i2 c2 pk3 i3 c3 SET join_cache_level=@tmp_mdev5059; set optimizer_switch=@tmp_os_mdev5059; DROP TABLE t1,t2,t3,t4; +# +# MDEV-7911: crash in Item_cond::eval_not_null_tables +# +create table t1(a int); +insert into t1 values(1),(2),(3),(null); +explain +select 1 from t1 where _cp932 "1" in (select '1' from t1); +ERROR HY000: Illegal mix of collations (cp932_japanese_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation '=' +drop table t1; set optimizer_switch=@subselect_sj_tmp; diff --git a/mysql-test/r/subselect_sj2.result b/mysql-test/r/subselect_sj2.result index 43ba6ead575..9a5da710a4c 100644 --- a/mysql-test/r/subselect_sj2.result +++ b/mysql-test/r/subselect_sj2.result @@ -1178,5 +1178,89 @@ id nombre 2 row 2 3 row 3 DROP TABLE t1, t2; +# +# MDEV-7474: Semi-Join's DuplicateWeedout strategy skipped for some values of optimizer_search_depth +# +CREATE TABLE t1 ( +t1id BIGINT(20) NOT NULL, +code VARCHAR(20), +PRIMARY KEY (t1id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; +CREATE TABLE t2 ( +t2id BIGINT(20) NOT NULL, +t1idref BIGINT(20) NOT NULL, +code VARCHAR(20), +PRIMARY KEY (t2id), +INDEX FK_T2_T1Id (t1idref), +CONSTRAINT FK_T2_T1Id FOREIGN KEY (t1idref) REFERENCES t1 (t1id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; +CREATE TABLE t3 ( +t3idref BIGINT(20) NOT NULL, +t2idref BIGINT(20) NOT NULL, +sequencenumber INT(10) NOT NULL, +PRIMARY KEY (t3idref, t2idref), +INDEX FK_T3_T2Id (t2idref), +CONSTRAINT FK_T3_T2Id FOREIGN KEY (t2idref) REFERENCES t2 (t2id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; +INSERT INTO t1 (t1id) VALUES (100001),(100017),(100018),(100026),(100027),(100028),(100029),(100030), +(100031),(100032),(100033),(100034),(100035),(100036),(100037),(100038),(100040),(100041),(100042), +(100043),(100044),(100045),(100046),(100047); +INSERT IGNORE INTO t2 (t2id, t1idref) SELECT t1id, t1id FROM t1; +INSERT IGNORE INTO t1 VALUES (200001, 'a'); +INSERT IGNORE INTO t2 (t2id, t1idref) VALUES (200011, 200001),(200012, 200001),(200013, 200001); +INSERT IGNORE INTO t3 VALUES (1, 200011, 1), (1, 200012, 2), (1, 200013, 3); +set @tmp7474= @@optimizer_search_depth; +SET SESSION optimizer_search_depth = 1; +SELECT SQL_NO_CACHE +T2_0_.t1idref, +T2_0_.t2id +FROM +t2 T2_0_ +WHERE +T2_0_.t1idref IN ( +SELECT +T1_1_.t1id +FROM +t3 T3_0_ +INNER JOIN +t2 T2_1_ +ON T3_0_.t2idref=T2_1_.t2id +INNER JOIN +t1 T1_1_ +ON T2_1_.t1idref=T1_1_.t1id +WHERE +T3_0_.t3idref= 1 +); +t1idref t2id +200001 200011 +200001 200012 +200001 200013 +explain SELECT SQL_NO_CACHE +T2_0_.t1idref, +T2_0_.t2id +FROM +t2 T2_0_ +WHERE +T2_0_.t1idref IN ( +SELECT +T1_1_.t1id +FROM +t3 T3_0_ +INNER JOIN +t2 T2_1_ +ON T3_0_.t2idref=T2_1_.t2id +INNER JOIN +t1 T1_1_ +ON T2_1_.t1idref=T1_1_.t1id +WHERE +T3_0_.t3idref= 1 +); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY T3_0_ ref PRIMARY,FK_T3_T2Id PRIMARY 8 const 3 Using index; Start temporary +1 PRIMARY T2_1_ eq_ref PRIMARY,FK_T2_T1Id PRIMARY 8 test.T3_0_.t2idref 1 +1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1 Using index +1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index; End temporary +drop table t3,t2,t1; +set optimizer_search_depth=@tmp7474; # This must be the last in the file: set optimizer_switch=@subselect_sj2_tmp; diff --git a/mysql-test/r/subselect_sj2_jcl6.result b/mysql-test/r/subselect_sj2_jcl6.result index ee8aa39d095..c10b550d11a 100644 --- a/mysql-test/r/subselect_sj2_jcl6.result +++ b/mysql-test/r/subselect_sj2_jcl6.result @@ -1193,6 +1193,90 @@ id nombre 2 row 2 3 row 3 DROP TABLE t1, t2; +# +# MDEV-7474: Semi-Join's DuplicateWeedout strategy skipped for some values of optimizer_search_depth +# +CREATE TABLE t1 ( +t1id BIGINT(20) NOT NULL, +code VARCHAR(20), +PRIMARY KEY (t1id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; +CREATE TABLE t2 ( +t2id BIGINT(20) NOT NULL, +t1idref BIGINT(20) NOT NULL, +code VARCHAR(20), +PRIMARY KEY (t2id), +INDEX FK_T2_T1Id (t1idref), +CONSTRAINT FK_T2_T1Id FOREIGN KEY (t1idref) REFERENCES t1 (t1id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; +CREATE TABLE t3 ( +t3idref BIGINT(20) NOT NULL, +t2idref BIGINT(20) NOT NULL, +sequencenumber INT(10) NOT NULL, +PRIMARY KEY (t3idref, t2idref), +INDEX FK_T3_T2Id (t2idref), +CONSTRAINT FK_T3_T2Id FOREIGN KEY (t2idref) REFERENCES t2 (t2id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; +INSERT INTO t1 (t1id) VALUES (100001),(100017),(100018),(100026),(100027),(100028),(100029),(100030), +(100031),(100032),(100033),(100034),(100035),(100036),(100037),(100038),(100040),(100041),(100042), +(100043),(100044),(100045),(100046),(100047); +INSERT IGNORE INTO t2 (t2id, t1idref) SELECT t1id, t1id FROM t1; +INSERT IGNORE INTO t1 VALUES (200001, 'a'); +INSERT IGNORE INTO t2 (t2id, t1idref) VALUES (200011, 200001),(200012, 200001),(200013, 200001); +INSERT IGNORE INTO t3 VALUES (1, 200011, 1), (1, 200012, 2), (1, 200013, 3); +set @tmp7474= @@optimizer_search_depth; +SET SESSION optimizer_search_depth = 1; +SELECT SQL_NO_CACHE +T2_0_.t1idref, +T2_0_.t2id +FROM +t2 T2_0_ +WHERE +T2_0_.t1idref IN ( +SELECT +T1_1_.t1id +FROM +t3 T3_0_ +INNER JOIN +t2 T2_1_ +ON T3_0_.t2idref=T2_1_.t2id +INNER JOIN +t1 T1_1_ +ON T2_1_.t1idref=T1_1_.t1id +WHERE +T3_0_.t3idref= 1 +); +t1idref t2id +200001 200011 +200001 200012 +200001 200013 +explain SELECT SQL_NO_CACHE +T2_0_.t1idref, +T2_0_.t2id +FROM +t2 T2_0_ +WHERE +T2_0_.t1idref IN ( +SELECT +T1_1_.t1id +FROM +t3 T3_0_ +INNER JOIN +t2 T2_1_ +ON T3_0_.t2idref=T2_1_.t2id +INNER JOIN +t1 T1_1_ +ON T2_1_.t1idref=T1_1_.t1id +WHERE +T3_0_.t3idref= 1 +); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY T3_0_ ref PRIMARY,FK_T3_T2Id PRIMARY 8 const 3 Using index; Start temporary +1 PRIMARY T2_1_ eq_ref PRIMARY,FK_T2_T1Id PRIMARY 8 test.T3_0_.t2idref 1 Using join buffer (flat, BKA join); Key-ordered scan +1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1 Using index +1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index; End temporary +drop table t3,t2,t1; +set optimizer_search_depth=@tmp7474; # This must be the last in the file: set optimizer_switch=@subselect_sj2_tmp; # diff --git a/mysql-test/r/subselect_sj2_mat.result b/mysql-test/r/subselect_sj2_mat.result index 0ff366b0d7a..4e75aee24a2 100644 --- a/mysql-test/r/subselect_sj2_mat.result +++ b/mysql-test/r/subselect_sj2_mat.result @@ -1180,6 +1180,90 @@ id nombre 2 row 2 3 row 3 DROP TABLE t1, t2; +# +# MDEV-7474: Semi-Join's DuplicateWeedout strategy skipped for some values of optimizer_search_depth +# +CREATE TABLE t1 ( +t1id BIGINT(20) NOT NULL, +code VARCHAR(20), +PRIMARY KEY (t1id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; +CREATE TABLE t2 ( +t2id BIGINT(20) NOT NULL, +t1idref BIGINT(20) NOT NULL, +code VARCHAR(20), +PRIMARY KEY (t2id), +INDEX FK_T2_T1Id (t1idref), +CONSTRAINT FK_T2_T1Id FOREIGN KEY (t1idref) REFERENCES t1 (t1id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; +CREATE TABLE t3 ( +t3idref BIGINT(20) NOT NULL, +t2idref BIGINT(20) NOT NULL, +sequencenumber INT(10) NOT NULL, +PRIMARY KEY (t3idref, t2idref), +INDEX FK_T3_T2Id (t2idref), +CONSTRAINT FK_T3_T2Id FOREIGN KEY (t2idref) REFERENCES t2 (t2id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; +INSERT INTO t1 (t1id) VALUES (100001),(100017),(100018),(100026),(100027),(100028),(100029),(100030), +(100031),(100032),(100033),(100034),(100035),(100036),(100037),(100038),(100040),(100041),(100042), +(100043),(100044),(100045),(100046),(100047); +INSERT IGNORE INTO t2 (t2id, t1idref) SELECT t1id, t1id FROM t1; +INSERT IGNORE INTO t1 VALUES (200001, 'a'); +INSERT IGNORE INTO t2 (t2id, t1idref) VALUES (200011, 200001),(200012, 200001),(200013, 200001); +INSERT IGNORE INTO t3 VALUES (1, 200011, 1), (1, 200012, 2), (1, 200013, 3); +set @tmp7474= @@optimizer_search_depth; +SET SESSION optimizer_search_depth = 1; +SELECT SQL_NO_CACHE +T2_0_.t1idref, +T2_0_.t2id +FROM +t2 T2_0_ +WHERE +T2_0_.t1idref IN ( +SELECT +T1_1_.t1id +FROM +t3 T3_0_ +INNER JOIN +t2 T2_1_ +ON T3_0_.t2idref=T2_1_.t2id +INNER JOIN +t1 T1_1_ +ON T2_1_.t1idref=T1_1_.t1id +WHERE +T3_0_.t3idref= 1 +); +t1idref t2id +200001 200011 +200001 200012 +200001 200013 +explain SELECT SQL_NO_CACHE +T2_0_.t1idref, +T2_0_.t2id +FROM +t2 T2_0_ +WHERE +T2_0_.t1idref IN ( +SELECT +T1_1_.t1id +FROM +t3 T3_0_ +INNER JOIN +t2 T2_1_ +ON T3_0_.t2idref=T2_1_.t2id +INNER JOIN +t1 T1_1_ +ON T2_1_.t1idref=T1_1_.t1id +WHERE +T3_0_.t3idref= 1 +); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY T3_0_ ref PRIMARY,FK_T3_T2Id PRIMARY 8 const 3 Using index; Start temporary +1 PRIMARY T2_1_ eq_ref PRIMARY,FK_T2_T1Id PRIMARY 8 test.T3_0_.t2idref 1 +1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1 Using index +1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index; End temporary +drop table t3,t2,t1; +set optimizer_search_depth=@tmp7474; # This must be the last in the file: set optimizer_switch=@subselect_sj2_tmp; set optimizer_switch=default; diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result index f388fd41ce8..ba582d7e008 100644 --- a/mysql-test/r/subselect_sj_jcl6.result +++ b/mysql-test/r/subselect_sj_jcl6.result @@ -3002,6 +3002,15 @@ pk1 i1 i2 c2 pk3 i3 c3 SET join_cache_level=@tmp_mdev5059; set optimizer_switch=@tmp_os_mdev5059; DROP TABLE t1,t2,t3,t4; +# +# MDEV-7911: crash in Item_cond::eval_not_null_tables +# +create table t1(a int); +insert into t1 values(1),(2),(3),(null); +explain +select 1 from t1 where _cp932 "1" in (select '1' from t1); +ERROR HY000: Illegal mix of collations (cp932_japanese_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation '=' +drop table t1; set optimizer_switch=@subselect_sj_tmp; # # BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off diff --git a/mysql-test/r/table_elim.result b/mysql-test/r/table_elim.result index ff488fea427..c633261bcd3 100644 --- a/mysql-test/r/table_elim.result +++ b/mysql-test/r/table_elim.result @@ -677,3 +677,35 @@ USA CAN DROP TABLE t1, t2, t3; SET optimizer_switch=@save_optimizer_switch; +# +# MDEV-7893: table_elimination works wrong with on computed expression and compound unique key +# (just a testcase) +CREATE TABLE t1 ( +PostID int(10) unsigned NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1266 Using storage engine MyISAM for table 't1' +INSERT INTO t1 (PostID) VALUES (1), (2); +CREATE TABLE t2 ( +VoteID int(10) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, +EntityID int(10) unsigned NOT NULL, +UserID int(10) unsigned NOT NULL, +UNIQUE KEY EntityID (EntityID,UserID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1266 Using storage engine MyISAM for table 't2' +INSERT INTO t2 (EntityID, UserID) VALUES (1, 30), (2, 30); +SELECT t1.*, T.Voted as Voted +FROM +t1 LEFT JOIN ( +SELECT 1 AS Voted, EntityID +FROM t2 +WHERE t2.UserID = '20' ) AS T +ON T.EntityID = t1.PostID +WHERE t1.PostID='1' +LIMIT 1; +PostID Voted +1 NULL +DROP TABLE t1,t2; diff --git a/mysql-test/r/trigger-trans.result b/mysql-test/r/trigger-trans.result index 722ac79854d..cab7336cbe5 100644 --- a/mysql-test/r/trigger-trans.result +++ b/mysql-test/r/trigger-trans.result @@ -195,3 +195,28 @@ b val 14 g drop trigger t1_after_insert; drop table t1,t2; +# +#Bug#19683834 SOME INNODB ERRORS CAUSES STORED FUNCTION +# AND TRIGGER HANDLERS TO BE IGNORED +#Code fixed in Bug#16041903 +CREATE TABLE t1 (id int unsigned PRIMARY KEY, val int DEFAULT 0) +ENGINE=InnoDB; +INSERT INTO t1 (id) VALUES (1), (2); +CREATE TABLE t2 (id int PRIMARY KEY); +CREATE TABLE t3 LIKE t2; +CREATE TRIGGER bef_insert BEFORE INSERT ON t2 FOR EACH ROW +BEGIN +DECLARE CONTINUE HANDLER FOR 1062 BEGIN END; +INSERT INTO t3 (id) VALUES (NEW.id); +INSERT INTO t3 (id) VALUES (NEW.id); +END// +START TRANSACTION; +UPDATE t1 SET val = val + 1; +connect con2,localhost,root,,test,,; +SET SESSION innodb_lock_wait_timeout = 2; +UPDATE t1 SET val = val + 1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +INSERT INTO t2 (id) VALUES (1); +disconnect con2; +connection default; +DROP TABLE t3, t2, t1; diff --git a/mysql-test/r/uniques_crash-7912.result b/mysql-test/r/uniques_crash-7912.result new file mode 100644 index 00000000000..bf3aab684ae --- /dev/null +++ b/mysql-test/r/uniques_crash-7912.result @@ -0,0 +1,11 @@ +call mtr.add_suppression("Out of memory"); +set sql_mode=""; +drop table if exists t1,t2; +create table `t1` (`a` datetime not null) engine=InnoDB; +create table `t2` (`a` int not null) engine=innodb; +replace into t1 values (),(); +insert into t2 values(0); +set session sort_buffer_size = 1024*1024*1024*1024; +delete d2 from t2 as d1, t1 as d2 where d1.a <=> d2.a; +drop table t2; +drop table t1; diff --git a/mysql-test/std_data/cacert.pem b/mysql-test/std_data/cacert.pem index a0ba67444ef..e934823eea3 100644 --- a/mysql-test/std_data/cacert.pem +++ b/mysql-test/std_data/cacert.pem @@ -1,79 +1,78 @@ Certificate: Data: Version: 3 (0x2) - Serial Number: 16263805969935345171 (0xe1b4a55c3ddfa613) - Signature Algorithm: sha256WithRSAEncryption - Issuer: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=CA + Serial Number: 11580370790696127632 (0xa0b5bde0f2c08c90) + Signature Algorithm: sha1WithRSAEncryption + Issuer: CN=cacert, C=FI, ST=Helsinki, L=Helsinki, O=MariaDB Validity - Not Before: Dec 5 04:48:11 2014 GMT - Not After : Dec 1 04:48:11 2030 GMT - Subject: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=CA + Not Before: Apr 25 14:55:05 2015 GMT + Not After : Apr 20 14:55:05 2035 GMT + Subject: CN=cacert, C=FI, ST=Helsinki, L=Helsinki, O=MariaDB Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) Modulus: - 00:b4:95:bd:24:92:73:06:22:01:13:28:0e:09:a3: - 94:05:96:54:9d:dc:8f:83:39:f3:64:7a:31:70:f6: - d9:c4:14:19:75:87:a6:b1:ea:52:ed:40:54:5a:f6: - 9c:13:8e:d8:76:8f:5a:65:a5:20:19:19:bd:51:9d: - ba:35:ce:9a:a9:58:0a:fc:11:6e:1d:cb:a8:f1:92: - 79:ee:aa:fc:e3:32:5e:aa:0d:0b:23:34:95:e9:d3: - 8e:3f:72:93:90:bc:2c:b0:04:75:4f:a4:4a:a0:32: - db:ac:89:ac:34:9b:d0:07:e3:81:e9:ca:5b:26:f0: - f5:de:fe:d5:5e:a0:54:26:dd:ec:58:07:6e:b9:e5: - 97:f6:20:6d:d8:4a:c0:50:cc:81:e6:d2:3f:c7:47: - 70:8b:15:89:65:71:2e:47:c3:42:76:b5:ee:16:0e: - 26:97:6a:a3:1c:ad:90:53:50:b0:b1:6d:1d:b0:b8: - 6d:df:3c:ee:bd:3b:87:e8:db:4d:3a:72:78:dd:db: - 40:3d:c9:20:46:b8:4e:33:bb:76:b7:4f:b2:79:da: - 03:cc:f9:75:c0:1d:4c:51:0a:b9:9b:25:34:50:11: - 97:df:82:46:02:a9:bc:98:51:3e:c3:df:57:ad:b7: - 28:be:de:65:ce:2b:f3:2c:22:f5:af:31:28:1c:ef: - 10:09 + 00:c0:1f:90:7c:2b:c2:ea:01:93:ce:e0:c5:72:e8: + 1c:06:bd:63:4e:b6:d2:c6:00:32:13:27:42:9e:c9: + 3c:91:33:4d:15:90:67:7d:9d:d8:be:9b:12:e2:f6: + 1b:46:81:4a:8b:10:c5:b8:14:53:ab:6a:2c:c3:7f: + 66:87:6c:0e:18:51:4e:9c:93:7a:6d:a1:d4:06:47: + 58:61:a6:04:21:2c:bd:74:7a:e4:68:45:fe:91:fe: + fb:a6:29:47:ec:c5:c3:88:c8:c9:e7:d7:c6:1a:0d: + b8:f5:c5:02:57:25:01:cc:d5:8c:37:46:58:c6:71: + 30:ee:63:38:99:84:5e:9e:3c:af:40:d4:f0:f2:12: + 44:6e:2f:4d:cd:f9:da:4d:0e:1f:a6:fe:35:c3:9d: + 40:08:82:5e:6f:7d:4d:09:16:7d:a1:78:d6:9f:9f: + 44:d6:b1:ad:e7:50:25:1a:f3:4e:16:92:4a:17:5e: + 0b:e1:c8:9f:62:22:c4:e2:01:96:63:ed:37:a2:e5: + 70:b9:dc:c8:8e:c4:fe:00:21:f5:b9:48:c0:43:55: + 4a:d8:0c:9d:ce:d6:60:30:bb:81:31:c8:e9:0e:aa: + 1c:18:3d:e4:10:47:42:17:c0:4d:fb:f5:d9:c2:e4: + 07:33:f7:15:94:63:6d:11:ad:4f:d4:1d:11:41:c1: + e2:dd Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - 94:65:A1:A3:87:CF:BF:C1:74:BB:D8:84:97:B6:6B:EE:B2:90:73:B2 + C7:2C:01:95:1A:F5:3E:CD:04:A6:24:35:35:04:D9:A7:16:01:2A:79 X509v3 Authority Key Identifier: - keyid:94:65:A1:A3:87:CF:BF:C1:74:BB:D8:84:97:B6:6B:EE:B2:90:73:B2 + keyid:C7:2C:01:95:1A:F5:3E:CD:04:A6:24:35:35:04:D9:A7:16:01:2A:79 X509v3 Basic Constraints: CA:TRUE - Signature Algorithm: sha256WithRSAEncryption - 32:97:4c:af:bf:ca:e0:10:66:b7:cc:8b:0d:05:d1:d2:ca:b8: - 0c:c2:78:57:1f:f6:55:9c:74:fc:bd:31:58:05:18:bc:6d:b5: - 79:9a:22:8c:1f:da:33:ea:ef:db:e3:cb:46:bc:36:91:8b:d8: - 36:8d:06:40:c2:e9:fe:79:1b:4a:c5:70:74:6d:9d:92:2c:90: - be:3c:a7:88:03:e4:b7:ef:f4:b0:00:34:ec:8f:d1:c3:23:2b: - ef:bc:ff:ab:a2:0e:bc:ba:11:a5:8e:44:80:fa:d6:f4:26:66: - 84:64:2c:e3:23:62:0c:e2:ba:01:ab:5f:24:d6:9d:7e:9c:7b: - f4:5d:0e:ba:64:35:6e:a5:fa:98:0c:57:f3:72:e8:3e:2e:ce: - b3:f9:e3:fa:ee:aa:79:f9:06:01:19:b2:b3:28:ff:f4:d6:bb: - 17:bb:a6:a0:e0:45:23:f3:61:40:31:5c:a3:ee:88:1c:00:31: - 54:96:f9:71:37:b5:7f:66:6a:af:04:94:09:39:99:b3:88:86: - 9e:bb:d6:36:24:24:f4:37:2c:a6:6c:0b:35:2e:bb:40:af:a7: - 64:8a:7f:f2:74:e3:94:0c:32:bd:31:3d:d9:79:68:0f:1e:4b: - 17:c0:4e:df:85:3c:f0:84:df:58:f1:d2:4d:2f:ad:ff:1b:d7: - c8:9b:fe:dc + Signature Algorithm: sha1WithRSAEncryption + 40:6f:6a:54:f3:29:30:48:46:bd:da:46:71:64:52:14:a7:c2: + 34:b7:5e:1e:42:3d:e7:47:92:cd:87:e7:9d:5d:1a:82:77:82: + 62:32:d4:9d:b6:44:11:dc:88:78:38:a5:d3:1f:1e:be:c2:d6: + 14:b0:58:35:cd:66:22:43:97:ba:bb:e3:44:4f:9d:75:14:9f: + 6f:37:d3:50:07:09:36:bc:58:92:e8:fe:c0:a8:ba:29:55:65: + e2:6f:8f:ab:a5:1d:4f:56:37:de:c7:b4:39:20:4c:a8:4c:db: + 56:51:12:7e:e7:7f:83:9d:c4:c7:72:8f:6f:83:f0:af:e3:37: + 1c:40:fe:5e:38:26:2f:05:46:a7:0c:a5:81:79:d6:9c:9c:d7: + 56:eb:96:fe:c7:ae:8e:4f:5e:4a:6c:3a:fa:68:be:65:60:a2: + d3:3f:07:76:45:b3:95:3e:11:ef:3a:0e:6f:73:47:4c:90:dd: + 0b:36:b4:22:df:62:8d:58:d2:a6:34:5b:f0:06:5d:cd:bf:52: + fa:ee:9b:4f:e8:79:18:6e:1c:6e:5f:96:10:6d:2f:02:1b:dd: + bf:14:c9:32:3c:83:a5:6e:56:56:78:9d:ce:84:50:a4:df:cc: + b5:a9:b1:ec:09:07:74:02:27:7a:9d:d2:96:a9:80:95:9a:f2: + 8c:e9:ef:99 -----BEGIN CERTIFICATE----- -MIIDmTCCAoGgAwIBAgIJAOG0pVw936YTMA0GCSqGSIb3DQEBCwUAMGMxCzAJBgN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WDXNZiJDl7q740RPnXUUn28301AH +CTa8WJLo/sCouilVZeJvj6ulHU9WN97HtDkgTKhM21ZREn7nf4OdxMdyj2+D8K/j +NxxA/l44Ji8FRqcMpYF51pyc11brlv7Hro5PXkpsOvpovmVgotM/B3ZFs5U+Ee86 +Dm9zR0yQ3Qs2tCLfYo1Y0qY0W/AGXc2/Uvrum0/oeRhuHG5flhBtLwIb3b8UyTI8 +g6VuVlZ4nc6EUKTfzLWpsewJB3QCJ3qd0papgJWa8ozp75k= -----END CERTIFICATE----- diff --git a/mysql-test/std_data/client-cert.pem b/mysql-test/std_data/client-cert.pem index f60a0884178..cbe8bc2c677 100644 --- a/mysql-test/std_data/client-cert.pem +++ b/mysql-test/std_data/client-cert.pem @@ -1,35 +1,26 @@ Certificate: Data: Version: 3 (0x2) - Serial Number: 16263805969935345173 (0xe1b4a55c3ddfa615) - Signature Algorithm: sha256WithRSAEncryption - Issuer: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=CA + Serial Number: 3 (0x3) + Signature Algorithm: sha1WithRSAEncryption + Issuer: CN=cacert, C=FI, ST=Helsinki, L=Helsinki, O=MariaDB Validity - Not Before: Dec 5 04:49:23 2014 GMT - Not After : Dec 1 04:49:23 2029 GMT - Subject: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=Client + Not Before: Apr 25 14:55:16 2015 GMT + Not After : Apr 20 14:55:16 2035 GMT + Subject: C=FI, ST=Helsinki, L=Helsinki, O=MariaDB, CN=client Subject Public Key Info: Public Key Algorithm: rsaEncryption - Public-Key: (2048 bit) + Public-Key: (1024 bit) Modulus: - 00:c8:d1:a1:fe:a4:8c:f3:1b:17:71:1b:74:35:11: - e0:0e:6c:40:0a:fb:c0:f7:f0:eb:bb:c9:1d:a1:c7: - d7:b0:8a:f6:f1:cf:fa:6b:d0:79:64:eb:bb:69:a5: - 0d:80:06:df:52:14:d2:85:32:cf:bf:ce:2a:47:28: - 5b:cd:0b:28:ab:bb:07:33:d5:8b:d3:b4:72:c4:a6: - b5:cc:37:b9:03:a8:78:56:25:58:1f:17:30:7c:d1: - 0a:bb:ec:3c:a3:03:90:97:99:92:49:ae:b3:57:96: - 5c:1a:e9:e8:02:23:ae:c8:c9:05:50:63:e5:77:a1: - 9a:73:06:74:0e:46:50:28:d8:c9:4f:c4:1c:37:b8: - 52:18:0b:af:19:2b:d4:e5:66:74:a4:f3:f0:da:09: - 30:f7:bc:0c:c9:9b:ce:57:06:04:27:e5:a1:2f:2b: - a0:ba:b7:99:69:9d:46:fc:21:b6:45:81:9d:b2:3d: - 2f:76:15:78:b5:33:62:ac:1e:6b:66:dd:27:61:0a: - 47:02:20:2b:57:bb:32:20:dd:06:4c:76:a4:9b:72: - 42:4c:9c:2c:76:72:12:1f:4b:df:1e:11:1f:a9:06: - 54:dc:88:12:b0:49:d5:40:83:ef:7e:48:43:86:7a: - 37:a6:c1:d7:9b:fe:08:34:98:e0:54:3c:30:4f:79: - 15:29 + 00:ce:a0:3d:3c:a4:bb:4f:a1:4f:91:0d:05:ac:5b: + 8a:15:7f:d7:aa:0c:a3:a7:9f:b2:c7:26:9d:65:28: + b1:84:d3:a0:ef:9e:b1:45:0f:33:df:98:6e:71:ff: + 2b:66:9c:9c:c1:25:13:27:42:b6:20:46:e7:e7:47: + a1:88:47:c2:9e:e2:45:25:99:9f:f9:28:1a:9a:13: + 67:5d:3e:b3:b8:fe:40:25:ac:26:49:46:2c:03:43: + 83:67:d8:0f:41:ae:2e:f4:d8:71:60:3c:8e:e7:91: + d0:bb:2c:ca:12:da:71:1a:7b:e3:fa:8c:8f:c3:bb: + 62:55:89:b3:bf:85:45:01:61 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: @@ -37,46 +28,42 @@ Certificate: Netscape Comment: OpenSSL Generated Certificate X509v3 Subject Key Identifier: - 26:0C:90:BC:97:12:9E:43:BB:5E:FE:EB:A9:66:B3:C3:EE:B2:18:CB + 5A:73:74:8E:14:29:C3:FB:B4:19:0F:97:8F:AA:6F:E1:E1:A8:F7:5B X509v3 Authority Key Identifier: - keyid:94:65:A1:A3:87:CF:BF:C1:74:BB:D8:84:97:B6:6B:EE:B2:90:73:B2 + keyid:C7:2C:01:95:1A:F5:3E:CD:04:A6:24:35:35:04:D9:A7:16:01:2A:79 - Signature Algorithm: sha256WithRSAEncryption - 3e:3c:1f:6c:5b:83:d1:71:15:f5:45:52:fc:7f:67:bc:af:c5: - 92:f5:74:78:13:43:3c:fe:b5:61:bf:00:47:43:45:a0:b9:dd: - a1:10:0c:29:69:2a:6f:7d:67:3d:1e:09:b5:15:74:bf:73:11: - e6:e9:09:b6:6b:b5:cc:1e:06:fd:bd:3a:11:d3:44:bd:ca:7a: - a1:f1:09:43:fc:bf:83:89:3a:b1:18:40:f3:cf:6d:12:ef:6e: - 0c:b7:a4:99:03:8a:4f:0c:3c:2c:23:78:35:2a:99:ea:de:9c: - 1b:e8:8d:19:fb:44:80:13:89:81:c5:05:4b:a7:66:6b:c0:31: - 41:f0:6c:60:aa:ec:d3:4c:ff:c1:3b:d5:bb:0d:42:7d:37:5e: - 80:e7:9c:7e:60:90:0f:a4:4e:70:20:9c:b1:e4:1b:70:65:b0: - ef:bb:41:16:ed:ad:46:ce:34:d3:02:3d:dd:e2:50:fa:3c:5d: - f0:e2:71:f8:9a:ef:a3:32:25:c5:8e:64:f4:46:e1:f4:c0:69: - d2:34:56:8d:d9:c2:6e:b6:55:3b:6a:4d:b6:d2:84:ab:85:7b: - cb:fd:b4:73:40:ba:5d:49:e2:0d:39:77:17:01:49:bb:72:8b: - 3a:c9:b1:e2:cd:13:d2:9c:ce:7d:6c:a8:f0:32:c9:a4:af:56: - 6f:8a:e6:88 + Signature Algorithm: sha1WithRSAEncryption + 32:42:4b:36:44:a5:6c:fb:70:d8:08:2b:cb:16:34:15:db:39: + 60:7b:7e:b4:4a:bc:fb:e5:16:04:97:0d:eb:f5:68:95:da:2f: + 23:57:4c:c9:29:2b:d1:1b:1b:9f:bd:f4:79:75:df:62:7f:63: + b4:84:7a:95:5c:c4:ee:f3:77:16:e4:0b:8a:5e:c9:64:bd:7c: + 04:50:ac:ff:9a:41:6b:b1:6a:9f:cd:45:10:72:83:10:8a:26: + 1d:7f:6c:84:34:5a:41:79:72:91:ee:87:5d:1d:3a:55:ff:91: + 7e:52:85:ff:42:41:eb:76:56:23:e5:bc:bc:79:b1:aa:4e:4c: + bf:7b:df:63:8b:1a:3c:4b:01:72:89:35:bb:0d:92:97:16:6e: + ae:50:cb:89:ee:c6:7a:d0:d3:32:22:0f:19:33:1e:ee:ff:41: + a5:a1:25:c5:4c:ce:8f:98:4c:b5:2c:1f:ec:cc:f1:21:e2:3a: + ff:7d:6a:87:fe:89:fd:2c:20:3e:fb:9b:b8:c0:f9:09:99:ce: + 45:63:82:09:1c:bb:79:d8:a8:40:21:46:c7:ae:3e:dd:89:9d: + 56:46:4a:f4:ed:7d:5b:a6:1e:a6:1b:26:f9:ec:26:b4:51:3a: + 87:b6:50:13:84:33:22:1a:8a:20:c5:44:64:b8:bb:de:32:ec: + 6b:58:db:17 -----BEGIN CERTIFICATE----- -MIIDyDCCArCgAwIBAgIJAOG0pVw936YVMA0GCSqGSIb3DQEBCwUAMGMxCzAJBgNV -BAYTAlNFMRIwEAYDVQQIDAlTdG9ja2hvbG0xEjAQBgNVBAcMCVN0b2NraG9sbTEP -MA0GA1UECgwGT3JhY2xlMQ4wDAYDVQQLDAVNeVNRTDELMAkGA1UEAwwCQ0EwHhcN -MTQxMjA1MDQ0OTIzWhcNMjkxMjAxMDQ0OTIzWjBnMQswCQYDVQQGEwJTRTESMBAG -A1UECAwJU3RvY2tob2xtMRIwEAYDVQQHDAlTdG9ja2hvbG0xDzANBgNVBAoMBk9y -YWNsZTEOMAwGA1UECwwFTXlTUUwxDzANBgNVBAMMBkNsaWVudDCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAMjRof6kjPMbF3EbdDUR4A5sQAr7wPfw67vJ -HaHH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MTQ1NTE2WjBWMQswCQYDVQQGEwJGSTERMA8GA1UECAwISGVsc2lua2kxETAPBgNV +BAcMCEhlbHNpbmtpMRAwDgYDVQQKDAdNYXJpYURCMQ8wDQYDVQQDDAZjbGllbnQw +gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM6gPTyku0+hT5ENBaxbihV/16oM +o6efsscmnWUosYTToO+esUUPM9+YbnH/K2acnMElEydCtiBG5+dHoYhHwp7iRSWZ +n/koGpoTZ10+s7j+QCWsJklGLANDg2fYD0GuLvTYcWA8jueR0LssyhLacRp74/qM +j8O7YlWJs7+FRQFhAgMBAAGjezB5MAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8W +HU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBRac3SOFCnD ++7QZD5ePqm/h4aj3WzAfBgNVHSMEGDAWgBTHLAGVGvU+zQSmJDU1BNmnFgEqeTAN +BgkqhkiG9w0BAQUFAAOCAQEAMkJLNkSlbPtw2AgryxY0Fds5YHt+tEq8++UWBJcN +6/VoldovI1dMySkr0Rsbn730eXXfYn9jtIR6lVzE7vN3FuQLil7JZL18BFCs/5pB +a7Fqn81FEHKDEIomHX9shDRaQXlyke6HXR06Vf+RflKF/0JB63ZWI+W8vHmxqk5M +v3vfY4saPEsBcok1uw2SlxZurlDLie7GetDTMiIPGTMe7v9BpaElxUzOj5hMtSwf +7MzxIeI6/31qh/6J/SwgPvubuMD5CZnORWOCCRy7edioQCFGx64+3YmdVkZK9O19 +W6Yephsm+ewmtFE6h7ZQE4QzIhqKIMVEZLi73jLsa1jbFw== -----END CERTIFICATE----- diff --git a/mysql-test/std_data/client-key.pem b/mysql-test/std_data/client-key.pem index e0aae4f2c4a..5037c6e2728 100644 --- a/mysql-test/std_data/client-key.pem +++ b/mysql-test/std_data/client-key.pem @@ -1,27 +1,15 @@ -----BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAyNGh/qSM8xsXcRt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o+xEK69oe9uOQ7WgbiqCMH3N +iMaP36p+KIkHAUHMGwIP+QIODewzpSsqQgbtRcIElFX5X3tE+XBAYoRz5wJAKH3/ +CwRg7ynfBDbvqjz9EsIDWWisG2SXvpwLyThau8fvU1GfT3Tgm2Ks4zWPpl6J6mo1 +cGssGwl2CJbp4+glQQJBAJAwvKufpB+M6OjvKh89GGsCEaV1ENJ41FPcQwJ2pjed +Fcq28ZP59v7bfBH2IkNu3pfEzmvQnmRlTEtXGjNn+i8= -----END RSA PRIVATE KEY----- diff --git a/mysql-test/std_data/mysql_upgrade/event.MYD b/mysql-test/std_data/mysql_upgrade/event.MYD new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/mysql-test/std_data/mysql_upgrade/event.MYD diff --git a/mysql-test/std_data/mysql_upgrade/event.MYI b/mysql-test/std_data/mysql_upgrade/event.MYI Binary files differnew file mode 100644 index 00000000000..d5c16c3892f --- /dev/null +++ b/mysql-test/std_data/mysql_upgrade/event.MYI diff --git a/mysql-test/std_data/mysql_upgrade/event.frm b/mysql-test/std_data/mysql_upgrade/event.frm Binary files differnew file mode 100644 index 00000000000..fd4ff199b56 --- /dev/null +++ b/mysql-test/std_data/mysql_upgrade/event.frm diff --git a/mysql-test/std_data/mysql_upgrade/v1.frm b/mysql-test/std_data/mysql_upgrade/v1.frm new file mode 100644 index 00000000000..be197fd76a8 --- /dev/null +++ b/mysql-test/std_data/mysql_upgrade/v1.frm @@ -0,0 +1,15 @@ +TYPE=VIEW +query=select `test`.`t1`.`a` AS `a` from `test`.`t1` +md5=5e6eaf216e7b016fcedfd4e1113517af +updatable=0 +algorithm=1 +definer_user=root +definer_host=localhost +suid=2 +with_check_option=0 +timestamp=2014-12-11 15:26:20 +create-version=1 +source=select a from t1 +client_cs_name=utf8 +connection_cl_name=utf8_general_ci +view_body_utf8=select `test`.`t1`.`a` AS `a` from `test`.`t1` diff --git a/mysql-test/std_data/mysql_upgrade/v1badcheck.frm b/mysql-test/std_data/mysql_upgrade/v1badcheck.frm new file mode 100644 index 00000000000..a1e3bfe5cbc --- /dev/null +++ b/mysql-test/std_data/mysql_upgrade/v1badcheck.frm @@ -0,0 +1,15 @@ +TYPE=VIEW +query=select `test`.`t1`.`a` AS `a` from `test`.`t1` +md5=00000000000000000000000000000000 +updatable=0 +algorithm=1 +definer_user=root +definer_host=localhost +suid=2 +with_check_option=0 +timestamp=2014-12-11 15:26:20 +create-version=1 +source=select a from t1 +client_cs_name=utf8 +connection_cl_name=utf8_general_ci +view_body_utf8=select `test`.`t1`.`a` AS `a` from `test`.`t1` diff --git a/mysql-test/std_data/mysql_upgrade/v2.frm b/mysql-test/std_data/mysql_upgrade/v2.frm new file mode 100644 index 00000000000..42cc06d9fba --- /dev/null +++ b/mysql-test/std_data/mysql_upgrade/v2.frm @@ -0,0 +1,15 @@ +TYPE=VIEW +query=select `test`.`t1`.`a` AS `a` from `test`.`t1` +md5=5e6eaf216e7b016fcedfd4e1113517af +updatable=1 +algorithm=2 +definer_user=root +definer_host=localhost +suid=2 +with_check_option=0 +timestamp=2014-12-11 15:26:29 +create-version=1 +source=select a from t1 +client_cs_name=utf8 +connection_cl_name=utf8_general_ci +view_body_utf8=select `test`.`t1`.`a` AS `a` from `test`.`t1` diff --git a/mysql-test/std_data/mysql_upgrade/v3.frm b/mysql-test/std_data/mysql_upgrade/v3.frm new file mode 100644 index 00000000000..cca46ae9170 --- /dev/null +++ b/mysql-test/std_data/mysql_upgrade/v3.frm @@ -0,0 +1,15 @@ +TYPE=VIEW +query=select `test`.`t1`.`a` AS `a` from `test`.`t1` +md5=5e6eaf216e7b016fcedfd4e1113517af +updatable=0 +algorithm=0 +definer_user=root +definer_host=localhost +suid=2 +with_check_option=0 +timestamp=2014-12-11 15:26:20 +create-version=1 +source=select a from t1 +client_cs_name=utf8 +connection_cl_name=utf8_general_ci +view_body_utf8=select `test`.`t1`.`a` AS `a` from `test`.`t1` diff --git a/mysql-test/std_data/mysql_upgrade/v4.frm b/mysql-test/std_data/mysql_upgrade/v4.frm new file mode 100644 index 00000000000..9d0cc48447d --- /dev/null +++ b/mysql-test/std_data/mysql_upgrade/v4.frm @@ -0,0 +1,16 @@ +TYPE=VIEW +query=select `test`.`t1`.`a` AS `a` from `test`.`t1` +md5=5e6eaf216e7b016fcedfd4e1113517a0 +updatable=1 +algorithm=0 +definer_user=root +definer_host=localhost +suid=2 +with_check_option=0 +timestamp=2015-02-08 19:21:14 +create-version=1 +source=select a from t1 +client_cs_name=latin1 +connection_cl_name=latin1_swedish_ci +view_body_utf8=select `test`.`t1`.`a` AS `a` from `test`.`t1` +mariadb-version=50542 diff --git a/mysql-test/std_data/server-cert.pem b/mysql-test/std_data/server-cert.pem index f6acc62ff5f..1cc1519ada9 100644 --- a/mysql-test/std_data/server-cert.pem +++ b/mysql-test/std_data/server-cert.pem @@ -1,35 +1,26 @@ Certificate: Data: Version: 3 (0x2) - Serial Number: 16263805969935345172 (0xe1b4a55c3ddfa614) - Signature Algorithm: sha256WithRSAEncryption - Issuer: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=CA + Serial Number: 1 (0x1) + Signature Algorithm: sha1WithRSAEncryption + Issuer: CN=cacert, C=FI, ST=Helsinki, L=Helsinki, O=MariaDB Validity - Not Before: Dec 5 04:48:40 2014 GMT - Not After : Dec 1 04:48:40 2029 GMT - Subject: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=localhost + Not Before: Apr 25 14:55:05 2015 GMT + Not After : Apr 20 14:55:05 2035 GMT + Subject: C=FI, ST=state or province within country, in other certificates in this file it is the same as L, L=location, usually an address but often ambiguously used, O=organization name, typically a company name, OU=organizational unit name, a division name within an organization, CN=localhost Subject Public Key Info: Public Key Algorithm: rsaEncryption - Public-Key: (2048 bit) + Public-Key: (1024 bit) Modulus: - 00:e9:20:e7:05:51:07:3a:48:b9:e2:62:a2:24:45: - 1f:f1:54:34:22:5c:62:86:9b:01:e8:c2:45:90:00: - 8d:4e:e4:a2:ea:e9:d7:b5:95:25:ce:18:ac:1a:4f: - b3:e6:30:46:af:20:13:40:84:df:21:dc:df:09:e5: - a0:7f:81:12:6e:1e:84:58:5c:a1:11:db:aa:b6:04: - e0:fc:1e:0c:11:2e:f3:30:62:1a:f9:ee:df:fe:a3: - d3:d6:83:6e:ad:e8:8d:98:89:b1:69:63:b8:72:f4: - 5a:e6:22:5e:73:64:95:ef:56:92:92:0b:e1:93:a5: - d7:4c:41:47:e7:31:ed:09:68:b3:c5:6e:c1:1b:01: - 39:bb:f1:8f:bf:ba:f4:02:e2:e5:e5:9e:b7:d6:9a: - b2:94:76:9b:48:d8:27:18:0e:9f:30:98:f5:9a:3e: - 23:e6:3b:4a:48:ee:a5:26:e8:80:94:37:e4:4a:ba: - ff:9f:42:b9:32:dd:7a:9d:63:11:a8:25:99:b1:1f: - 86:e5:7c:b1:31:e3:12:11:0c:eb:f6:1d:02:4b:1d: - 34:cb:74:1d:7f:2f:40:c0:81:e2:04:d4:8e:ea:96: - f8:22:35:8e:ab:b6:99:33:36:ef:b5:83:11:88:6d: - 06:0f:76:4d:bf:db:a8:df:6c:3c:91:e2:ba:73:a0: - 73:45 + 00:aa:e6:54:bd:dd:52:1e:16:f7:24:52:37:58:2b: + a7:af:49:e1:cd:75:2a:18:52:e1:48:f0:59:82:c0: + 7a:d9:66:b3:97:04:b3:77:f4:39:fd:d1:c0:1a:c5: + a6:ab:44:84:d2:17:39:53:25:63:9b:c3:24:78:51: + 5c:77:6b:df:b4:82:1d:e4:43:f4:67:0a:5d:89:a2: + fe:b0:ea:64:3a:1d:9d:49:78:c8:7f:79:a5:cd:45: + 4b:0c:ad:ae:4f:e2:d4:5d:ec:e8:73:06:ed:98:92: + 85:49:b2:9c:31:3b:44:38:5f:bb:5a:f1:68:84:a9: + c3:5b:31:39:d4:47:98:38:55 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: @@ -37,46 +28,47 @@ Certificate: Netscape Comment: OpenSSL Generated Certificate X509v3 Subject Key Identifier: - E4:31:D8:D5:06:EA:C6:B3:A2:F6:01:39:8F:58:08:36:2C:7B:3F:DB + E5:72:8F:57:72:D6:75:63:28:7F:E2:BF:00:B7:1D:B8:AA:FE:94:59 X509v3 Authority Key Identifier: - keyid:94:65:A1:A3:87:CF:BF:C1:74:BB:D8:84:97:B6:6B:EE:B2:90:73:B2 + keyid:C7:2C:01:95:1A:F5:3E:CD:04:A6:24:35:35:04:D9:A7:16:01:2A:79 - Signature Algorithm: sha256WithRSAEncryption - 46:ef:cd:bf:c1:ef:36:a9:cb:99:b5:be:e2:a7:ba:69:0d:f5: - 9b:63:39:78:32:35:01:a8:b9:f1:70:0e:b5:d1:8f:94:2e:7a: - cb:65:d4:d0:b4:ad:52:b8:51:5f:64:2e:a8:08:a5:71:fe:c2: - 35:8a:0d:28:26:e5:be:ca:d7:f4:79:54:e1:27:8f:87:92:d3: - 04:72:1b:cc:c4:7f:8b:26:09:92:2d:c8:6f:27:da:97:31:80: - 0f:83:84:9c:e0:a4:88:c9:e3:8f:35:e7:de:bd:31:e2:fa:52: - 83:de:ee:5c:60:6e:8f:a5:8d:5e:53:41:18:42:f3:03:0b:05: - 0b:59:09:42:2e:1b:0b:29:b3:fe:11:3b:d5:ad:3f:4d:24:e8: - c0:da:4c:0d:93:94:ec:cd:18:0f:66:cd:03:d3:ee:a0:b2:7f: - 64:d7:39:66:19:72:9f:64:43:38:b4:b6:b3:ea:6f:39:e7:09: - 98:90:9f:6c:f5:e8:b3:2e:09:8d:7b:76:65:30:f4:c4:9b:8e: - 10:4e:9b:8c:93:63:44:9d:2b:8a:f3:f0:cf:f8:7b:65:95:38: - fb:b4:92:e8:6c:11:03:a2:a2:2f:ea:e0:22:b7:cd:cf:0d:a5: - 91:23:14:47:0c:34:8f:f1:11:cc:e8:1e:37:53:ec:a1:01:81: - 20:c0:2c:f5 + Signature Algorithm: sha1WithRSAEncryption + 88:44:46:fa:7d:16:ae:9d:16:5b:95:26:03:3c:71:f4:29:3d: + df:cb:f4:14:20:9f:87:24:b4:29:17:2d:7a:12:48:76:ac:00: + 44:26:ba:93:83:ad:58:7e:b7:77:e4:b0:32:0d:e5:dd:fb:cc: + 0e:9b:88:e0:24:82:e4:41:43:47:5a:4e:d3:b4:5b:47:4b:57: + eb:67:02:63:bb:dd:05:12:f5:95:01:0b:89:81:ca:c2:91:14: + 21:9a:9e:c9:84:91:46:35:0e:26:44:1e:91:88:74:4f:fe:d3: + 19:9e:65:fa:46:e2:46:04:ad:91:79:4c:70:1b:68:b2:49:e9: + 6c:f4:58:44:3b:43:15:85:56:64:1b:84:74:49:95:9f:cd:93: + 9d:8e:69:ab:ca:46:97:b6:74:e9:2a:83:85:62:cd:e5:be:c3: + 52:bd:cf:90:cc:60:27:76:ee:1b:3c:da:69:73:e2:11:68:14: + dc:7d:9f:b8:6f:20:a2:0c:b7:8e:33:40:89:d1:a3:89:e2:60: + 6a:ec:b5:9f:e8:c5:55:10:40:b2:95:5e:54:8a:10:8e:d5:90: + d9:98:86:d8:f9:b6:01:41:8c:d7:0d:0e:86:0e:50:6d:a2:64: + 00:2a:91:5e:35:64:15:e3:86:34:3a:39:eb:0f:4f:56:c7:15: + 4c:74:2e:91 -----BEGIN CERTIFICATE----- -MIIDyzCCArOgAwIBAgIJAOG0pVw936YUMA0GCSqGSIb3DQEBCwUAMGMxCzAJBgNV -BAYTAlNFMRIwEAYDVQQIDAlTdG9ja2hvbG0xEjAQBgNVBAcMCVN0b2NraG9sbTEP -MA0GA1UECgwGT3JhY2xlMQ4wDAYDVQQLDAVNeVNRTDELMAkGA1UEAwwCQ0EwHhcN -MTQxMjA1MDQ0ODQwWhcNMjkxMjAxMDQ0ODQwWjBqMQswCQYDVQQGEwJTRTESMBAG -A1UECAwJU3RvY2tob2xtMRIwEAYDVQQHDAlTdG9ja2hvbG0xDzANBgNVBAoMBk9y -YWNsZTEOMAwGA1UECwwFTXlTUUwxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJ -KoZIhvcN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TGZ5l+kbiRgStkXlMcBto +sknpbPRYRDtDFYVWZBuEdEmVn82TnY5pq8pGl7Z06SqDhWLN5b7DUr3PkMxgJ3bu +GzzaaXPiEWgU3H2fuG8gogy3jjNAidGjieJgauy1n+jFVRBAspVeVIoQjtWQ2ZiG +2Pm2AUGM1w0Ohg5QbaJkACqRXjVkFeOGNDo56w9PVscVTHQukQ== -----END CERTIFICATE----- diff --git a/mysql-test/std_data/server-key.pem b/mysql-test/std_data/server-key.pem index 89aead41877..3125ae88a8a 100644 --- a/mysql-test/std_data/server-key.pem +++ b/mysql-test/std_data/server-key.pem @@ -1,27 +1,15 @@ -----BEGIN RSA PRIVATE KEY----- -MIIEpQIBAAKCAQEA6SDnBVEHOki54mKiJEUf8VQ0IlxihpsB6MJFkACNTuSi6unX -tZUlzhisGk+z5jBGryATQITfIdzfCeWgf4ESbh6EWFyhEduqtgTg/B4MES7zMGIa -+e7f/qPT1oNureiNmImxaWO4cvRa5iJec2SV71aSkgvhk6XXTEFH5zHtCWizxW7B -GwE5u/GPv7r0AuLl5Z631pqylHabSNgnGA6fMJj1mj4j5jtKSO6lJuiAlDfkSrr/ -n0K5Mt16nWMRqCWZsR+G5XyxMeMSEQzr9h0CSx00y3Qdfy9AwIHiBNSO6pb4IjWO -q7aZMzbvtYMRiG0GD3ZNv9uo32w8keK6c6BzRQIDAQABAoIBAQDUbdzVJV6Wp4pq -VUI2Fp7iwr22ycQlr71voQbODxK0XvZtZKPgnIWUZTr9xr7A9CCUl3+zfN/t9Vtv -o0Q6qxxmJ3ylH9LNeQL3VT7FvYN1bPjAj8TRFfAaEqKHh8AkzBGqe12kEPAUH8Fs -jsjOEUvmiVaJqjXk2mty2tFwRDggJwCrN5bXkhkzwhDcMfH2Wgc4c4XkyUrciJQU -ua4d0L354B3UmRYtrzwPr6WHLXCGPGhyWvXYpDjjdUGMVf2YcBSQdABF+mhCEb2b -NP4dYUqKHjKn6p4B1/qfJtf0c9Lz229nz0WTzanmpXaNxQVce0sT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VJspwxO0Q4X7ta8WiEqcNbMTnUR5g4VQIDAQAB +AoGAblQWXyBzdBN1Z5BgRF6ieYpj6OT70QoogJMR5lRmutUPma4iQo17pr3znBT/ +nU+1w3/UtTXNEXCwqbA01q/gkbP2PaW/sbHLVow1B7u/o42WW6I3Btnl3ClnCNjD +Mo7/Gj027hhp7mC61r81JeJVh8fJUgxdNqoH7AkDnA+FJAECQQDjIl3k6W2P+bHb +bp+8eyY7ITQbppZh+3hFJKRL7DZKFYL5J6gejiBURnG9DKnhoSP2nqzqdrRhWZhB +ZHr+ciEBAkEAwJ5rMpFoIwRzgPD4Q4iSqHcBbFcJE7dK1XLq6MYUVNQGfDU8pBvI +EocXphpsJ8CbR35dGDY19rmO2LjG3RBDVQJAetRN9Inrjw2YCjNzvKjYTuew1zcq +YghszO94zfoKjdu+PWEdwJBZmVmTDoo3oGXVHfxHRHA3MeISvWJKRSmRAQJAHL9H +9msXJKrEZkkQdFvMr5HbR4UR2LxxUbvt7UGqxSJDuYPkggWXbZR15hdpbuFjC1+D +m1pz4Ve+RwAExfdoZQJBANfmuWtlLU+SMpDG4zOyC7u4dz+TtnEOfDUECFNZtqvU +MWz98MIXAjiBDYU1Z0BrA7b0/FVsPR3t6JZFQWWI2y8= -----END RSA PRIVATE KEY----- diff --git a/mysql-test/std_data/server8k-cert.pem b/mysql-test/std_data/server8k-cert.pem index dfae47b05d2..7e41195cea4 100644 --- a/mysql-test/std_data/server8k-cert.pem +++ b/mysql-test/std_data/server8k-cert.pem @@ -1,86 +1,86 @@ Certificate: Data: Version: 3 (0x2) - Serial Number: 10754692786786449447 (0x9540581bd8dcb827) - Signature Algorithm: sha256WithRSAEncryption - Issuer: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=CA + Serial Number: 2 (0x2) + Signature Algorithm: sha1WithRSAEncryption + Issuer: CN=cacert, C=FI, ST=Helsinki, L=Helsinki, O=MariaDB Validity - Not Before: Dec 5 04:50:48 2014 GMT - Not After : Dec 1 04:50:48 2029 GMT - Subject: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=Server + Not Before: Apr 25 14:55:16 2015 GMT + Not After : Apr 20 14:55:16 2035 GMT + Subject: C=FI, ST=Helsinki, L=Helsinki, O=MariaDB, CN=server8k Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (8192 bit) Modulus: - 00:d8:8f:9d:66:66:9c:12:ca:0a:ad:9e:9f:05:66: - 6c:6c:8a:db:19:9f:a2:d0:fa:38:dc:de:c5:a6:94: - 60:0d:4b:72:c9:85:e2:ff:27:c8:d4:ce:b1:29:66: - 31:e7:2b:4e:08:b3:a2:71:cf:1e:36:7c:8e:4d:08: - 6e:fd:7a:ea:c1:0d:5c:97:09:66:fa:ed:0b:36:64: - 8f:cc:39:35:a9:43:6c:a9:17:48:0f:2e:0a:4b:d3: - 94:bb:b0:5b:43:f1:4e:f7:e5:30:e1:ae:a2:a8:5d: - 3c:db:39:df:d6:4b:70:a6:c9:68:c3:f3:9d:19:d7: - 2f:2a:38:31:11:ab:f1:60:66:c3:38:4f:d9:6f:b5: - 49:df:ce:14:b5:fa:c8:95:04:50:69:90:9d:26:c2: - e9:07:69:7b:a2:d8:91:e7:cd:de:c4:ed:9c:e4:c8: - 8c:e3:a0:cd:dd:2b:37:21:8f:ee:54:38:91:2b:2b: - 01:86:90:f0:2e:9a:06:8a:e1:f2:a2:3f:d1:d4:21: - 9f:b0:81:eb:d0:e9:d3:e9:a9:28:6e:c2:06:4b:94: - 6e:96:70:f5:31:33:dd:97:2f:cc:5d:80:c5:74:ce: - c0:3d:b2:6a:81:b7:ce:65:4f:6a:49:3e:c9:5d:00: - 3c:06:4a:57:c9:a7:f9:bb:46:50:df:64:dc:13:1f: - 22:ad:21:0b:aa:4b:5d:94:60:9f:20:ff:28:aa:56: - 5f:f6:cd:23:34:fe:44:a2:d6:80:bd:a9:67:00:d6: - a1:82:82:9f:c9:e8:0c:97:26:1e:a9:b1:e2:ee:01: - ef:9d:c6:82:fc:72:33:02:40:35:cc:ae:51:23:f4: - f8:92:29:d3:2f:5c:1f:03:c6:81:7d:fb:4f:e9:de: - ed:68:3c:a1:be:7c:fa:11:96:2b:5a:10:c5:c5:cb: - 2e:7a:54:4c:7b:12:b8:07:01:d9:b5:38:0f:a6:43: - 70:28:81:8d:d7:95:ad:d6:e8:88:b4:19:62:05:7b: - 75:c0:2d:24:72:1c:4d:04:a3:f7:1d:6b:8b:fa:16: - a3:5a:6c:51:ba:5c:62:fa:3e:82:7f:4e:10:db:d0: - 52:d4:81:df:0e:5b:33:7e:20:77:1d:51:ca:4e:13: - ee:cd:72:36:28:b4:31:88:3d:61:0f:1a:80:19:f6: - 7d:71:5d:21:1f:dd:0b:d9:73:88:a9:72:4b:8d:a3: - d6:f1:4f:5d:01:6e:9e:c2:28:97:80:de:5b:2d:ac: - a3:c9:24:db:e9:0f:2b:36:ee:a7:f2:94:c1:41:7a: - 70:9f:fd:d0:31:a9:de:55:38:65:89:20:f4:02:f1: - 83:73:40:77:db:35:d2:66:ff:26:5f:f4:d2:e6:f9: - ba:fc:6a:66:b1:02:24:04:a3:32:4b:21:85:83:b4: - 6a:97:3c:25:7f:65:cc:a6:dd:cc:ac:e5:22:09:58: - dc:a1:0d:7d:b4:ac:98:98:81:1d:a7:83:d4:3a:e4: - 39:a7:04:6a:b6:b7:5d:a8:fe:0e:47:08:1d:95:61: - eb:a8:97:53:91:1e:ca:1f:3f:19:5a:01:73:da:33: - 32:d7:33:ca:39:1e:00:37:6b:f8:18:47:30:3a:2e: - 99:39:d0:d0:49:6d:87:c1:98:59:d0:21:ca:12:6d: - 89:33:0f:f2:52:6e:d6:c5:78:dd:15:b6:11:d6:5e: - 72:e8:c7:12:00:c3:8d:57:34:e5:d8:6d:a2:e8:47: - 79:83:8c:49:17:3b:75:24:0d:de:e1:3b:dd:bc:b7: - df:89:a6:31:e6:49:37:80:f8:8f:86:e3:42:f4:2e: - dc:de:58:45:c4:41:a9:2d:a6:5d:f0:7d:81:3d:54: - f4:8a:a3:5f:18:7c:02:c9:7f:1c:f5:9f:dd:0a:29: - 49:40:92:24:b3:b7:65:37:91:9a:a8:00:c4:4e:7f: - 7e:f7:97:de:24:2a:d7:3b:f2:a2:63:ec:38:b7:1f: - 9e:b5:72:99:bd:b1:c0:41:6a:57:97:e2:fb:11:32: - ba:a3:5d:82:48:c5:0a:cc:2c:f5:21:7a:f1:99:56: - 1b:54:9d:c7:64:50:62:80:94:50:5a:40:32:61:f3: - 2c:f8:09:dc:f0:6d:2b:60:29:c2:86:70:5a:57:12: - 7d:09:73:ca:41:6d:22:61:18:1a:48:cb:80:95:be: - 08:e8:15:99:de:36:3a:bf:09:67:35:e8:53:d9:40: - 1b:27:e5:14:32:09:73:e0:f6:a9:19:ee:81:90:dc: - b7:9d:b6:91:51:33:1e:1f:22:e0:bd:df:a8:d1:33: - a7:ab:9b:9c:27:7a:3c:ef:aa:9e:4d:f8:a8:97:63: - 24:20:c8:36:ab:05:8a:c0:80:9b:64:0c:1f:ec:4f: - de:ec:f0:9c:9c:54:db:02:ab:12:aa:ab:58:a3:49: - 25:bf:6a:0a:04:7f:2f:1d:41:11:23:4e:e2:83:51: - e3:f5:12:95:22:72:13:f4:be:6f:e2:00:29:4f:fe: - 9b:ae:b9:e2:7d:72:d3:1b:e8:12:3b:6d:b6:d2:62: - a4:91:31:46:e7:16:7f:9d:8d:74:5e:97:51:d1:cb: - 82:57:bb:bd:46:e4:9c:c5:bd:08:8b:68:20:f8:5e: - d6:aa:ed:6e:4d:ba:a4:29:fd:ac:5c:2f:25:14:d3: - 19:63:0c:01:75:6c:87:a5:0b:29:09:7f:13:7f:00: - d4:63:72:e2:a0:39:88:80:68:2c:3f:49:b1:9b:94: - 77:63:08:05:55 + 00:e6:24:79:3d:3a:58:6a:12:1c:13:6a:43:d9:c1: + 65:ec:55:c1:4f:7d:fc:f2:a6:56:a5:ab:c5:48:2c: + ce:9c:9d:47:3d:94:93:d5:3b:a3:d0:09:a8:8f:e0: + 4b:36:a0:95:ae:2d:ad:7f:a2:a3:c5:f6:87:80:4c: + 6a:26:15:47:73:20:47:e1:f8:5f:49:b7:13:20:f7: + 32:9f:db:7d:62:41:1b:60:26:7b:41:26:16:0c:92: + 22:ef:b4:2e:b3:db:90:e9:09:ca:fe:1a:1b:e4:f3: + 78:69:7d:ca:6e:c5:39:4b:46:72:09:51:08:40:78: + 8e:04:2a:23:cb:d5:50:cf:96:dd:56:43:10:1b:d2: + 71:28:8f:10:a9:e4:44:1c:39:8a:06:a7:fa:37:48: + bd:5a:dd:37:7f:7a:00:cf:84:8a:48:a3:75:a5:67: + fb:7b:47:2d:26:00:2e:65:ed:63:4e:b7:94:18:3f: + 5a:08:74:54:e5:af:dd:86:1b:34:9b:4c:de:fe:d8: + 69:3d:72:90:c7:5c:83:82:78:ea:ab:06:d4:f1:06: + 20:ad:fd:24:bb:e9:94:e0:c6:32:f5:df:af:b4:14: + 4d:9c:ce:0d:62:3a:3a:2b:11:f9:9e:d7:8e:63:2b: + 57:35:10:7e:d5:44:64:8c:61:9b:4e:f8:e8:a5:fb: + 47:bb:85:33:ea:c6:e0:3d:e2:2c:e8:41:e1:15:e2: + a7:45:23:df:d0:f9:93:01:97:89:95:77:4d:d5:d4: + c1:db:61:ca:e2:84:36:9c:01:9b:33:ec:53:83:2f: + dd:d7:d8:20:c0:6b:4a:73:92:d2:6c:22:a6:a2:68: + 46:8b:aa:3f:aa:fe:47:b7:98:70:fd:ba:59:88:af: + 9f:0d:d7:cb:a0:42:44:f9:f0:54:39:c1:cd:fb:b4: + e4:c6:d6:7e:1d:f5:ed:b9:1a:0f:d7:e6:a2:ab:a2: + 25:1f:6c:f9:ab:9c:d8:a3:b9:da:32:72:51:6d:61: + f1:3b:7d:06:2b:3d:43:d5:52:1f:cb:62:14:53:69: + 4d:91:12:22:f0:55:f9:fc:4f:de:ee:e3:fc:fd:40: + 57:50:eb:0e:7a:45:cc:52:0f:24:6f:45:02:72:6b: + 6d:90:94:1c:d4:fb:34:f6:4b:4d:25:17:6f:df:4a: + 64:f8:ad:1e:6e:df:ad:6c:b3:1d:1a:e6:0e:59:7b: + f8:a7:13:77:78:85:bf:3f:7c:12:d4:8e:34:ff:01: + 90:03:42:85:60:e4:99:d6:19:32:46:41:e8:50:ca: + 2a:03:61:cd:c5:68:f4:92:0f:6e:48:89:41:9e:53: + bc:41:62:ed:4a:92:64:b5:cb:3d:55:6c:d9:87:87: + 9a:ab:fc:22:50:66:92:2b:b9:d7:9e:3b:ed:80:e3: + fa:19:69:38:87:b6:25:3a:db:b5:d0:f2:80:4d:af: + 6d:7d:92:90:de:aa:df:be:80:26:1c:69:ee:7a:e3: + 45:c9:a4:4e:6a:e0:56:5f:1f:61:44:3f:62:34:c9: + 1e:21:5f:f6:7f:68:c0:6e:bf:d2:35:1e:53:99:e4: + e1:bd:64:a4:49:3c:c3:ce:b6:e8:a9:3d:27:54:ea: + f1:3e:a1:fc:7b:bf:8d:71:60:90:c5:66:24:85:de: + 7d:47:1f:62:83:e2:63:8e:10:5c:14:cd:d0:7e:86: + 44:4d:df:05:10:43:b8:3c:87:64:69:ec:ea:fb:49: + 9a:c6:76:c1:8f:ea:49:98:0a:d3:97:af:64:ef:da: + 5f:a9:57:03:e3:a0:15:d8:68:c5:40:d8:7b:0f:26: + 0d:5f:f0:be:5a:4c:fd:af:9e:bf:2d:31:40:71:25: + de:d0:73:19:2d:ae:a6:cb:7c:f0:b8:a4:a9:5c:50: + 80:41:4e:dc:f7:20:a4:a6:66:65:fb:92:d1:43:2d: + bf:30:b2:0d:db:9b:a3:ac:28:08:c4:81:99:0c:0d: + 45:e9:a9:e5:6c:da:bf:10:bb:a7:3e:5a:5f:b7:93: + 4a:20:15:29:69:74:78:d1:eb:53:a8:88:49:cb:de: + 0c:e2:9b:31:e2:2f:56:95:cf:55:92:a3:8e:a9:ef: + 68:cb:00:11:d4:71:06:4b:e5:89:0c:b6:e7:2b:2f: + 98:65:21:8e:2a:a3:86:73:bb:1b:76:e1:94:02:d8: + a1:51:97:15:60:a2:39:d5:fd:dc:a8:be:30:12:44: + b1:49:0b:94:82:cf:5f:93:61:1c:3c:eb:05:5b:a4: + 17:ee:30:cd:7c:db:3f:ee:79:02:da:14:20:98:fd: + 9a:0a:f1:39:c8:59:5b:4e:a3:ad:f8:04:e6:0b:b6: + 81:7e:41:00:af:f7:37:ec:6e:bc:28:a3:3d:76:b6: + fd:e9:88:c7:1e:78:79:27:62:a2:83:34:15:61:b8: + e4:c3:ac:f5:7f:3e:4e:5f:5f:31:5b:e8:91:1b:80: + 5e:cb:74:b2:e5:a3:8a:d5:5a:89:fa:63:f1:ff:67: + bd:59:d0:70:77:b7:75:b5:34:74:3d:2e:99:46:0b: + 4b:c4:64:2f:93:48:fe:47:92:6a:0b:42:5e:ef:c9: + 06:64:84:60:89:2b:84:1f:31:0d:36:15:4e:6b:cd: + 14:f7:a0:d1:b2:b8:ff:53:f5:aa:b9:ed:63:50:7a: + 6f:62:e7:c7:7f:bc:f5:e2:0c:f8:28:a4:0d:ba:75: + d0:b8:c7:9b:e3:94:62:66:1c:d8:6c:02:2e:a5:a2: + 62:50:fe:cf:31 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: @@ -88,120 +88,61 @@ Certificate: Netscape Comment: OpenSSL Generated Certificate X509v3 Subject Key Identifier: - 3E:96:BB:23:C2:FD:41:11:7F:EB:63:9B:39:5F:58:2D:92:A0:F0:9F + B3:A9:00:04:C7:9C:2B:CD:C0:5F:D1:28:5C:5C:C6:1F:26:F7:17:5A X509v3 Authority Key Identifier: - keyid:60:57:8F:09:CF:83:86:4B:35:32:BF:73:EB:81:4C:DB:36:27:12:8F + keyid:C7:2C:01:95:1A:F5:3E:CD:04:A6:24:35:35:04:D9:A7:16:01:2A:79 - Signature Algorithm: sha256WithRSAEncryption - 19:b8:4d:94:a3:41:1b:78:e8:fa:da:7c:c3:0c:f5:42:6a:2e: - 04:8c:f4:6e:90:e0:d1:55:28:7c:97:85:18:12:c4:ff:d3:ba: - 74:f1:7f:af:b0:ab:4d:64:f4:45:58:6e:b1:2e:06:cc:a7:5b: - cd:25:8f:60:68:14:e1:f9:56:21:40:43:e4:c4:ee:91:72:01: - 7d:86:41:2f:ac:6d:be:c6:1a:2a:ae:dd:13:ca:51:01:37:33: - 7e:b9:1a:9a:28:16:8c:bc:d1:e7:d4:46:55:87:1f:05:93:4c: - b5:75:ff:ed:ca:29:b2:5d:15:05:4c:02:a9:53:3c:d9:11:01: - 04:db:82:ad:01:ad:4e:d4:7d:9e:6a:00:5e:cc:88:83:42:98: - 6e:4b:cd:7c:55:c6:4c:98:39:db:d1:e3:aa:f3:27:83:6a:3c: - 01:ad:c5:ee:ef:01:aa:b7:4d:f7:a1:86:34:9d:61:20:7c:a0: - c0:75:26:24:6f:a3:68:0e:03:4d:cf:f3:bf:d9:40:4f:1a:04: - 4d:9c:5e:62:49:37:5b:78:ee:c5:11:78:ee:e5:87:f7:f4:f1: - 6d:0d:bd:a2:fb:a2:6c:27:91:d4:84:43:03:f5:9b:11:50:ab: - 45:ca:7c:3d:fe:5c:6b:e1:03:20:c8:c9:ac:66:ff:74:6e:0d: - 87:47:75:77:41:ca:5e:e9:77:5f:2b:09:bb:a5:7d:fc:cf:ed: - 75:dd:b0:ee:b8:da:3e:59:d0:e2:7f:38:16:fe:04:c9:99:d1: - 06:84:11:b1:07:8a:4d:59:d6:70:c3:9b:f7:f8:b9:ae:99:86: - b6:31:a4:13:de:7e:23:27:33:96:d1:9b:15:65:98:04:e5:f8: - 73:3c:f3:72:ef:a1:28:06:1d:7e:88:52:c1:f7:eb:2a:e1:f7: - 57:e5:ed:08:e9:ee:f8:95:3d:ec:4c:98:93:e7:e1:ea:a5:02: - 37:c1:66:18:ba:01:78:05:6d:c4:6b:2c:61:ee:bf:a9:e1:4d: - bf:95:31:f5:28:2a:f8:c9:ce:72:a5:c7:a3:38:2c:f6:69:34: - eb:cb:e9:b3:4f:78:de:87:61:8a:34:bd:5a:64:27:f0:42:1a: - 22:e9:2b:ac:97:f1:ed:7a:50:3b:3e:18:ae:b7:d9:20:9b:d6: - 12:3b:18:b1:47:71:39:0a:31:54:9f:fe:f2:90:d7:b8:27:6b: - 49:e5:82:cd:82:99:95:b1:ab:aa:1f:7a:e4:4e:6e:46:91:a7: - 16:b8:09:a3:5b:ec:6f:57:ca:b4:4f:69:e7:f5:f3:b9:03:93: - 08:90:9d:8d:57:82:77:bc:69:f8:e4:46:d9:4d:d1:25:ea:b8: - 60:b0:e2:cd:0c:ff:c2:63:65:20:f4:2c:34:36:34:a3:cf:67: - 6a:01:3e:51:5f:4a:49:26:9d:30:3f:03:05:70:22:b1:e3:46: - d1:ff:23:23:45:08:4b:0e:77:db:91:d9:a2:5c:15:48:49:ee: - 08:48:90:c3:25:44:b7:7b:9f:82:96:7e:8e:91:91:e5:a0:4d: - af:04:b8:72:df:07:a0:4b:02:79:0e:38:05:47:61:c3:9e:b4: - bf:01:00:10:c3:12:44:64:12:7a:bc:e1:c8:41:e5:cb:0d:7c: - 52:32:7f:71:c1:3f:6e:d3:81:d3:12:ec:85:4c:16:72:d2:79: - f8:bf:c0:fe:31:14:47:53:20:87:73:bb:34:8f:60:4a:9e:91: - 35:6e:20:96:da:bd:4b:7e:bd:c7:c4:f9:25:54:40:2c:9d:b0: - 8b:b5:fb:1e:74:59:a5:f7:b9:b7:23:56:3b:eb:2e:0a:eb:f5: - 10:9b:88:5b:49:8e:0f:05:61:7b:e5:a9:a0:24:f2:16:3f:cb: - 5b:06:d6:a5:bb:94:3a:46:2e:43:c5:02:67:b1:7d:5d:b6:c0: - f9:93:2a:d6:18:95:89:73:ff:3b:a1:f3:a6:bd:5b:6a:f0:e0: - 11:e8:95:09:83:5d:69:c3:91:e8:88:ea:b2:7c:32:73:a8:b0: - a4:24:d8:e5:6f:c7:97:8b:3e:c7:1e:69:6a:2a:b7:db:d1:26: - 7b:94:83:27:6d:d2:82:58:dd:a7:c2:74:0d:43:13:e2:c5:96: - 9f:3c:00:40:1a:10:b1:da:62:23:2e:b7:5c:33:61:56:3b:8b: - b4:b9:01:64:71:67:82:7c:18:2c:e8:d9:cf:e7:da:4b:16:7a: - 91:67:af:82:0e:ac:7a:c9:cc:47:9b:84:b9:49:e8:3d:33:a4: - 66:3f:c3:c1:20:ba:d1:0e:1e:11:80:82:78:90:25:a4:bc:80: - a2:25:8a:5c:de:3c:59:52:2f:b3:50:bb:0b:5a:f1:96:8d:d2: - eb:b9:f1:e9:72:a8:ae:f2:15:fd:5a:9c:a3:e8:ca:26:e9:67: - 80:13:38:1f:38:9f:85:8a:82:3c:4f:d3:04:ff:3a:13:f7:b5: - 13:f7:e3:50:1d:d6:e1:e6:1e:d0:b4:c8:5e:21:d7:22:cc:01: - de:db:d1:c4:a2:5c:0b:dc:dc:2f:08:e4:2e:12:c5:4a:bc:a1: - b3:92:32:1e:05:5c:7e:ca:43:6e:2e:06:3f:27:fd:1b:75:f0: - 01:42:8d:ff:aa:f8:f1:47:5b:56:67:74:66:1b:aa:b5:75:41: - 69:ba:91:66:ce:c3:3a:00:7a:93:59:1c:0c:49:c2:d2:d8:8d: - 7a:57:a4:7d:ba:61:26:1e:e9:aa:ab:e6:cb:2c:16:0a + Signature Algorithm: sha1WithRSAEncryption + 01:43:2c:d5:1d:b5:36:05:31:ca:b2:f3:9e:71:ce:62:fe:b2: + e5:e3:2d:30:23:99:51:3d:50:ee:d6:ce:76:e8:43:8d:5d:9d: + 28:9b:43:90:0c:d4:24:54:3c:53:3c:18:92:ec:93:86:87:7a: + d6:7f:5d:3b:56:cd:9d:96:7a:06:c8:16:19:8b:ed:c8:21:cf: + 15:b9:fb:06:7d:cb:5c:46:9c:c5:2e:8e:de:77:21:e5:9d:35: + 95:00:c7:ad:d2:57:36:65:1a:43:6c:ee:75:ad:a2:d8:c0:60: + d5:07:d7:5c:5d:8e:ae:af:4a:e6:fa:6a:13:78:98:b8:11:c7: + dc:d2:a7:dd:29:b5:76:fa:ef:13:62:5f:9a:0d:e2:87:6a:04: + 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jitVaifpj +8f9nvVnQcHe3dbU0dD0umUYLS8RkL5NI/keSagtCXu/JBmSEYIkrhB8xDTYVTmvN +FPeg0bK4/1P1qrntY1B6b2Lnx3+89eIM+CikDbp10LjHm+OUYmYc2GwCLqWiYlD+ +zzECAwEAAaN7MHkwCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBH +ZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFLOpAATHnCvNwF/RKFxcxh8m +9xdaMB8GA1UdIwQYMBaAFMcsAZUa9T7NBKYkNTUE2acWASp5MA0GCSqGSIb3DQEB +BQUAA4IBAQABQyzVHbU2BTHKsvOecc5i/rLl4y0wI5lRPVDu1s526EONXZ0om0OQ +DNQkVDxTPBiS7JOGh3rWf107Vs2dlnoGyBYZi+3IIc8VufsGfctcRpzFLo7edyHl +nTWVAMet0lc2ZRpDbO51raLYwGDVB9dcXY6ur0rm+moTeJi4Ecfc0qfdKbV2+u8T +Yl+aDeKHagQ8X3JE0NB6cMYJK7+SkW30LlPztMUjYdaHwTDv/pJvl3jy6jz/6FQ6 +n0msqStGw3ax+esxo09AWBaQd7Y9b4WVEqnKcAqazWFGJ4TOnjNUj5pBbU0RvRR/ +/zLpBrw2OBFcD+mlWg9cfPr1c1tMR/Ly -----END CERTIFICATE----- diff --git a/mysql-test/std_data/server8k-key.pem b/mysql-test/std_data/server8k-key.pem index 9b3f7ed2aa3..72d2756477c 100644 --- a/mysql-test/std_data/server8k-key.pem +++ b/mysql-test/std_data/server8k-key.pem @@ -1,99 +1,99 @@ -----BEGIN RSA PRIVATE KEY----- -MIISKQIBAAKCBAEA2I+dZmacEsoKrZ6fBWZsbIrbGZ+i0Po43N7FppRgDUtyyYXi -/yfI1M6xKWYx5ytOCLOicc8eNnyOTQhu/XrqwQ1clwlm+u0LNmSPzDk1qUNsqRdI -Dy4KS9OUu7BbQ/FO9+Uw4a6iqF082znf1ktwpslow/OdGdcvKjgxEavxYGbDOE/Z -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ebbzJgxk5EA+np/eZlRU7h4aZjRhtDwi4HsarXzgIni6z1vswAiOSZRCfC17 +8/tjfER9w3pJMRTJ5MFeN7JvNUhWnXY5fX6SBl/Eocwwy8S/eIWUY53aI2k8UZMR +eLUb9I6eL21qZAPp/XD8/3pF5DH0ECOS96C8mDKTGnARUyfkKrlaASSTfe5XToNb +IpDEYtLwpHN0missq+ObqPc5lwot/nBy2fdllksb3mCCK8AxuKEDsVtWbb2maoa9 +lRGxIxr++ZV8n0dAwGCV18CbhBYh/B2YnrexI2ZfYOQbzPjHiuUgSLGBJvIUX+S+ +O8ij0vQBqECfwCq63SrdW340Huob52d/cod9pNolO5edftPNJVJP+44sZtEJoDBW +WgzdpVV9fA8TYsO6B3Dci960fbpWnKZ01uLFWVTkou8IwqcaxJIyMzS3Gmqo4UEF +oxBSrg9rTAMJSnm2YWBHK1Z8DDlLzw3SkNZVKm6Ai4yEcLs1PzGZejsJvsu3zGgq +nM4liRHK2QqY1SJf6PsJGxAI62tlyTRfjxtC3Jq9oJbmJs+jl0gtNKEbkfQc83IL +8wCHOm9G7KK7XJjMCb50Dh80YIDFj5GTQLU1tKdpDBfq6YTKUHqjPA8GRnz8vA== -----END RSA PRIVATE KEY----- diff --git a/mysql-test/suite/binlog/r/temptable_uservar_disconnect-7938.result b/mysql-test/suite/binlog/r/temptable_uservar_disconnect-7938.result new file mode 100644 index 00000000000..f09216cb539 --- /dev/null +++ b/mysql-test/suite/binlog/r/temptable_uservar_disconnect-7938.result @@ -0,0 +1,8 @@ +create table t1 (i int); +create trigger tr after insert on t1 for each row set @b=@a; +create temporary table tmp like t1; +insert into t1 values (1); +select * from t1; +i +1 +drop table t1; diff --git a/mysql-test/suite/binlog/t/temptable_uservar_disconnect-7938.test b/mysql-test/suite/binlog/t/temptable_uservar_disconnect-7938.test new file mode 100644 index 00000000000..a1d91e2f98f --- /dev/null +++ b/mysql-test/suite/binlog/t/temptable_uservar_disconnect-7938.test @@ -0,0 +1,17 @@ +# +# MDEV-7938 MariaDB Crashes Suddenly while writing binlogs +# +--source include/have_log_bin.inc +--source include/have_binlog_format_mixed.inc + +--connect(con1,localhost,root,,) +create table t1 (i int); +create trigger tr after insert on t1 for each row set @b=@a; + +create temporary table tmp like t1; +insert into t1 values (1); +--disconnect con1 + +--connection default +select * from t1; +drop table t1; diff --git a/mysql-test/suite/innodb/r/innodb-mdev-7055.result b/mysql-test/suite/innodb/r/innodb-mdev-7055.result deleted file mode 100644 index d00491fd7e5..00000000000 --- a/mysql-test/suite/innodb/r/innodb-mdev-7055.result +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/mysql-test/suite/innodb/t/innodb-mdev-7055.test b/mysql-test/suite/innodb/t/innodb-mdev-7055.test deleted file mode 100644 index 8f4d647e35d..00000000000 --- a/mysql-test/suite/innodb/t/innodb-mdev-7055.test +++ /dev/null @@ -1,23 +0,0 @@ --- source include/have_innodb.inc - -# MDEV-7055: MySQL#74664 - InnoDB: Failing assertion: len <= col->len -# || col->mtype == 5 || (col->len == 0 && col->mtype == 1) in -# file rem0rec.cc line 845 ---disable_query_log ---disable_warnings ---disable_result_log -set @old_character_set=@@character_set_connection; -set character_set_connection=ucs2; -create TABLE t1 engine=innodb select if(0=0,'Y','N'); -insert INTO t1 values(date_format('2001-01-01','%W')); -select * from t1; -drop table t1; -set @@character_set_connection=@old_character_set; ---enable_result_log ---enable_warnings ---enable_query_log - -#produce something ---echo 1 - - diff --git a/mysql-test/suite/percona/innodb_sys_index.result b/mysql-test/suite/percona/innodb_sys_index.result index 67604236366..1f1bd814886 100644 --- a/mysql-test/suite/percona/innodb_sys_index.result +++ b/mysql-test/suite/percona/innodb_sys_index.result @@ -1,9 +1,6 @@ drop table if exists t1; Warnings: -Note 1051 Unknown table 'test.t1' -select @@version_comment limit 1 ; -@@version_comment -Source distribution +Note 1051 Unknown table 't1' SELECT COUNT(*) FROM `information_schema`.`INNODB_SYS_INDEXES` ; CREATE TABLE test.t1 ( `a` SERIAL NOT NULL , `b` VARCHAR( 255 ) NOT NULL , INDEX ( `b` ) ) ENGINE = InnoDB ; SHOW TABLE STATUS FROM `information_schema` LIKE 'INNODB\_SYS\_INDEXES%' ; diff --git a/mysql-test/suite/percona/innodb_sys_index.test b/mysql-test/suite/percona/innodb_sys_index.test index 212baeda663..d8c22e7f5f9 100644 --- a/mysql-test/suite/percona/innodb_sys_index.test +++ b/mysql-test/suite/percona/innodb_sys_index.test @@ -5,7 +5,6 @@ drop table if exists t1; # # test for bug LP#875797 "Using 'innodb_sys_indexes' causes core dump" # -select @@version_comment limit 1 ; --disable_result_log SELECT COUNT(*) FROM `information_schema`.`INNODB_SYS_INDEXES` ; CREATE TABLE test.t1 ( `a` SERIAL NOT NULL , `b` VARCHAR( 255 ) NOT NULL , INDEX ( `b` ) ) ENGINE = InnoDB ; diff --git a/mysql-test/suite/perfschema/r/digest_table_full.result b/mysql-test/suite/perfschema/r/digest_table_full.result index 9c0efb7b1ca..d910f29c91e 100644 --- a/mysql-test/suite/perfschema/r/digest_table_full.result +++ b/mysql-test/suite/perfschema/r/digest_table_full.result @@ -113,7 +113,7 @@ SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARN SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest; SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS NULL NULL NULL 55 32 1 2 -statements_digest 0e98ee6a98e296530ec59c12dbc08dfe TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0 +statements_digest 8de787d0e3e3a062aea121ff528fcfce TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0 SHOW VARIABLES LIKE "performance_schema_digests_size"; Variable_name Value performance_schema_digests_size 2 diff --git a/mysql-test/suite/perfschema/r/rpl_gtid_func.result b/mysql-test/suite/perfschema/r/rpl_gtid_func.result index 98342bc4869..bfe4e08a3c1 100644 --- a/mysql-test/suite/perfschema/r/rpl_gtid_func.result +++ b/mysql-test/suite/perfschema/r/rpl_gtid_func.result @@ -37,7 +37,7 @@ select digest, digest_text, count_star from performance_schema.events_statements_summary_by_digest where digest_text like "%in_%_digest%"; digest digest_text count_star -e315485f9cbc06befb4e59970905a034 SELECT ? AS in_master_digest 1 +f1cd3e758822a4ef0e1502ec30818476 SELECT ? AS in_master_digest 1 insert into test.marker values (2); **** On Slave **** select * from test.marker; @@ -64,7 +64,7 @@ select digest, digest_text, count_star from performance_schema.events_statements_summary_by_digest where digest_text like "%in_%_digest%"; digest digest_text count_star -bd2f53b41efcd037df41a3dd8bf3312a SELECT ? AS in_slave_digest 1 +c1cef2eb67ca48bb5d81d2e5e68aaf35 SELECT ? AS in_slave_digest 1 **** On Master **** delete from performance_schema.setup_objects where object_schema='master'; diff --git a/mysql-test/suite/perfschema/r/statement_digest.result b/mysql-test/suite/perfschema/r/statement_digest.result index 41cba435cb6..4669a6c25a1 100644 --- a/mysql-test/suite/perfschema/r/statement_digest.result +++ b/mysql-test/suite/perfschema/r/statement_digest.result @@ -112,43 +112,43 @@ DROP TRIGGER trg; SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS, SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest; SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS -statements_digest 0e98ee6a98e296530ec59c12dbc08dfe TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0 -statements_digest 954f43425c3234acc8e194afd97e8a0a SELECT ? FROM t1 1 0 0 0 -statements_digest fc365a54bc19d746bd24c27aba46b990 SELECT ? FROM `t1` 1 0 0 0 -statements_digest 27ba28f6252e4ae0e9b14b36da536fbe SELECT ?, ... FROM t1 2 0 0 0 -statements_digest 81d03922612900032ec4b81934ab4841 SELECT ? FROM t2 1 0 0 0 -statements_digest adce8aec12b6b5046cd4bf55951014c7 SELECT ?, ... FROM t2 2 0 0 0 -statements_digest 59a1bd93c424b10802fe66bb6dcd94d2 INSERT INTO t1 VALUES (?) 1 1 0 0 -statements_digest 91b2da58b0eb49c35a38fbc49f5e491d INSERT INTO t2 VALUES (?) 1 1 0 0 -statements_digest 967114adbf91d8a4a99ec5e49e909ff4 INSERT INTO t3 VALUES (...) 4 4 0 0 -statements_digest 8f25e7a48487e0aa7377e816816bb658 INSERT INTO t4 VALUES (...) 1 1 0 0 -statements_digest 4e51253af793867fba66166de1f314f7 INSERT INTO t5 VALUES (...) 1 1 0 0 -statements_digest fa47b3109e117216cd10209690d28596 INSERT INTO t1 VALUES (?) /* , ... */ 2 7 0 0 -statements_digest 72409f84bc236e6fe9f2f7b4d727f2d3 INSERT INTO t3 VALUES (...) /* , ... */ 1 3 0 0 -statements_digest d40aaddb41ed794d65dd8273f0c75700 INSERT INTO t5 VALUES (...) /* , ... */ 1 3 0 0 -statements_digest 57a82b28388e52e99fc64339dd30edde INSERT INTO t1 VALUES ( NULL ) 1 1 0 0 -statements_digest 6a56b694106442474cb0e5fb7575c8b9 INSERT INTO t6 VALUES (...) 5 5 0 0 -statements_digest c9abf55e296c4317dbaf2d14ef907ad7 SELECT ? + ? 3 0 0 0 -statements_digest 156304a0851a3e3626b39fb3da841a82 SELECT ? 1 0 0 0 +statements_digest 8de787d0e3e3a062aea121ff528fcfce TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0 +statements_digest a871edd1a65606b404c0b6e65c1f142c SELECT ? FROM t1 1 0 0 0 +statements_digest d60830f376a7724280dfc422224bb475 SELECT ? FROM `t1` 1 0 0 0 +statements_digest 09309c60c199a727b7ebed40975e8764 SELECT ?, ... FROM t1 2 0 0 0 +statements_digest dc0dcaefa9a12455ffed04ac6f89e65d SELECT ? FROM t2 1 0 0 0 +statements_digest d274a288509eae2cd7febf2f7fe36274 SELECT ?, ... FROM t2 2 0 0 0 +statements_digest ec913f89e0d8be99014bf78e73228c48 INSERT INTO t1 VALUES (?) 1 1 0 0 +statements_digest b919ecf2d5544bcdf95e76eb22231c42 INSERT INTO t2 VALUES (?) 1 1 0 0 +statements_digest d9030eddb8dca8ee5fcaf79e6f254b41 INSERT INTO t3 VALUES (...) 4 4 0 0 +statements_digest 2ad6d8279781b0fb40bdc8647dc94216 INSERT INTO t4 VALUES (...) 1 1 0 0 +statements_digest 3248c16dc70111225fcffa99641e312b INSERT INTO t5 VALUES (...) 1 1 0 0 +statements_digest 152b6c84a0cbfadcbecde01050eddd66 INSERT INTO t1 VALUES (?) /* , ... */ 2 7 0 0 +statements_digest c4cbce33b636e448c29e041b1d5c0eb1 INSERT INTO t3 VALUES (...) /* , ... */ 1 3 0 0 +statements_digest 0bfac9fb577995b116e52ff4aaeaa5b8 INSERT INTO t5 VALUES (...) /* , ... */ 1 3 0 0 +statements_digest f8d6ea06dfb87f5c40fd427f3f0ff4e7 INSERT INTO t1 VALUES ( NULL ) 1 1 0 0 +statements_digest 819acce11785e12f2f73964115632db6 INSERT INTO t6 VALUES (...) 5 5 0 0 +statements_digest aeb185ab9b6e9d5a49e47c8741b8acdf SELECT ? + ? 3 0 0 0 +statements_digest d3804664eeee11407f3fcbd5c29a1f73 SELECT ? 1 0 0 0 statements_digest 3b085ab0d2063dfca1a39212e3ea1831 CREATE SCHEMA statements_digest_temp 2 2 0 0 statements_digest 09f9fabef2feb9a54ba01455e5ae83b9 DROP SCHEMA statements_digest_temp 2 0 0 0 -statements_digest 7910a63ffd31cbcb742e15270c8958c8 SELECT ? FROM no_such_table 1 0 0 1 -statements_digest fa34540a438bc672478b1162505ee28c CREATE TABLE dup_table ( c CHARACTER (?) ) 2 0 0 1 -statements_digest 2c720f176bb7c8510ff8aca8921b9945 DROP TABLE dup_table 1 0 0 0 -statements_digest 0c7d9fd8c27ab067511da41ca3bcdff3 INSERT INTO t11 VALUES (?) 1 1 1 0 -statements_digest 81681ff345065ed72bcd1e9407ab85e4 SHOW WARNINGS 1 0 0 0 -statements_digest d766f5823ae5d8e4cf4602b8e7a3fb80 PREPARE stmt FROM ? 1 0 0 0 +statements_digest ff0bb1dfc399aa3bef6a0f3fccd3ef94 SELECT ? FROM no_such_table 1 0 0 1 +statements_digest 590a245c84e63eb100e1ef463f477f1a CREATE TABLE dup_table ( c CHARACTER (?) ) 2 0 0 1 +statements_digest 74078b0776d8333e356b271551587d53 DROP TABLE dup_table 1 0 0 0 +statements_digest f23641c5ab7e1dd6e0146f66b3fff5c4 INSERT INTO t11 VALUES (?) 1 1 1 0 +statements_digest d3eda26b379bd56340ce84fe395dfff7 SHOW WARNINGS 1 0 0 0 +statements_digest 6bb42dec3094486d5a9e8b0bf460e382 PREPARE stmt FROM ? 1 0 0 0 statements_digest 3ab1e87eabd9688edf919754cce6348b EXECUTE stmt 2 0 0 0 -statements_digest 470094469d250b9f45cab45bf610efe8 DEALLOCATE PREPARE stmt 1 0 0 0 -statements_digest 1b4d25358e08b35ad54e49dfe5eaf3e4 CREATE PROCEDURE p1 ( ) BEGIN SELECT * FROM t12 ; END 1 0 0 0 +statements_digest f9438ab7b8eec604338c28a04e5d650f DEALLOCATE PREPARE stmt 1 0 0 0 +statements_digest 072d6c57d3fe4f0c6a7dabba96f0ccf8 CREATE PROCEDURE p1 ( ) BEGIN SELECT * FROM t12 ; END 1 0 0 0 statements_digest 84554971243e91106214dcb8f4eaa89b CALL p1 ( ) 2 0 0 0 -statements_digest 77206e4bf30979c56752a7ed9150213a DROP PROCEDURE p1 1 0 0 0 -statements_digest 03b91dcdba6b0e29f7fb240ae4bcd97f CREATE FUNCTION `func` ( a INTEGER , b INTEGER ) RETURNS INTEGER (?) RETURN a + b 1 0 0 0 -statements_digest 72bc532f308f2dca62f5291df8c50e6f SELECT func (...) 2 0 0 0 +statements_digest 2bd1e1e6eb445f32e1d4b290c1961e6b DROP PROCEDURE p1 1 0 0 0 +statements_digest 5799522044ce9a4fa48dce5f4a3b047a CREATE FUNCTION `func` ( a INTEGER , b INTEGER ) RETURNS INTEGER (?) RETURN a + b 1 0 0 0 +statements_digest 59cbdd7ffc78a23bc2f650f8158067c6 SELECT func (...) 2 0 0 0 statements_digest 0b5a5297689c5036def6af8e8a8ce113 DROP FUNCTION func 1 0 0 0 -statements_digest d08331e42c67555ece50e46eef0f2b47 CREATE TRIGGER trg BEFORE INSERT ON t12 FOR EACH ROW SET @ ? := ? 1 0 0 0 -statements_digest 754a49a4de995c5a729e9ab52f135f59 INSERT INTO t12 VALUES (?) 2 2 0 0 -statements_digest 68df17752bca7c2c8ee2a6a19a0674e7 DROP TRIGGER trg 1 0 0 0 +statements_digest 10c7a2262748aa15496375d99f876fb2 CREATE TRIGGER trg BEFORE INSERT ON t12 FOR EACH ROW SET @ ? := ? 1 0 0 0 +statements_digest bb0154f3d32233f696b95d4127d29a3b INSERT INTO t12 VALUES (?) 2 2 0 0 +statements_digest a975545baf024e8a173be77032d8fd01 DROP TRIGGER trg 1 0 0 0 #################################### # CLEANUP #################################### diff --git a/mysql-test/suite/perfschema/r/statement_digest_consumers.result b/mysql-test/suite/perfschema/r/statement_digest_consumers.result index 21e62e13b19..b47c8127897 100644 --- a/mysql-test/suite/perfschema/r/statement_digest_consumers.result +++ b/mysql-test/suite/perfschema/r/statement_digest_consumers.result @@ -125,43 +125,43 @@ DROP TRIGGER trg; #################################### SELECT schema_name, digest, digest_text, count_star FROM performance_schema.events_statements_summary_by_digest; schema_name digest digest_text count_star -statements_digest 0e98ee6a98e296530ec59c12dbc08dfe TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 -statements_digest 954f43425c3234acc8e194afd97e8a0a SELECT ? FROM t1 1 -statements_digest fc365a54bc19d746bd24c27aba46b990 SELECT ? FROM `t1` 1 -statements_digest 27ba28f6252e4ae0e9b14b36da536fbe SELECT ?, ... FROM t1 2 -statements_digest 81d03922612900032ec4b81934ab4841 SELECT ? FROM t2 1 -statements_digest adce8aec12b6b5046cd4bf55951014c7 SELECT ?, ... FROM t2 2 -statements_digest 59a1bd93c424b10802fe66bb6dcd94d2 INSERT INTO t1 VALUES (?) 1 -statements_digest 91b2da58b0eb49c35a38fbc49f5e491d INSERT INTO t2 VALUES (?) 1 -statements_digest 967114adbf91d8a4a99ec5e49e909ff4 INSERT INTO t3 VALUES (...) 4 -statements_digest 8f25e7a48487e0aa7377e816816bb658 INSERT INTO t4 VALUES (...) 1 -statements_digest 4e51253af793867fba66166de1f314f7 INSERT INTO t5 VALUES (...) 1 -statements_digest fa47b3109e117216cd10209690d28596 INSERT INTO t1 VALUES (?) /* , ... */ 2 -statements_digest 72409f84bc236e6fe9f2f7b4d727f2d3 INSERT INTO t3 VALUES (...) /* , ... */ 1 -statements_digest d40aaddb41ed794d65dd8273f0c75700 INSERT INTO t5 VALUES (...) /* , ... */ 1 -statements_digest 57a82b28388e52e99fc64339dd30edde INSERT INTO t1 VALUES ( NULL ) 1 -statements_digest 6a56b694106442474cb0e5fb7575c8b9 INSERT INTO t6 VALUES (...) 5 -statements_digest c9abf55e296c4317dbaf2d14ef907ad7 SELECT ? + ? 3 -statements_digest 156304a0851a3e3626b39fb3da841a82 SELECT ? 1 +statements_digest 8de787d0e3e3a062aea121ff528fcfce TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 +statements_digest a871edd1a65606b404c0b6e65c1f142c SELECT ? FROM t1 1 +statements_digest d60830f376a7724280dfc422224bb475 SELECT ? FROM `t1` 1 +statements_digest 09309c60c199a727b7ebed40975e8764 SELECT ?, ... FROM t1 2 +statements_digest dc0dcaefa9a12455ffed04ac6f89e65d SELECT ? FROM t2 1 +statements_digest d274a288509eae2cd7febf2f7fe36274 SELECT ?, ... FROM t2 2 +statements_digest ec913f89e0d8be99014bf78e73228c48 INSERT INTO t1 VALUES (?) 1 +statements_digest b919ecf2d5544bcdf95e76eb22231c42 INSERT INTO t2 VALUES (?) 1 +statements_digest d9030eddb8dca8ee5fcaf79e6f254b41 INSERT INTO t3 VALUES (...) 4 +statements_digest 2ad6d8279781b0fb40bdc8647dc94216 INSERT INTO t4 VALUES (...) 1 +statements_digest 3248c16dc70111225fcffa99641e312b INSERT INTO t5 VALUES (...) 1 +statements_digest 152b6c84a0cbfadcbecde01050eddd66 INSERT INTO t1 VALUES (?) /* , ... */ 2 +statements_digest c4cbce33b636e448c29e041b1d5c0eb1 INSERT INTO t3 VALUES (...) /* , ... */ 1 +statements_digest 0bfac9fb577995b116e52ff4aaeaa5b8 INSERT INTO t5 VALUES (...) /* , ... */ 1 +statements_digest f8d6ea06dfb87f5c40fd427f3f0ff4e7 INSERT INTO t1 VALUES ( NULL ) 1 +statements_digest 819acce11785e12f2f73964115632db6 INSERT INTO t6 VALUES (...) 5 +statements_digest aeb185ab9b6e9d5a49e47c8741b8acdf SELECT ? + ? 3 +statements_digest d3804664eeee11407f3fcbd5c29a1f73 SELECT ? 1 statements_digest 3b085ab0d2063dfca1a39212e3ea1831 CREATE SCHEMA statements_digest_temp 2 statements_digest 09f9fabef2feb9a54ba01455e5ae83b9 DROP SCHEMA statements_digest_temp 2 -statements_digest 7910a63ffd31cbcb742e15270c8958c8 SELECT ? FROM no_such_table 1 -statements_digest fa34540a438bc672478b1162505ee28c CREATE TABLE dup_table ( c CHARACTER (?) ) 2 -statements_digest 2c720f176bb7c8510ff8aca8921b9945 DROP TABLE dup_table 1 -statements_digest 0c7d9fd8c27ab067511da41ca3bcdff3 INSERT INTO t11 VALUES (?) 1 -statements_digest 81681ff345065ed72bcd1e9407ab85e4 SHOW WARNINGS 1 -statements_digest d766f5823ae5d8e4cf4602b8e7a3fb80 PREPARE stmt FROM ? 1 +statements_digest ff0bb1dfc399aa3bef6a0f3fccd3ef94 SELECT ? FROM no_such_table 1 +statements_digest 590a245c84e63eb100e1ef463f477f1a CREATE TABLE dup_table ( c CHARACTER (?) ) 2 +statements_digest 74078b0776d8333e356b271551587d53 DROP TABLE dup_table 1 +statements_digest f23641c5ab7e1dd6e0146f66b3fff5c4 INSERT INTO t11 VALUES (?) 1 +statements_digest d3eda26b379bd56340ce84fe395dfff7 SHOW WARNINGS 1 +statements_digest 6bb42dec3094486d5a9e8b0bf460e382 PREPARE stmt FROM ? 1 statements_digest 3ab1e87eabd9688edf919754cce6348b EXECUTE stmt 2 -statements_digest 470094469d250b9f45cab45bf610efe8 DEALLOCATE PREPARE stmt 1 -statements_digest 1b4d25358e08b35ad54e49dfe5eaf3e4 CREATE PROCEDURE p1 ( ) BEGIN SELECT * FROM t12 ; END 1 +statements_digest f9438ab7b8eec604338c28a04e5d650f DEALLOCATE PREPARE stmt 1 +statements_digest 072d6c57d3fe4f0c6a7dabba96f0ccf8 CREATE PROCEDURE p1 ( ) BEGIN SELECT * FROM t12 ; END 1 statements_digest 84554971243e91106214dcb8f4eaa89b CALL p1 ( ) 2 -statements_digest 77206e4bf30979c56752a7ed9150213a DROP PROCEDURE p1 1 -statements_digest 03b91dcdba6b0e29f7fb240ae4bcd97f CREATE FUNCTION `func` ( a INTEGER , b INTEGER ) RETURNS INTEGER (?) RETURN a + b 1 -statements_digest 72bc532f308f2dca62f5291df8c50e6f SELECT func (...) 2 +statements_digest 2bd1e1e6eb445f32e1d4b290c1961e6b DROP PROCEDURE p1 1 +statements_digest 5799522044ce9a4fa48dce5f4a3b047a CREATE FUNCTION `func` ( a INTEGER , b INTEGER ) RETURNS INTEGER (?) RETURN a + b 1 +statements_digest 59cbdd7ffc78a23bc2f650f8158067c6 SELECT func (...) 2 statements_digest 0b5a5297689c5036def6af8e8a8ce113 DROP FUNCTION func 1 -statements_digest d08331e42c67555ece50e46eef0f2b47 CREATE TRIGGER trg BEFORE INSERT ON t12 FOR EACH ROW SET @ ? := ? 1 -statements_digest 754a49a4de995c5a729e9ab52f135f59 INSERT INTO t12 VALUES (?) 2 -statements_digest 68df17752bca7c2c8ee2a6a19a0674e7 DROP TRIGGER trg 1 +statements_digest 10c7a2262748aa15496375d99f876fb2 CREATE TRIGGER trg BEFORE INSERT ON t12 FOR EACH ROW SET @ ? := ? 1 +statements_digest bb0154f3d32233f696b95d4127d29a3b INSERT INTO t12 VALUES (?) 2 +statements_digest a975545baf024e8a173be77032d8fd01 DROP TRIGGER trg 1 SELECT digest, digest_text FROM performance_schema.events_statements_current; digest digest_text #################################### diff --git a/mysql-test/suite/perfschema/r/statement_digest_long_query.result b/mysql-test/suite/perfschema/r/statement_digest_long_query.result index bb355304537..6b00e13576f 100644 --- a/mysql-test/suite/perfschema/r/statement_digest_long_query.result +++ b/mysql-test/suite/perfschema/r/statement_digest_long_query.result @@ -8,5 +8,5 @@ SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1 #################################### SELECT schema_name, digest, digest_text, count_star FROM events_statements_summary_by_digest; schema_name digest digest_text count_star -performance_schema 9d35ff74210c6b30efa4559d627ed0f7 TRUNCATE TABLE events_statements_summary_by_digest 1 -performance_schema d78a04c1c42765b8552e0483c50ae9ff SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ... 1 +performance_schema 7536ab4a65b991a0b1a8b9851e8457c3 TRUNCATE TABLE events_statements_summary_by_digest 1 +performance_schema 63f9aaeed7859671c6a42c75fcd43785 SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ... 1 diff --git a/mysql-test/suite/plugins/r/server_audit.result b/mysql-test/suite/plugins/r/server_audit.result index e9f4eb82fbe..09dcc06c848 100644 --- a/mysql-test/suite/plugins/r/server_audit.result +++ b/mysql-test/suite/plugins/r/server_audit.result @@ -11,10 +11,13 @@ server_audit_incl_users server_audit_logging OFF server_audit_mode 0 server_audit_output_type file +server_audit_query_log_limit 1024 server_audit_syslog_facility LOG_USER server_audit_syslog_ident mysql-server_auditing server_audit_syslog_info server_audit_syslog_priority LOG_INFO +set global server_audit_file_path=null; +set global server_audit_incl_users=null; set global server_audit_file_path='server_audit.log'; set global server_audit_output_type=file; set global server_audit_logging=on; @@ -66,6 +69,7 @@ server_audit_incl_users odin, root, dva, tri server_audit_logging ON server_audit_mode 0 server_audit_output_type file +server_audit_query_log_limit 1024 server_audit_syslog_facility LOG_USER server_audit_syslog_ident mysql-server_auditing server_audit_syslog_info @@ -143,7 +147,40 @@ select 2; 2 2 drop table t1; +set global server_audit_events='query_dcl'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +id +1 +2 +CREATE USER u1 IDENTIFIED BY 'pwd-123'; +GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; +SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +CREATE USER u3 IDENTIFIED BY ''; +drop user u1, u2, u3; +select 2; +2 +2 +(select 2); +2 +2 +/*! select 2*/; +2 +2 +/*comment*/ select 2; +2 +2 +drop table t1; set global server_audit_events=''; +set global server_audit_query_log_limit= 15; +select (1), (2), (3), (4); +1 2 3 4 +1 2 3 4 +select 'A', 'B', 'C', 'D'; +A B C D +A B C D +set global server_audit_query_log_limit= 1024; drop database sa_db; set global server_audit_file_path='.'; show status like 'server_audit_current_log'; @@ -175,6 +212,7 @@ server_audit_incl_users odin, root, dva, tri server_audit_logging ON server_audit_mode 1 server_audit_output_type file +server_audit_query_log_limit 1024 server_audit_syslog_facility LOG_USER server_audit_syslog_ident mysql-server_auditing server_audit_syslog_info @@ -288,7 +326,16 @@ TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select 2',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'(select 2)',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*! select 2*/',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*comment*/ select 2',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u1 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT ALL ON sa_db TO u2 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1 = PASSWORD(*****)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_events=\'\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global serv',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select \'A\', ',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_query_log_limit= 1024',0 TIME,HOSTNAME,root,localhost,ID,ID,READ,mysql,proc, TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proc, TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,event, diff --git a/mysql-test/suite/plugins/t/server_audit.test b/mysql-test/suite/plugins/t/server_audit.test index eb1727fefc2..787861d3327 100644 --- a/mysql-test/suite/plugins/t/server_audit.test +++ b/mysql-test/suite/plugins/t/server_audit.test @@ -8,6 +8,8 @@ if (!$SERVER_AUDIT_SO) { install plugin server_audit soname 'server_audit'; show variables like 'server_audit%'; +set global server_audit_file_path=null; +set global server_audit_incl_users=null; set global server_audit_file_path='server_audit.log'; set global server_audit_output_type=file; set global server_audit_logging=on; @@ -94,7 +96,26 @@ select 2; /*! select 2*/; /*comment*/ select 2; drop table t1; +set global server_audit_events='query_dcl'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +CREATE USER u1 IDENTIFIED BY 'pwd-123'; +GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; +SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +CREATE USER u3 IDENTIFIED BY ''; +drop user u1, u2, u3; +select 2; +(select 2); +/*! select 2*/; +/*comment*/ select 2; +drop table t1; set global server_audit_events=''; + +set global server_audit_query_log_limit= 15; +select (1), (2), (3), (4); +select 'A', 'B', 'C', 'D'; +set global server_audit_query_log_limit= 1024; drop database sa_db; set global server_audit_file_path='.'; diff --git a/mysql-test/suite/rpl/r/rpl_special_charset.result b/mysql-test/suite/rpl/r/rpl_special_charset.result new file mode 100644 index 00000000000..99b8d3a21d1 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_special_charset.result @@ -0,0 +1,8 @@ +include/master-slave.inc +[connection master] +call mtr.add_suppression("Cannot use utf16 as character_set_client"); +CREATE TABLE t1(i VARCHAR(20)); +INSERT INTO t1 VALUES (0xFFFF); +include/diff_tables.inc [master:t1, slave:t1] +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result new file mode 100644 index 00000000000..e71bb2e29c9 --- /dev/null +++ b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result @@ -0,0 +1,2 @@ +include/master-slave.inc +[connection master] diff --git a/mysql-test/suite/rpl/t/rpl_drop_db_fail.test b/mysql-test/suite/rpl/t/rpl_drop_db_fail.test index 77e6cb957f7..f4482064d7b 100644 --- a/mysql-test/suite/rpl/t/rpl_drop_db_fail.test +++ b/mysql-test/suite/rpl/t/rpl_drop_db_fail.test @@ -18,7 +18,9 @@ use db1; CREATE TABLE a(id INT); CREATE VIEW v AS SELECT * FROM a; CREATE TABLE table_father(id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(20)) ENGINE=INNODB; +--sync_slave_with_master +connection master; use db2; CREATE TABLE table_child(id INT PRIMARY KEY, info VARCHAR(20), father_id INT) ENGINE=INNODB; ALTER TABLE table_child ADD CONSTRAINT aaa FOREIGN KEY (father_id) REFERENCES db1.table_father(id); diff --git a/mysql-test/suite/rpl/t/rpl_special_charset.opt b/mysql-test/suite/rpl/t/rpl_special_charset.opt new file mode 100644 index 00000000000..b071fb20845 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_special_charset.opt @@ -0,0 +1 @@ +--character-set-server=utf16 diff --git a/mysql-test/suite/rpl/t/rpl_special_charset.test b/mysql-test/suite/rpl/t/rpl_special_charset.test new file mode 100644 index 00000000000..8ccb1b4183f --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_special_charset.test @@ -0,0 +1,26 @@ +################################################################################ +# Bug#19855907 IO THREAD AUTHENTICATION ISSUE WITH SOME CHARACTER SETS +# Problem: IO thread fails to connect to master if servers are configured with +# special character sets like utf16, utf32, ucs2. +# +# Analysis: MySQL server does not support few special character sets like +# utf16,utf32 and ucs2 as "client's character set"(eg: utf16,utf32, ucs2). +# When IO thread is trying to connect to Master, it sets server's character +# set as client's character set. When Slave server is started with these +# special character sets, IO thread (a connection to Master) fails because +# of the above said reason. +# +# Fix: If server's character set is not supported as client's character set, +# then set default's client character set(latin1) as client's character set. +############################################################################### +--source include/master-slave.inc +call mtr.add_suppression("Cannot use utf16 as character_set_client"); +CREATE TABLE t1(i VARCHAR(20)); +INSERT INTO t1 VALUES (0xFFFF); +--sync_slave_with_master +--let diff_tables=master:t1, slave:t1 +--source include/diff_tables.inc +# Cleanup +--connection master +DROP TABLE t1; +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test new file mode 100644 index 00000000000..a79a1885a6c --- /dev/null +++ b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test @@ -0,0 +1,12 @@ +# +# MDEV-7126 replication slave - deadlock in terminate_slave_thread with stop slave and show variables of replication filters and show global status +# +--source include/master-slave.inc + +--connection slave + +# If everything is okay, the test will end in several seconds; maybe a minute. +# If the problem shows up, it will hang until testcase timeout is exceeded. +--exec $MYSQL_SLAP --silent --socket=$SLAVE_MYSOCK -q "START SLAVE; STOP SLAVE; SHOW GLOBAL STATUS" -c 2 --number-of-queries=100 --create-schema=test + +# All done. diff --git a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result index a7afc334ba1..719adb67573 100644 --- a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result +++ b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result @@ -41,23 +41,11 @@ Warning 1292 Truncated incorrect transaction_alloc_block_size value: '60020' SELECT @@global.transaction_alloc_block_size; @@global.transaction_alloc_block_size 59392 -SET @@global.transaction_alloc_block_size = 4294967295; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '4294967295' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -4294966272 '#--------------------FN_DYNVARS_005_04-------------------------#' SET @@session.transaction_alloc_block_size = 1024; SELECT @@session.transaction_alloc_block_size; @@session.transaction_alloc_block_size 1024 -SET @@session.transaction_alloc_block_size =4294967295; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '4294967295' -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -4294966272 SET @@session.transaction_alloc_block_size = 65535; Warnings: Warning 1292 Truncated incorrect transaction_alloc_block_size value: '65535' @@ -77,12 +65,12 @@ Warning 1292 Truncated incorrect transaction_alloc_block_size value: '-1024' SELECT @@global.transaction_alloc_block_size; @@global.transaction_alloc_block_size 1024 -SET @@global.transaction_alloc_block_size = 123456789201; +SET @@global.transaction_alloc_block_size = 135217728; Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '123456789201' +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '135217728' SELECT @@global.transaction_alloc_block_size; @@global.transaction_alloc_block_size -4294966272 +134217728 SET @@global.transaction_alloc_block_size = ON; ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' SET @@global.transaction_alloc_block_size = OFF; @@ -109,12 +97,12 @@ Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1000' SELECT @@global.transaction_alloc_block_size; @@global.transaction_alloc_block_size 1024 -SET @@session.transaction_alloc_block_size = 12345678901; +SET @@session.transaction_alloc_block_size = 135217728; Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '12345678901' +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '135217728' SELECT @@session.transaction_alloc_block_size; @@session.transaction_alloc_block_size -4294966272 +134217728 SET @@session.transaction_alloc_block_size = ON; ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' SET @@session.transaction_alloc_block_size = OFF; @@ -149,9 +137,7 @@ WHERE VARIABLE_NAME='transaction_alloc_block_size'; 1 '#---------------------FN_DYNVARS_001_08----------------------#' SET @@transaction_alloc_block_size = 1024; -SET @@global.transaction_alloc_block_size = 4294967295; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '4294967295' +SET @@global.transaction_alloc_block_size = 134217728; SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size; @@transaction_alloc_block_size = @@global.transaction_alloc_block_size 0 diff --git a/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic.result b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic.result index cbd25426408..be54302689d 100644 --- a/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic.result +++ b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic.result @@ -109,6 +109,12 @@ SELECT @@session.transaction_prealloc_size; 1024 SET @@session.transaction_prealloc_size = "Test"; ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@session.transaction_prealloc_size = 135217728; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '135217728' +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +134217728 '#------------------FN_DYNVARS_005_06-----------------------#' SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES @@ -128,7 +134,7 @@ Warnings: Warning 1292 Truncated incorrect transaction_prealloc_size value: '10' SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size; @@transaction_prealloc_size = @@global.transaction_prealloc_size -1 +0 '#---------------------FN_DYNVARS_001_10----------------------#' SET @@transaction_prealloc_size = 100; Warnings: diff --git a/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test b/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test index 4a69bbcdb01..0faa95c8fe6 100644 --- a/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test +++ b/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test @@ -5,7 +5,7 @@ # Access Type: Dynamic # # Data Type: numeric # # Default Value: 8192 # -# Range: 1024-4294967295 # +# Range: 1024-134217728 # # # # # # Creation Date: 2008-02-14 # @@ -80,9 +80,6 @@ SELECT @@global.transaction_alloc_block_size; SET @@global.transaction_alloc_block_size = 60020; SELECT @@global.transaction_alloc_block_size; -SET @@global.transaction_alloc_block_size = 4294967295; -SELECT @@global.transaction_alloc_block_size; - --echo '#--------------------FN_DYNVARS_005_04-------------------------#' ################################################################### # Change the value of variable to a valid value for SESSION Scope # @@ -91,9 +88,6 @@ SELECT @@global.transaction_alloc_block_size; SET @@session.transaction_alloc_block_size = 1024; SELECT @@session.transaction_alloc_block_size; -SET @@session.transaction_alloc_block_size =4294967295; -SELECT @@session.transaction_alloc_block_size; - SET @@session.transaction_alloc_block_size = 65535; SELECT @@session.transaction_alloc_block_size; @@ -110,7 +104,7 @@ SET @@global.transaction_alloc_block_size = -1024; SELECT @@global.transaction_alloc_block_size; -SET @@global.transaction_alloc_block_size = 123456789201; +SET @@global.transaction_alloc_block_size = 135217728; SELECT @@global.transaction_alloc_block_size; -- Error ER_WRONG_TYPE_FOR_VAR @@ -136,7 +130,7 @@ SET @@global.transaction_alloc_block_size ="Test"; SET @@global.transaction_alloc_block_size = 1000; SELECT @@global.transaction_alloc_block_size; -SET @@session.transaction_alloc_block_size = 12345678901; +SET @@session.transaction_alloc_block_size = 135217728; SELECT @@session.transaction_alloc_block_size; -- Error ER_WRONG_TYPE_FOR_VAR @@ -185,7 +179,7 @@ WHERE VARIABLE_NAME='transaction_alloc_block_size'; ########################################################################### SET @@transaction_alloc_block_size = 1024; -SET @@global.transaction_alloc_block_size = 4294967295; +SET @@global.transaction_alloc_block_size = 134217728; SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size; diff --git a/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic.test b/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic.test index 5eabf457a0c..9d0c20a37b4 100644 --- a/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic.test +++ b/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic.test @@ -5,7 +5,7 @@ # Access Type: Dynamic # # Data Type: numeric # # Default Value: 4096 # -# Range: # +# Range: 1024-134217728 # # # # # # Creation Date: 2008-02-14 # @@ -137,6 +137,10 @@ SELECT @@session.transaction_prealloc_size; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.transaction_prealloc_size = "Test"; +SET @@session.transaction_prealloc_size = 135217728; +SELECT @@session.transaction_prealloc_size; + + --echo '#------------------FN_DYNVARS_005_06-----------------------#' #################################################################### # Check if the value in GLOBAL Table matches value in variable # diff --git a/mysql-test/t/blackhole.test b/mysql-test/t/blackhole.test index 32d7d70200a..7f394e0f846 100644 --- a/mysql-test/t/blackhole.test +++ b/mysql-test/t/blackhole.test @@ -17,6 +17,16 @@ SELECT 1 FROM t1 WHERE a = ANY (SELECT a FROM t2); DROP TABLE t1, t2; +# +# Bug#19786309 - CRASH IN UNLOCK TABLES AFTER LOCKING AND TRUNCATING TEMPORARY TABLE. +# +create temporary table t1 (a int) engine=blackhole; +lock table t1 write; +truncate table t1; +select * from t1; +unlock tables; +drop temporary table t1; + --echo End of 5.5 tests --echo # diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index 95008d83a38..5e8195e4718 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -507,6 +507,17 @@ select * from t1 where c1 = '=> dž'; select * from t1 where concat(c1) = '=> dž'; drop table t1; + +--echo # +--echo # MDEV-7649 wrong result when comparing utf8 column with an invalid literal +--echo # + +SET NAMES utf8 COLLATE utf8_unicode_ci; +--let ENGINE=MyISAM +--source include/ctype_utf8_ilseq.inc +--let ENGINE=HEAP +--source include/ctype_utf8_ilseq.inc + --echo # --echo # End of 5.5 tests --echo # diff --git a/mysql-test/t/ctype_uca_innodb.test b/mysql-test/t/ctype_uca_innodb.test new file mode 100644 index 00000000000..cb6caff4a03 --- /dev/null +++ b/mysql-test/t/ctype_uca_innodb.test @@ -0,0 +1,25 @@ +# +# Tests for UCA collations with InnoDB +# + +let collation=utf8_unicode_ci; +--source include/have_collation.inc +--source include/have_innodb.inc + + +--echo # +--echo # Start of 5.5 tests +--echo # + + +--echo # +--echo # MDEV-7649 wrong result when comparing utf8 column with an invalid literal +--echo # + +SET NAMES utf8 COLLATE utf8_unicode_ci; +--let ENGINE=InnoDB +--source include/ctype_utf8_ilseq.inc + +--echo # +--echo # End of 5.5 tests +--echo # diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index af5f4b8ccf8..28e5852b4c1 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -1616,6 +1616,26 @@ UNION ALL SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1; --echo # +--echo # MDEV-7814 Assertion `args[0]->fixed' fails in Item_func_conv_charset::Item_func_conv_charset +--echo # +CREATE TABLE t1(a CHAR(1) CHARACTER SET latin1, b INT NOT NULL); +CREATE TABLE t2(a CHAR(1) CHARACTER SET utf8 COLLATE utf8_general_ci, b INT NOT NULL); +SELECT (SELECT t2.a FROM t2 WHERE t2.a=t1.a) AS aa, b, COUNT(b) FROM t1 GROUP BY aa; +DROP TABLE t1,t2; + +--echo # +--echo # MDEV-7649 wrong result when comparing utf8 column with an invalid literal +--echo # + +SET NAMES utf8 COLLATE utf8_general_ci; +--let ENGINE=InnoDB +--source include/ctype_utf8_ilseq.inc +--let ENGINE=MyISAM +--source include/ctype_utf8_ilseq.inc +--let ENGINE=HEAP +--source include/ctype_utf8_ilseq.inc + +--echo # --echo # End of 5.5 tests --echo # diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test index 61ae3695a1f..ddce7f55292 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -492,5 +492,17 @@ update t1 set balance=(select sum(balance) from (SELECT balance FROM t1 where ac set optimizer_switch=@save_derived_optimizer_switch_bug; drop table t1; - set optimizer_switch=@save_derived_optimizer_switch; + +--echo # +--echo # MDEV-6892: WHERE does not apply +--echo # +create table t1 (id int); +create table t2 (id int); +insert into t1 values(1),(2),(3); +insert into t2 values(4),(5),(6); +#explain extended +select x.id, message from (select id from t1) x left join +(select id, 1 as message from t2) y on x.id=y.id +where coalesce(message,0) <> 0; +drop table t1,t2; diff --git a/mysql-test/t/file_contents.test b/mysql-test/t/file_contents.test index e3de5e64940..186394df4e3 100644 --- a/mysql-test/t/file_contents.test +++ b/mysql-test/t/file_contents.test @@ -17,7 +17,7 @@ if ($dir_bin eq '/usr/') { $dir_docs =~ s|/lib|/share/doc|; if(-d "$dir_docs/packages") { # SuSE: "packages/" in the documentation path - $dir_docs = glob "$dir_docs/packages/MySQL-server*"; + $dir_docs = glob "$dir_docs/packages/*-server*"; } else { # RedHat: version number in directory name $dir_docs = glob "$dir_docs/MySQL-server*"; @@ -27,7 +27,7 @@ if ($dir_bin eq '/usr/') { $dir_docs = "$dir_bin/share/doc"; if(-d "$dir_docs/packages") { # SuSE: "packages/" in the documentation path - $dir_docs = glob "$dir_docs/packages/MySQL-server*"; + $dir_docs = glob "$dir_docs/packages/*-server*"; } else { # RedHat/Debian: version number in directory name $dir_docs = glob "$dir_docs/mariadb-server-*"; diff --git a/mysql-test/t/filesort_bad_i_s-7585.test b/mysql-test/t/filesort_bad_i_s-7585.test new file mode 100644 index 00000000000..daf70acdd52 --- /dev/null +++ b/mysql-test/t/filesort_bad_i_s-7585.test @@ -0,0 +1,14 @@ +# +# MDEV-7585 Assertion `thd->is_error() || kill_errno || thd->killed == ABORT_QUERY' failed in ha_rows filesort +# +SET sql_mode=STRICT_TRANS_TABLES; + +CREATE TABLE t0 (i INT) ENGINE=MyISAM; +CREATE VIEW v1 AS SELECT * FROM t0; +CREATE VIEW v2 AS SELECT * FROM v1; +DROP VIEW IF EXISTS v1; + +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 SELECT TABLE_ROWS FROM information_schema.tables ORDER BY TABLE_ROWS; +DROP VIEW v2; +DROP TABLE t1, t0; diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 7643676ea61..42a30760a86 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -803,3 +803,21 @@ create table t1 (a char(1) character set utf8); insert into t1 values ('a'),('b'); select 1 from t1 where a in (select group_concat(a) from t1); drop table t1; + +# +# MDEV-7820 Server crashes in in my_strcasecmp_utf8 on subquery in ORDER BY clause of GROUP_CONCAT +# +CREATE TABLE t1 (f1 VARCHAR(10)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('a'),('b'); + +CREATE TABLE t2 (f2 VARCHAR(10)) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('c'); + +CREATE TABLE t3 (f3 VARCHAR(10)) ENGINE=MyISAM; +INSERT INTO t3 VALUES ('d'),('e'); + +SELECT GROUP_CONCAT( f2 ORDER BY ( f2 IN ( SELECT f1 FROM t1 WHERE f1 <= f2 ) ) ) AS field +FROM ( SELECT * FROM t2 ) AS sq2, t3 +ORDER BY field; + +drop table t3, t2, t1; diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 8350c3185c7..9378ea55377 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -7,6 +7,7 @@ --disable_warnings DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +DROP VIEW IF EXISTS v1; --enable_warnings CREATE TABLE gis_point (fid INTEGER NOT NULL PRIMARY KEY, g POINT); @@ -1482,4 +1483,12 @@ drop table t1; # SELECT st_astext(ST_Buffer(ST_PolygonFromText('POLYGON((3 5, 2 4, 2 5, 3 5))'), -100)); ---echo End of 5.5 tests +# +# MDEV-7779 View definition changes upon creation +# +CREATE VIEW v1 AS SELECT POINT(1,1) AS p; +SHOW CREATE VIEW v1; +SELECT ASTEXT(p) FROM v1; +DROP VIEW v1; + +# --echo End of 5.5 tests diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 4b1cb82d0f9..dfb7f28ab28 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -1515,6 +1515,17 @@ let $query= SELECT MIN(a), b FROM t1 WHERE t1.b = 'a' GROUP BY b; --echo DROP TABLE t1; + +# +# Bug#19880368 : GROUP_CONCAT CRASHES AFTER DUMP_LEAF_KEY +# +create table t1 (a int, b int); +insert into t1 values (1,11), (1,12), (2,22),(2,23), (4,44),(4,45); +create table t2 (c int, d int); +insert into t2 values (1,11), (1,12), (2,22),(2,23), (4,44),(4,45); +select distinct a,sum(b), (select d from t2 where c=a order by max(b) limit 1) from t1 group by a order by max(b); +drop table t1, t2; + --echo # --echo # LP bug#993726 Wrong result from a query with ALL subquery predicate in WHERE --echo # diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test index cd6a4c9d328..0f6be0b0ec6 100644 --- a/mysql-test/t/having.test +++ b/mysql-test/t/having.test @@ -694,6 +694,41 @@ DROP TABLE t1; --echo End of 5.3 tests --echo # +--echo # Bug MDEV-7301: Unknown column quoted with backticks in HAVING clause when using function. +--echo # Bug#16221433 MYSQL REJECTS QUERY DUE TO BAD RESOLUTION OF NAMES IN HAVING; VIEW UNREADABLE +--echo # + +CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `title` varchar(45) DEFAULT NULL, + PRIMARY KEY (`id`) +) DEFAULT CHARSET=utf8; + +INSERT INTO `t1` VALUES ('1', 'Just for fun'); +INSERT INTO `t1` VALUES ('2', 'Wait until a sunhine'); +INSERT INTO `t1` VALUES ('3', 'Take a new turn'); + +SELECT `id`, SHA1(`title`) AS `column_1` +FROM `t1` +HAVING `column_1` LIKE '8%'; + +--echo expected 1 row(s) returned + +SELECT `id`, SHA1(`title`) AS `column_1` +FROM `t1` +HAVING UPPER(column_1) LIKE '8%'; + +--echo expected -- 1 row(s) returned + +SELECT `id`, SHA1(`title`) AS `column_1` +FROM `t1` +HAVING UPPER(`column_1`) LIKE '8%'; + +--echo expected -- 1 row(s) returned not ER_BAD_FIELD_ERROR + +drop table t1; + +--echo # --echo # Bug mdev-5160: two-way join with HAVING over the second table --echo # @@ -708,4 +743,3 @@ SELECT * FROM t1 JOIN t2 ON c1 = c2 HAVING c2 > 'a' ORDER BY c2 LIMIT 1; DROP TABLE t1,t2; --echo End of 10.0 tests - diff --git a/mysql-test/t/log_errchk.test b/mysql-test/t/log_errchk.test index e4bc6a841dd..2808458e9f1 100644 --- a/mysql-test/t/log_errchk.test +++ b/mysql-test/t/log_errchk.test @@ -6,7 +6,8 @@ # Bug#14757009 : WHEN THE GENERAL_LOG IS A SOCKET AND THE READER GOES AWAY, # MYSQL QUITS WORKING. # -call mtr.add_suppression("Could not use"); +# MDEV-6870 Not possible to use FIFO file as a general_log file +# --let $gen_log_file= $MYSQLTEST_VARDIR/tmp/general_log.fifo --let $slow_query_log_file= $MYSQLTEST_VARDIR/tmp/slow_log.fifo @@ -15,10 +16,9 @@ call mtr.add_suppression("Could not use"); --exec mkfifo $gen_log_file --exec mkfifo $slow_query_log_file ---echo # Case 1: Setting fife file to general_log_file and slow_query_log_file +--echo # Case 1: Setting fifo file to general_log_file and slow_query_log_file --echo # system variable. -# Only regular files can be set to general log. Setting fifo file to general log -# reports an error. +# Setting fifo file to general log reports an error because the other end is closed --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --error ER_WRONG_VALUE_FOR_VAR --eval SET GLOBAL general_log_file="$gen_log_file"; @@ -38,11 +38,12 @@ call mtr.add_suppression("Could not use"); --exec echo "restart: --general-log-file=$gen_log_file --slow-query-log-file=$slow_query_log_file" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --source include/wait_until_connected_again.inc -# With fix error should be reported in the error log file if file is not a -# regular file. +# Error 6 is reported, because the other end is closed +call mtr.add_suppression("Could not use .* for logging \\(error 6\\)"); +call mtr.add_suppression("File '.*' not found \\(Errcode: 6 "); --perl my $file= $ENV{'GREP_FILE'}; - my $pattern= "Turning logging off for the whole duration"; + my $pattern= "for logging \\(error 6\\)\\. Turning logging off for the whole duration"; open(FILE, "$file") or die("Unable to open $file: $!\n"); my $count = 0; while (<FILE>) { diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 4f8736f0c2d..c013938416e 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -849,6 +849,212 @@ update t1 join v3 using (id) set t1.a=0; drop view v1, v2, v3; drop table t2, t3, t1; +--echo # +--echo # MDEV-7613: MariaDB 5.5.40 server crash on update table left join +--echo # with a view +--echo # + +CREATE TABLE `t1` ( + `f1` varchar(6) COLLATE latin1_general_ci DEFAULT NULL, + `f2` varchar(6) COLLATE latin1_general_ci DEFAULT NULL, + `f3` varchar(7) COLLATE latin1_general_ci DEFAULT NULL, + `f4` varchar(15) COLLATE latin1_general_ci DEFAULT NULL, + `f5` datetime DEFAULT NULL, + `f6` varchar(2) COLLATE latin1_general_ci DEFAULT NULL, + `f7` varchar(2) COLLATE latin1_general_ci DEFAULT NULL, + `ff1` int(1) DEFAULT NULL, + `ff2` int(1) DEFAULT NULL, + `ff3` int(1) DEFAULT NULL, + `ff4` int(1) DEFAULT NULL, + `ff5` int(1) DEFAULT NULL, + `ff6` int(1) DEFAULT NULL, + `ff7` int(1) DEFAULT NULL, + `ff8` int(2) DEFAULT NULL, + `ff9` int(1) DEFAULT NULL, + `ff10` int(1) DEFAULT NULL, + `ff11` int(1) DEFAULT NULL, + `ff12` int(1) DEFAULT NULL, + `ff13` int(1) DEFAULT NULL, + `ff14` int(1) DEFAULT NULL, + `ff15` int(1) DEFAULT NULL, + `f8` varchar(70) COLLATE latin1_general_ci DEFAULT NULL, + `f9` varchar(20) COLLATE latin1_general_ci DEFAULT NULL, + `f10` varchar(50) COLLATE latin1_general_ci NOT NULL, + `f11` varchar(50) COLLATE latin1_general_ci DEFAULT NULL, + `f12` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, + `f13` text COLLATE latin1_general_ci, + `f14` time DEFAULT NULL, + `f15` varchar(30) COLLATE latin1_general_ci DEFAULT NULL, + `fg1` int(11) DEFAULT NULL, + `fg2` int(11) DEFAULT NULL, + `fg3` int(11) DEFAULT NULL, + `fg4` int(11) DEFAULT NULL, + `fg5` int(11) DEFAULT NULL, + `fg6` int(11) DEFAULT NULL, + `fg7` int(11) DEFAULT NULL, + `fg9` int(11) DEFAULT NULL, + `fg10` int(11) DEFAULT NULL, + `fg11` int(11) DEFAULT NULL, + `fg12` int(11) DEFAULT NULL, + `fg13` int(11) DEFAULT NULL, + `fg14` int(11) DEFAULT NULL, + `fg15` int(11) DEFAULT NULL, + `f16` double DEFAULT NULL, + `f17` double DEFAULT NULL, + `f18` int(11) DEFAULT NULL, + `f19` int(11) DEFAULT NULL, + `f20` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, + `f21` int(11) DEFAULT NULL, + `f22` int(11) DEFAULT NULL, + `f23` int(11) DEFAULT NULL, + `f24` double DEFAULT NULL, + `f25` int(11) DEFAULT NULL, + `f26` double DEFAULT NULL, + `f27` int(11) DEFAULT NULL, + `f28` int(11) DEFAULT NULL, + `f29` double DEFAULT NULL, + `f30` int(11) DEFAULT NULL, + `f31` double DEFAULT NULL, + `PZ` double DEFAULT NULL, + `f32` varchar(50) COLLATE latin1_general_ci DEFAULT NULL, + `f33` varchar(50) COLLATE latin1_general_ci DEFAULT NULL, + `f34` varchar(50) COLLATE latin1_general_ci DEFAULT NULL, + `f35` varchar(30) COLLATE latin1_general_ci DEFAULT NULL, + `f36` varchar(20) COLLATE latin1_general_ci DEFAULT NULL, + `f37` varchar(50) COLLATE latin1_general_ci DEFAULT NULL, + `f20_2` varchar(20) COLLATE latin1_general_ci DEFAULT NULL, + `f38` varchar(30) COLLATE latin1_general_ci DEFAULT NULL COMMENT 'Email = E-Mail / Whitemail = Brief', + `insert_ts` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`f10`), + KEY `f5_f12` (`f5`,`f12`), + KEY `f5_f20` (`f5`,`f20`), + KEY `f5_f33` (`f5`,`f33`) +) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci ROW_FORMAT=COMPACT; + +INSERT INTO `t1` VALUES ('2011/2','201105','2011/19','gstfbnfr','2011-05-06 +00:00:00','gg','Ag',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,'','','','','','','21:56:28','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL,NULL,0,0,'Dffgult',1,0,0,NULL,0,NULL,0,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'ggggil',NULL),('2008/4','200812','2008/50','hgckbgfx','2008-12-08 +00:00:00','gg','Ag',2,NULL,2,1,1,1,1,24,1,NULL,1,1,1,2,0,'gusschlifßlich +zugg +gflffonifrfn','88.77.79.214','10001614','fg-gtgggggdgtfn','fg-gtgggggdgtfn','birgit.tfrpfllf@gggx.df','11:55:21',NULL,1,0,1,1,1,1,1,1,0,1,1,1,0,0,NULL,NULL,0,4,'ffrtrgg',1,6,10,1.66666666666667,4,1,10,14,1.4,1,NULL,NULL,'out',NULL,NULL,'49','ggobilcogg','k.A.',NULL,'ggggil',NULL),('2008/4','200812','2008/51','hgckbgfx','2008-12-15 +00:00:00','gg','Ag',4,5,5,4,5,5,5,NULL,4,5,1,1,1,4,0,'gusschlifßlich zugg +gflffonifrfn','79.197.185.64','10001686','fg-gtgggggdgtfn','fg-gtgggggdgtfn','kgtjg@swfftys.df','09:28:42',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,11,4.71428571428571,16,1.2,12,49,4.08111111111111,1,NULL,NULL,'out',NULL,NULL,'49','ggobilcogg','k.A.',NULL,'ggggil',NULL),('2008/4','200812','2008/50','nufchti','2008-12-08 +00:00:00','gg','Ag',4,1,1,5,5,5,5,12,4,5,1,1,2,1,0,'gusschlifßlich zugg +gflffonifrfn','89.54.151.216','10001700','fg-gtgggggdgtfn','fg-gtgggggdgtfn','H_K2006@frffnft.df','16:41:45',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,10,4.28571428571429,11,2.6,12,41,1.58111111111111,1,NULL,NULL,'ffrtrgg +Bgckofficf 5','vb5','Nufchtfr, +Iris','49','ggobilcogg','grfurt','Intfrn','ggggil',NULL),('2008/4','200812','2008/50','junghdro','2008-12-11 +00:00:00','Do','Ag',2,2,5,5,4,4,2,72,2,5,2,2,1,1,0,'gusschlifßlich zugg +gflffonifrfn','84.61.20.216','10001849','fg-ggriff','fg-ggriff','schofnf-glftfr@grcor.df','20:18:05',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,24,1.42857142857141,12,2.4,12,16,1,1,NULL,NULL,'ffrtrgg +Bgckofficf 5','vb5','Junghfinrich, +Dorothfg','49','ggobilcogg','grfurt','Intfrn','ggggil',NULL),('2008/4','200812','2008/50','fbflktj','2008-12-08 +00:00:00','gg','Ag',4,2,2,5,1,1,1,24,NULL,NULL,NULL,NULL,NULL,0,0,'Kgggfrg +bzw. DigiCggg +Funktion','217.84.62.6','10001888','fg-Kündigungfn','fg-Kündigungfn','f.frofschkf@gggx.df','21:05:59',NULL,1,1,1,1,1,1,1,0,0,0,0,0,0,0,NULL,NULL,0,0,'ffrtrgg',1,7,16,2.28571428571429,0,NULL,7,16,2.28571428571429,0,NULL,NULL,'out',NULL,'gbfl, +Kgtjg','49','ggobilcogg','k.A.','gxtfrn','ggggil',NULL),('2008/4','200812','2008/50','gltggggri','2008-12-09 +00:00:00','Di','Ag',4,1,1,4,2,1,2,16,1,2,2,2,2,2,0,'gusschlifßlich zugg +gflffonifrfn','81.171.157.211','10001988','fg-gtgggggdgtfn','fg-gtgggggdgtfn','bistfr@nftcolognf.df','11:07:54',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,21,1,11,2.2,12,12,2.66666666666667,1,NULL,NULL,'out',NULL,NULL,'49','ggobilcogg','k.A.','gxtfrn','ggggil',NULL),('2008/4','200812','2008/50','ggufllfsg','2008-12-09 +00:00:00','Di','Ag',2,2,2,2,1,1,2,12,2,2,2,1,1,2,0,'ggobilfs +Intfrnft','62.154.142.186','10002097','fg-gtgggggdgtfn','fg-gtgggggdgtfn','norbfrtwfdlich@fgggil.df','09:42:11',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,12,1.71428571428571,8,1.6,12,20,1.66666666666667,1,NULL,NULL,'ffrtrgg +Bgckofficf 1','vb1','Mufllfr, +ggbinf','49','ggobilcogg','grfurt','Intfrn','ggggil',NULL),('2008/4','200812','2008/50','wggnfg','2008-12-09 +00:00:00','Di','Ag',5,5,5,5,5,5,5,12,5,5,5,5,5,5,0,'gls grsgtz für +Ffstnftz','85.180.141.246','10002127','fg-Kündigungfn','fg-Kündigungfn','rfinhgrt.gdolph@yghoo.df','17:44:11',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,15,5,25,5,12,60,5,1,NULL,NULL,'ffrtrgg +Bgckofficf 1','vb1','Wggnfr, +Annftt','49','ggobilcogg','grfurt','Intfrn','ggggil',NULL),('2008/4','200812','2008/50','schubrbf','2008-12-10 +00:00:00','Mi','Ag',1,2,NULL,2,1,2,1,24,NULL,NULL,NULL,NULL,NULL,0,0,'Kgggfrg +bzw. DigiCggg +Funktion','91.40.98.242','10002160','fg-gtgggggdgtfn','fg-gtgggggdgtfn','olgf.lifb@gggx.nft','18:18:25',NULL,1,1,0,1,1,1,1,0,0,0,0,0,0,0,NULL,NULL,0,0,'ffrtrgg',1,6,11,1.81111111111111,0,NULL,6,11,1.81111111111111,0,NULL,NULL,'out',NULL,NULL,'49','ggobilcogg','k.A.','gxtfrn','ggggil',NULL); + +CREATE TABLE `t2` ( + `ft1` datetime DEFAULT NULL, + `ft2` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `ft3` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `ft4` varchar(255) COLLATE latin1_general_ci NOT NULL DEFAULT '', + `ft5` varchar(255) COLLATE latin1_general_ci NOT NULL DEFAULT '', + `ft6` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, + `ft6_2` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, + `ft7` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, + `ft8` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, + `ft9` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, + `ft10` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, + PRIMARY KEY (`ft4`,`ft5`) +) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; + +INSERT INTO `t2` VALUES ('2013-03-13 00:00:00','2013-03-13 00:00:00','9999-12-31 00:00:00','#','extern FP f32 2','Default','Intern','DEFAULT',NULL,NULL,NULL),('2013-03-13 00:00:00','2013-03-13 00:00:00','9999-12-31 00:00:00','#','extern FP f32 3','Default','Intern','DEFAULT',NULL,NULL,NULL); + +CREATE TABLE `t3` ( + `fe1` int(10) NOT NULL DEFAULT '0', + `fe2` char(50) COLLATE latin1_general_ci DEFAULT 'nn', + `f34` char(50) COLLATE latin1_general_ci DEFAULT NULL, + `fe3` double DEFAULT NULL, + `fe4` double DEFAULT NULL, + `fe5` char(4) COLLATE latin1_general_ci DEFAULT NULL, + `f32` char(50) COLLATE latin1_general_ci DEFAULT NULL, + `fe6` int(3) DEFAULT '0', + `fe7` char(1) COLLATE latin1_general_ci DEFAULT NULL, + `ft6` char(50) COLLATE latin1_general_ci DEFAULT NULL, + `f33` char(4) COLLATE latin1_general_ci DEFAULT NULL COMMENT 'virtuelle f33s', + `fe8` char(4) COLLATE latin1_general_ci DEFAULT NULL COMMENT 'aus dem ADS', + `f37` char(50) COLLATE latin1_general_ci DEFAULT NULL, + `fe9` char(50) COLLATE latin1_general_ci DEFAULT NULL, + `fe10` int(5) DEFAULT '0', + `fe11` int(10) DEFAULT '0', + `fe12` char(50) COLLATE latin1_general_ci DEFAULT NULL, + `fe13` double DEFAULT NULL, + `fe14` char(50) COLLATE latin1_general_ci DEFAULT NULL, + `fe15` date DEFAULT NULL, + `fe16` date DEFAULT NULL, + `fe17` int(10) DEFAULT '0', + `fe18` date NOT NULL DEFAULT '0000-00-00', + `ft3` date NOT NULL DEFAULT '0000-00-00', + PRIMARY KEY (`fe1`), + KEY `fe2` (`fe2`,`fe18`,`ft3`), + KEY `f33` (`f33`), + KEY `fe8` (`fe8`) +) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci ROW_FORMAT=COMPACT COMMENT='CustomerService und Outsourcer Userinformationen'; + +INSERT INTO `t3` VALUES (1,'aabggn','gab, glgna',0,NULL,NULL,'gxtgrn D gnd g +gggsbgrg',0,NULL,'gxtgrn','dsa','dsa','gggsbgrg','0',91611,0,'0',0,'agsggschigdgn','2014-08-11','2014-09-05',0,'2011-01-01','2014-08-11'),(4,'aabigr','gab, +Iggr',0,NULL,NULL,'gxtgrn D gnd g +gggsbgrg',0,NULL,'gxtgrn','dsa','dsa','gggsbgrg','0',0,0,'0',0,'agsggschigdgn','2014-08-11','2014-09-05',0,'2012-10-01','2014-08-11'),(7,'abgcrist','gbg, +ghristggna',15182,1,'ja','ggshilfg gxtgrn 1',1,NULL,'gg +galgs','ag1','ag1','grfgrt','0',11941,0,'0',0,'agsggschigdgn','2014-01-11',NULL,11802051,'1900-01-01','2010-06-10'),(8,'abgcrist','gbg, +ghristggna',15182,1,'ja','Zgntralg gftgr galgs Bgtrgggng 1',1,NULL,'gg +galgs','sb1','sb1','grfgrt','0',11941,0,'0',0,'agsggschigdgn','2014-01-11',NULL,11802051,'2010-07-01','2012-08-11'),(9,'abgcrist','gbg, +ghristggna',15182,1,'ja','galgs Inbggnd 2',1,NULL,'gg +galgs','si2','si2','grfgrt','0',11941,0,'0',0,'agsggschigdgn','2014-01-11',NULL,11802051,'2012-09-01','2014-01-11'),(10,'abgcgr','gbg, +ggrnglgg',14962,1,NULL,'galgs Ogtbggnd 1',1,NULL,'gg +galgs','sg1','sg1','grfgrt','0',12401,0,'abgcrn',1,NULL,NULL,NULL,11800647,'1900-01-01','2010-11-10'),(11,'abgcgr','gbg, +ggrnglgg',14962,1,NULL,'galgs Ogtbggnd 1',1,NULL,'gg +galgs','sg1','sg1','grfgrt','0',12401,0,'abgcrn',1,NULL,NULL,NULL,11800647,'2010-12-01','2011-08-11'),(12,'abgcgr','gbg, +ggrnglgg',14962,1,NULL,'galgs Ogtbggnd 2',1,NULL,'gg +galgs','sg2','sg2','grfgrt','0',12401,0,'abgcrn',1,NULL,NULL,NULL,11800647,'2011-09-01','2012-01-11'),(13,'abgcgr','gbg, +ggrnglgg',14962,0.75,NULL,'galgs Ogtbggnd 2',1,NULL,'gg +galgs','sg2','sg2','grfgrt','0',12401,0,'abgcrn',1,NULL,NULL,'2011-09-11',11800647,'2012-02-01','2011-08-11'),(14,'rgghrsgr','gbg, +gigrid',14781,1,'ja','Fgrdgrgngsmanaggmgnt 1',1,NULL,'gg +Zahlgng','fm1','fm1','grfgrt','0',12141,0,'0',1,NULL,NULL,NULL,11010781,'1900-01-01','2012-08-11'); + +CREATE ALGORITHM=MERGE +DEFINER=`root`@`localhost` SQL SECURITY DEFINER +VIEW `v1` AS select `t1a`.`ft1` AS `ft1`,`t1a`.`ft2` AS `ft2`,`t1a`.`ft3` AS `ft3`,`t1a`.`ft4` AS `ft4`,`t1a`.`ft5` AS `ft5`,`t1a`.`ft6` AS `ft6`,`t1a`.`ft6_2` AS `ft6_2`,`t1a`.`ft7` AS `ft7`,`t1a`.`ft8` AS `ft8`,`t1a`.`ft9` AS `ft9`,`t1a`.`ft10` AS `ft10` from `t2` `t1a` where (if((`t1a`.`ft10` = 'virtuell'),0,1) = 1); + +CREATE ALGORITHM=UNDEFINED +DEFINER=`root`@`localhost` SQL SECURITY DEFINER +VIEW `v2` AS select distinct `t1b`.`fe2` AS `fe2`,min(`t1b`.`fe18`) AS `fe18`,max(`t1b`.`ft3`) AS `ft3` from `t3` `t1b` where ((`t1b`.`fe2` <> '') and (curdate() >= `t1b`.`fe18`)) group by `t1b`.`fe2`; + +CREATE ALGORITHM=UNDEFINED +DEFINER=`root`@`localhost` SQL SECURITY DEFINER +VIEW `v3` AS select `t1c`.`fe2` AS `fe2`,`t1c`.`f34` AS `f34`,`t1c`.`f33` AS `f33`,`t1c`.`f32` AS `f32`,`t1c`.`f37` AS `f37`,`t1c`.`fe10` AS `fe10`,if((`tov`.`ft6` in ('klarmobil','callmobile')),`tov`.`ft9`,`tov`.`ft6`) AS `ft6_1`,`tov`.`ft6_2` AS `ft6_2`,`ua`.`fe18` AS `fe18`,`ua`.`ft3` AS `ft3` from ((`t3` `t1c` left join `v2` `ua` on((`t1c`.`fe2` = `ua`.`fe2`))) left join `v1` `tov` on((`t1c`.`fe8` = `tov`.`ft4`))) where (`t1c`.`ft3` = `ua`.`ft3`) group by `t1c`.`fe2`,`t1c`.`f34`,`t1c`.`f33`,`t1c`.`f32` order by `t1c`.`f34`; + +UPDATE t1 t1 left join v3 t2 on t1.f4 = t2.fe2 SET t1.f20 = t2.ft6_1, t1.f32 = t2.f32, t1.f33 = t2.f33, t1.f37 = t2.f37 WHERE f5 >= '2015-02-01'; + +--echo #MDEV-8018: main.multi_update fails with --ps-protocol +prepare stmt1 from "UPDATE t1 t1 left join v3 t2 on t1.f4 = t2.fe2 SET t1.f20 = t2.ft6_1, t1.f32 = t2.f32, t1.f33 = t2.f33, t1.f37 = t2.f37 WHERE f5 >= '2015-02-01'"; +execute stmt1; +execute stmt1; +deallocate prepare stmt1; + +drop view v3,v2,v1; +drop table t1,t2,t3; --echo end of 5.5 tests diff --git a/mysql-test/t/mysql_upgrade_view.test b/mysql-test/t/mysql_upgrade_view.test new file mode 100644 index 00000000000..3ecf66d70a5 --- /dev/null +++ b/mysql-test/t/mysql_upgrade_view.test @@ -0,0 +1,132 @@ +-- source include/have_log_bin.inc + +set sql_log_bin=0; +--disable_warnings +drop table if exists t1,v1,v2,v3,v4,v1badcheck; +drop view if exists t1,v1,v2,v3,v4,v1badcheck; +--enable_warnings + +create table t1(a int); +create table kv(k varchar(30) NOT NULL PRIMARY KEY,v varchar(50)); + +let $MYSQLD_DATADIR= `select @@datadir`; + +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v1.frm $MYSQLD_DATADIR/test/v1.frm +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v1badcheck.frm $MYSQLD_DATADIR/test/v1badcheck.frm +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v2.frm $MYSQLD_DATADIR/test/v2.frm +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v3.frm $MYSQLD_DATADIR/test/v3.frm + +flush tables; + +check view v1; +check view v1badcheck; +check view v2; +check view v3; + +check view v1 for upgrade; +check view v1badcheck for upgrade; +check view v2 for upgrade; +check view v3 for upgrade; + +--replace_result $MYSQLTEST_VARDIR var +--exec $MYSQL_UPGRADE --force 2>&1 + +# "Phase 1/4: Fixing views" expected (without from_mysql) + +show create view v1; +show create view v2; +show create view v3; + +# Now force a mariadb version to be added + +set sql_log_bin=1; +REPAIR VIEW v1,v2; +REPAIR VIEW v1badcheck; +REPAIR NO_WRITE_TO_BINLOG VIEW v3; +set sql_log_bin=0; + +--source include/show_binlog_events.inc + +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +eval LOAD DATA INFILE '$MYSQLD_DATADIR/test/v1.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '='; +SELECT k,v from kv where k in ('md5','algorithm'); +SELECT k from kv where k ='mariadb-version'; +truncate table kv; + +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +eval LOAD DATA INFILE '$MYSQLD_DATADIR/test/v2.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '='; +SELECT k,v from kv where k in ('md5','algorithm'); +SELECT k from kv where k ='mariadb-version'; +truncate table kv; + +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +eval LOAD DATA INFILE '$MYSQLD_DATADIR/test/v3.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '='; +SELECT k,v from kv where k in ('md5','algorithm'); +SELECT k from kv where k ='mariadb-version'; +truncate table kv; + +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +eval LOAD DATA INFILE '$MYSQLD_DATADIR/test/v1badcheck.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '='; +SELECT k,v from kv where k in ('md5','algorithm'); +SELECT k from kv where k ='mariadb-version'; +truncate table kv; + +--disable_warnings +drop view if exists v1,v2,v3,v1badcheck; +--enable_warnings + +# Make it look like a MySQL directory now + +rename table mysql.event to mysql.ev_bk; +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/event.MYI $MYSQLD_DATADIR/mysql/event.MYI +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/event.MYD $MYSQLD_DATADIR/mysql/event.MYD +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/event.frm $MYSQLD_DATADIR/mysql/event.frm + +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v1.frm $MYSQLD_DATADIR/test/v1.frm +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v2.frm $MYSQLD_DATADIR/test/v2.frm +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v3.frm $MYSQLD_DATADIR/test/v3.frm + +flush tables; + +create algorithm=temptable view v4 as select a from t1; +show create view v1; +show create view v2; +show create view v3; +show create view v4; + +# here we test the fixing views from mysql to occur +--replace_result $MYSQLTEST_VARDIR var +--exec $MYSQL_UPGRADE --force 2>&1 + +show create view v1; +show create view v2; +show create view v3; +show create view v4; + +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +eval LOAD DATA INFILE '$MYSQLD_DATADIR/test/v1.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '='; +SELECT k,v from kv where k in ('md5','algorithm'); +SELECT k from kv where k ='mariadb-version'; +truncate table kv; + +--disable_warnings +drop view if exists v1,v2,v3; +--enable_warnings + +# back to mariadb default +drop table mysql.event; +rename table mysql.ev_bk to mysql.event; + +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v1.frm $MYSQLD_DATADIR/test/v1.frm +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v2.frm $MYSQLD_DATADIR/test/v2.frm +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v3.frm $MYSQLD_DATADIR/test/v3.frm + +# check of binlog and mixing tables (with table specific options) and views +--exec $MYSQL_CHECK --repair --write-binlog --process-tables --use-frm --process-views=UPGRADE_FROM_MYSQL test 2>&1 + +--source include/show_binlog_events.inc + +drop table if exists kv; +drop view v1,v2,v3,v4; +drop table t1; + diff --git a/mysql-test/t/mysqladmin.test b/mysql-test/t/mysqladmin.test index c04c8d50f3c..2580db88456 100644 --- a/mysql-test/t/mysqladmin.test +++ b/mysql-test/t/mysqladmin.test @@ -45,3 +45,9 @@ EOF --exec $MYSQLADMIN --defaults-extra-file=$MYSQLTEST_VARDIR/tmp/cnf_file -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT ping 2>&1 --remove_file $MYSQLTEST_VARDIR/tmp/cnf_file + +# +# MDEV-7883 Segmentation failure when running mysqladmin -u root -p +# +--error 1 +--exec $MYSQLADMIN -u root -p 2>&1 > /dev/null diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index 917a4d509e0..e36f106a5be 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -15,8 +15,8 @@ insert into t1 values (5); grant select on test.* to ssl_user1@localhost require SSL; grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA"; -grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client"; -grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client" ISSUER "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA"; +grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB/CN=client"; +grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB/CN=client" ISSUER "/CN=cacert/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB"; grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx"; flush privileges; diff --git a/mysql-test/t/sp-destruct.test b/mysql-test/t/sp-destruct.test index e109f88e3f9..880bbce3d9d 100644 --- a/mysql-test/t/sp-destruct.test +++ b/mysql-test/t/sp-destruct.test @@ -278,3 +278,11 @@ DROP DATABASE db1; --echo # Restore mysql.proc DROP TABLE mysql.proc; RENAME TABLE proc_backup TO mysql.proc; + +# +# BUG#19875331 - HANDLE_FATAL_SIGNAL 11 IN STRMAKE +# +create database mysqltest1; +create procedure mysqltest1.foo() select "foo"; +update mysql.proc set name='' where db='mysqltest1'; +drop database mysqltest1; diff --git a/mysql-test/t/sp-innodb.test b/mysql-test/t/sp-innodb.test index 228ab42544d..23715166a02 100644 --- a/mysql-test/t/sp-innodb.test +++ b/mysql-test/t/sp-innodb.test @@ -43,3 +43,120 @@ CALL p1(); drop procedure p1; drop table t1,t2; + +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + +--echo +--echo # +--echo # BUG 16041903: CONTINUE HANDLER NOT INVOKED +--echo # IN A STORED FUNCTION AFTER A LOCK WAIT TIMEOUT +--echo # + +--echo +--echo # Save and set lock wait timeout +SET @lock_wait_timeout_saved= @@lock_wait_timeout; +SET @innodb_lock_wait_timeout_saved= @@innodb_lock_wait_timeout; +SET @@lock_wait_timeout= 1; +SET @@innodb_lock_wait_timeout= 1; + +--echo +--echo # Create a function with exit handler: +DELIMITER //; +CREATE FUNCTION f1() RETURNS VARCHAR(20) +BEGIN + DECLARE EXIT HANDLER FOR SQLSTATE '42S02' RETURN 'No such table'; + INSERT INTO no_such_table VALUES (1); +END// + +--echo +--echo # Create a function calling f1(): +CREATE FUNCTION f2() RETURNS VARCHAR(20) +BEGIN + RETURN f1(); +END// + +--echo +--echo # Create a function provoking deadlock: +CREATE FUNCTION f3() RETURNS VARCHAR(20) +BEGIN + UPDATE t1 SET i= 1 WHERE i= 1; + RETURN 'Will never get here'; +END// + +--echo +--echo # Create a function calling f3, to create +--echo # a deadlock indirectly: +CREATE FUNCTION f4() RETURNS VARCHAR(20) +BEGIN + RETURN f3(); +END// +DELIMITER ;// + +--echo +--echo # Open another connection, create and initialize a table +--echo # to be used for provoking deadlock, put a lock on the table: +connect (con1,localhost,root,,); +CREATE TABLE t1 (i INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +SET AUTOCOMMIT= 0; +UPDATE t1 SET i=1 WHERE i=1; + +--echo +--echo # On the default connection, do an update to provoke a +--echo # deadlock, then call the function with handler. This case +--echo # fails without the patch (with error ER_NO_SUCH_TABLE): +--connection default +SET AUTOCOMMIT= 0; +--error ER_LOCK_WAIT_TIMEOUT +UPDATE t1 SET i=1 WHERE i=1; +SELECT f1() AS 'f1():'; + +--echo +--echo # Provoke another deadlock, then call the function with +--echo # handler indirectly. This case fails without the patch +--echo # (with error ER_NO_SUCH_TABLE): +--error ER_LOCK_WAIT_TIMEOUT +UPDATE t1 SET i= 1 WHERE i= 1; +SELECT f2() AS 'f2():'; + +--echo +--echo # Provoke yet another deadlock, but now from within a function, +--echo # then call the function with handler. This succeeds even +--echo # without the patch because is_fatal_sub_stmt_error is reset +--echo # in restore_sub_stmt after the failing function has been +--echo # executed. The test case is included anyway for better coverage: +--error ER_LOCK_WAIT_TIMEOUT +SELECT f3() AS 'f3():'; +SELECT f1() AS 'f1():'; + +--echo # Provoke yet another deadlock, but now from within a function, +--echo # calling another function, then call the function with handler. +--echo # This succeeds even without the patch because +--echo # is_fatal_sub_stmt_error is reset in restore_sub_stmt after +--echo # the failing function has been executed. The test case is +--echo # included anyway for better coverage: +--error ER_LOCK_WAIT_TIMEOUT +SELECT f4() AS 'f4():'; +SELECT f1() AS 'f1():'; + +--echo +--echo # Disconnect, drop functions and table: +--disconnect con1 +DROP FUNCTION f4; +DROP FUNCTION f3; +DROP FUNCTION f2; +DROP FUNCTION f1; +DROP TABLE t1; + +--echo +--echo # Reset lock wait timeouts +SET @@lock_wait_timeout= @lock_wait_timeout_saved; +SET @@innodb_lock_wait_timeout= @innodb_lock_wait_timeout_saved; + +--echo # +--echo # BUG 16041903: End of test case +--echo # + +# Wait till we reached the initial number of concurrent sessions +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/subselect_sj.test b/mysql-test/t/subselect_sj.test index 2c60e5645c3..c989cb22558 100644 --- a/mysql-test/t/subselect_sj.test +++ b/mysql-test/t/subselect_sj.test @@ -2693,5 +2693,16 @@ SET join_cache_level=@tmp_mdev5059; set optimizer_switch=@tmp_os_mdev5059; DROP TABLE t1,t2,t3,t4; +--echo # +--echo # MDEV-7911: crash in Item_cond::eval_not_null_tables +--echo # + +create table t1(a int); +insert into t1 values(1),(2),(3),(null); +--error ER_CANT_AGGREGATE_2COLLATIONS +explain +select 1 from t1 where _cp932 "1" in (select '1' from t1); +drop table t1; + # The following command must be the last one the file set optimizer_switch=@subselect_sj_tmp; diff --git a/mysql-test/t/subselect_sj2.test b/mysql-test/t/subselect_sj2.test index a82baf095c1..0bf9c6d9d10 100644 --- a/mysql-test/t/subselect_sj2.test +++ b/mysql-test/t/subselect_sj2.test @@ -1320,5 +1320,76 @@ SELECT * FROM t1 WHERE id in (select distinct id_agente from t2); DROP TABLE t1, t2; +--echo # +--echo # MDEV-7474: Semi-Join's DuplicateWeedout strategy skipped for some values of optimizer_search_depth +--echo # + +CREATE TABLE t1 ( + t1id BIGINT(20) NOT NULL, + code VARCHAR(20), + PRIMARY KEY (t1id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; + +CREATE TABLE t2 ( + t2id BIGINT(20) NOT NULL, + t1idref BIGINT(20) NOT NULL, + code VARCHAR(20), + PRIMARY KEY (t2id), + INDEX FK_T2_T1Id (t1idref), + CONSTRAINT FK_T2_T1Id FOREIGN KEY (t1idref) REFERENCES t1 (t1id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; + +CREATE TABLE t3 ( + t3idref BIGINT(20) NOT NULL, + t2idref BIGINT(20) NOT NULL, + sequencenumber INT(10) NOT NULL, + PRIMARY KEY (t3idref, t2idref), + INDEX FK_T3_T2Id (t2idref), + CONSTRAINT FK_T3_T2Id FOREIGN KEY (t2idref) REFERENCES t2 (t2id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; + +# Load up dummy data (needed to reproduce issue) +INSERT INTO t1 (t1id) VALUES (100001),(100017),(100018),(100026),(100027),(100028),(100029),(100030), +(100031),(100032),(100033),(100034),(100035),(100036),(100037),(100038),(100040),(100041),(100042), +(100043),(100044),(100045),(100046),(100047); + +INSERT IGNORE INTO t2 (t2id, t1idref) SELECT t1id, t1id FROM t1; + +# Now the test Data +INSERT IGNORE INTO t1 VALUES (200001, 'a'); +INSERT IGNORE INTO t2 (t2id, t1idref) VALUES (200011, 200001),(200012, 200001),(200013, 200001); +INSERT IGNORE INTO t3 VALUES (1, 200011, 1), (1, 200012, 2), (1, 200013, 3); + +set @tmp7474= @@optimizer_search_depth; +SET SESSION optimizer_search_depth = 1; + +let $query= +SELECT SQL_NO_CACHE +T2_0_.t1idref, +T2_0_.t2id +FROM + t2 T2_0_ +WHERE + T2_0_.t1idref IN ( + SELECT + T1_1_.t1id + FROM + t3 T3_0_ + INNER JOIN + t2 T2_1_ + ON T3_0_.t2idref=T2_1_.t2id + INNER JOIN + t1 T1_1_ + ON T2_1_.t1idref=T1_1_.t1id + WHERE + T3_0_.t3idref= 1 +); + +eval $query; +eval explain $query; + +drop table t3,t2,t1; +set optimizer_search_depth=@tmp7474; + --echo # This must be the last in the file: set optimizer_switch=@subselect_sj2_tmp; diff --git a/mysql-test/t/table_elim.test b/mysql-test/t/table_elim.test index 0d42dca57b7..24f48206013 100644 --- a/mysql-test/t/table_elim.test +++ b/mysql-test/t/table_elim.test @@ -610,3 +610,34 @@ SELECT t1.alpha3 FROM t1 LEFT JOIN ( t2 LEFT JOIN t3 ON t2.t3_code = t3.code ) DROP TABLE t1, t2, t3; SET optimizer_switch=@save_optimizer_switch; + +--echo # +--echo # MDEV-7893: table_elimination works wrong with on computed expression and compound unique key +--echo # (just a testcase) +CREATE TABLE t1 ( + PostID int(10) unsigned NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO t1 (PostID) VALUES (1), (2); + +CREATE TABLE t2 ( + VoteID int(10) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + EntityID int(10) unsigned NOT NULL, + UserID int(10) unsigned NOT NULL, + UNIQUE KEY EntityID (EntityID,UserID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO t2 (EntityID, UserID) VALUES (1, 30), (2, 30); + +SELECT t1.*, T.Voted as Voted +FROM +t1 LEFT JOIN ( + SELECT 1 AS Voted, EntityID + FROM t2 + WHERE t2.UserID = '20' ) AS T + ON T.EntityID = t1.PostID +WHERE t1.PostID='1' +LIMIT 1; + +DROP TABLE t1,t2; + diff --git a/mysql-test/t/trigger-trans.test b/mysql-test/t/trigger-trans.test index 82bee7aa224..c17202055e1 100644 --- a/mysql-test/t/trigger-trans.test +++ b/mysql-test/t/trigger-trans.test @@ -2,6 +2,9 @@ # (or just InnoDB storage engine) --source include/have_innodb.inc +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + --disable_warnings drop table if exists t1; --enable_warnings @@ -182,3 +185,54 @@ insert into t1 values ( 654, 'a'), ( 654, 'b'), ( 654, 'c'), select * from t2 order by b; drop trigger t1_after_insert; drop table t1,t2; + +--echo # +--echo #Bug#19683834 SOME INNODB ERRORS CAUSES STORED FUNCTION +--echo # AND TRIGGER HANDLERS TO BE IGNORED + +--echo #Code fixed in Bug#16041903 +--enable_connect_log + +CREATE TABLE t1 (id int unsigned PRIMARY KEY, val int DEFAULT 0) +ENGINE=InnoDB; +INSERT INTO t1 (id) VALUES (1), (2); + +CREATE TABLE t2 (id int PRIMARY KEY); +CREATE TABLE t3 LIKE t2; + +# Trigger with continue handler for ER_DUP_ENTRY(1062) +DELIMITER //; +CREATE TRIGGER bef_insert BEFORE INSERT ON t2 FOR EACH ROW +BEGIN + DECLARE CONTINUE HANDLER FOR 1062 BEGIN END; + INSERT INTO t3 (id) VALUES (NEW.id); + INSERT INTO t3 (id) VALUES (NEW.id); +END// +DELIMITER ;// + +# Transaction 1: Grab locks on t1 +START TRANSACTION; +UPDATE t1 SET val = val + 1; + +# Transaction 2: +--connect (con2,localhost,root,,test,,) +SET SESSION innodb_lock_wait_timeout = 2; +# Trigger lock timeout (1205) +--error ER_LOCK_WAIT_TIMEOUT +UPDATE t1 SET val = val + 1; + +# This insert should go through, as the continue handler should +# handle ER_DUP_ENTRY, even after ER_LOCK_WAIT_TIMEOUT (Bug#16041903) +INSERT INTO t2 (id) VALUES (1); + +# Cleanup +disconnect con2; +--source include/wait_until_disconnected.inc +connection default; + +DROP TABLE t3, t2, t1; + +--disable_connect_log + +# Wait till we reached the initial number of concurrent sessions +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/uniques_crash-7912.test b/mysql-test/t/uniques_crash-7912.test new file mode 100644 index 00000000000..8dc82f8f540 --- /dev/null +++ b/mysql-test/t/uniques_crash-7912.test @@ -0,0 +1,26 @@ +# +# MDEV-7912 +# +# multitable delete with wrongly set sort_buffer_size crashes in merge_buffers + +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/windows.inc + +call mtr.add_suppression("Out of memory"); + +set sql_mode=""; +--disable_warnings +drop table if exists t1,t2; +create table `t1` (`a` datetime not null) engine=InnoDB; +create table `t2` (`a` int not null) engine=innodb; +replace into t1 values (),(); +insert into t2 values(0); +set session sort_buffer_size = 1024*1024*1024*1024; +#Either fail with EE_OUTOFMEMORY, or succeed +--error 0 , 5 +delete d2 from t2 as d1, t1 as d2 where d1.a <=> d2.a; +--enable_warnings + +drop table t2; +drop table t1; diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c index 96b1f6a09e9..84626c02f8c 100644 --- a/plugin/server_audit/server_audit.c +++ b/plugin/server_audit/server_audit.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2013 Alexey Botchkov and SkySQL Ab +/* Copyright (C) 2013, 2015, Alexey Botchkov and SkySQL 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 @@ -14,8 +14,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#define PLUGIN_VERSION 0x102 -#define PLUGIN_STR_VERSION "1.2.0" +#define PLUGIN_VERSION 0x103 +#define PLUGIN_STR_VERSION "1.3.0" #include <my_config.h> #include <stdio.h> @@ -195,6 +195,9 @@ static char logging; static int internal_stop_logging= 0; static char incl_user_buffer[1024]; static char excl_user_buffer[1024]; +static char *big_buffer= NULL; +static size_t big_buffer_alloced= 0; +static unsigned int query_log_limit= 0; static char servhost[256]; static size_t servhost_len; @@ -237,14 +240,15 @@ static MYSQL_SYSVAR_STR(excl_users, excl_users, PLUGIN_VAR_RQCMDARG, /* bits in the event filter. */ #define EVENT_CONNECT 1 #define EVENT_QUERY_ALL 2 -#define EVENT_QUERY 26 +#define EVENT_QUERY 58 #define EVENT_TABLE 4 #define EVENT_QUERY_DDL 8 #define EVENT_QUERY_DML 16 +#define EVENT_QUERY_DCL 32 static const char *event_names[]= { - "CONNECT", "QUERY", "TABLE", "QUERY_DDL", "QUERY_DML", + "CONNECT", "QUERY", "TABLE", "QUERY_DDL", "QUERY_DML", "QUERY_DCL", NULL }; static TYPELIB events_typelib= @@ -289,6 +293,9 @@ static MYSQL_SYSVAR_STR(syslog_ident, syslog_ident, PLUGIN_VAR_RQCMDARG, static MYSQL_SYSVAR_STR(syslog_info, syslog_info, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC, "The <info> string to be added to the SYSLOG record.", NULL, NULL, ""); +static MYSQL_SYSVAR_UINT(query_log_limit, query_log_limit, + PLUGIN_VAR_OPCMDARG, "Limit on the length of the query string in a record.", + NULL, NULL, 1024, 0, 0x7FFFFFFF, 1); static const char *syslog_facility_names[]= { @@ -368,6 +375,7 @@ static struct st_mysql_sys_var* vars[] = { MYSQL_SYSVAR(syslog_ident), MYSQL_SYSVAR(syslog_facility), MYSQL_SYSVAR(syslog_priority), + MYSQL_SYSVAR(query_log_limit), NULL }; @@ -392,9 +400,11 @@ static struct st_mysql_show_var audit_status[]= static PSI_mutex_key key_LOCK_operations; static PSI_mutex_info mutex_key_list[]= {{ &key_LOCK_operations, "SERVER_AUDIT_plugin::lock_operations", +{{ &key_LOCK_bigbuffer, "SERVER_AUDIT_plugin::lock_bigbuffer", PSI_FLAG_GLOBAL}}; #endif static mysql_mutex_t lock_operations; +static mysql_mutex_t lock_bigbuffer; /* The Percona server and partly MySQL don't support */ /* launching client errors in the 'update_variable' methods. */ @@ -627,6 +637,18 @@ struct sa_keyword dml_keywords[]= }; +struct sa_keyword dcl_keywords[]= +{ + {6, "CREATE", &user_word, SQLCOM_DCL}, + {4, "DROP", &user_word, SQLCOM_DCL}, + {6, "RENAME", &user_word, SQLCOM_DCL}, + {5, "GRANT", 0, SQLCOM_DCL}, + {6, "REVOKE", 0, SQLCOM_DCL}, + {3, "SET", &password_word, SQLCOM_DCL}, + {0, NULL, 0, SQLCOM_DDL} +}; + + struct sa_keyword passwd_keywords[]= { {3, "SET", &password_word, SQLCOM_SET_OPTION}, @@ -887,6 +909,7 @@ static struct connection_info * #define SAFE_STRLEN(s) (s ? strlen(s) : 0) +static char empty_str[1]= { 0 }; static int is_space(char c) @@ -1093,11 +1116,15 @@ static size_t escape_string(const char *str, unsigned int len, break; if (*str == '\'') { + if (result+1 >= res_end) + break; *(result++)= '\\'; *(result++)= '\''; } else if (*str == '\\') { + if (result+1 >= res_end) + break; *(result++)= '\\'; *(result++)= '\\'; } @@ -1182,11 +1209,15 @@ no_password: break; if (*str == '\'') { + if (result+1 >= res_end) + break; *(result++)= '\\'; *(result++)= '\''; } else if (*str == '\\') { + if (result+1 >= res_end) + break; *(result++)= '\\'; *(result++)= '\\'; } @@ -1316,12 +1347,16 @@ static int log_statement_ex(const struct connection_info *cn, const char *query, unsigned int query_len, int error_code, const char *type) { - size_t csize, esc_q_len; - char message[1024]; - char uh_buffer[768]; + size_t csize; + char message_loc[1024]; + char *message= message_loc; + size_t message_size= sizeof(message_loc); + char *uh_buffer; + size_t uh_buffer_size; const char *db; unsigned int db_length; long long query_id; + int result; if ((db= cn->db)) db_length= cn->db_length; @@ -1334,14 +1369,6 @@ static int log_statement_ex(const struct connection_info *cn, if (!(query_id= cn->query_id)) query_id= query_counter++; - csize= log_header(message, sizeof(message)-1, &ev_time, - servhost, servhost_len, - cn->user, cn->user_length,cn->host, cn->host_length, - cn->ip, cn->ip_length, thd_id, query_id, type); - - csize+= my_snprintf(message+csize, sizeof(message) - 1 - csize, - ",%.*s", db_length, db); - if (query == 0) { /* Can happen after the error in mysqld_prepare_stmt() */ @@ -1383,45 +1410,89 @@ static int log_statement_ex(const struct connection_info *cn, if (filter_query_type(query, dml_keywords)) goto do_log_query; } + if (events & EVENT_QUERY_DCL) + { + if (filter_query_type(query, dcl_keywords)) + goto do_log_query; + } return 0; do_log_query: query= orig_query; } + csize= log_header(message, message_size-1, &ev_time, + servhost, servhost_len, + cn->user, cn->user_length,cn->host, cn->host_length, + cn->ip, cn->ip_length, thd_id, query_id, type); + + csize+= my_snprintf(message+csize, message_size - 1 - csize, + ",%.*s,\'", db_length, db); + + if (query_log_limit > 0 && query_len > query_log_limit) + query_len= query_log_limit; + + if (query_len > (message_size - csize)/2) + { + flogger_mutex_lock(&lock_bigbuffer); + if (big_buffer_alloced < (query_len * 2 + csize)) + { + big_buffer_alloced= (query_len * 2 + csize + 4095) & ~4095L; + big_buffer= realloc(big_buffer, big_buffer_alloced); + if (big_buffer == NULL) + { + big_buffer_alloced= 0; + return 0; + } + } + + memcpy(big_buffer, message, csize); + message= big_buffer; + message_size= big_buffer_alloced; + } + + uh_buffer= message + csize; + uh_buffer_size= message_size - csize; + if (query_log_limit > 0 && uh_buffer_size > query_log_limit+2) + uh_buffer_size= query_log_limit+2; + switch (filter_query_type(query, passwd_keywords)) { case SQLCOM_GRANT: case SQLCOM_CREATE_USER: - esc_q_len= escape_string_hide_passwords(query, query_len, - uh_buffer, sizeof(uh_buffer), + csize+= escape_string_hide_passwords(query, query_len, + uh_buffer, uh_buffer_size, "IDENTIFIED", 10, "BY", 2, 0); break; case SQLCOM_CHANGE_MASTER: - esc_q_len= escape_string_hide_passwords(query, query_len, - uh_buffer, sizeof(uh_buffer), + csize+= escape_string_hide_passwords(query, query_len, + uh_buffer, uh_buffer_size, "MASTER_PASSWORD", 15, "=", 1, 0); break; case SQLCOM_CREATE_SERVER: case SQLCOM_ALTER_SERVER: - esc_q_len= escape_string_hide_passwords(query, query_len, - uh_buffer, sizeof(uh_buffer), + csize+= escape_string_hide_passwords(query, query_len, + uh_buffer, uh_buffer_size, "PASSWORD", 8, NULL, 0, 0); break; case SQLCOM_SET_OPTION: - esc_q_len= escape_string_hide_passwords(query, query_len, - uh_buffer, sizeof(uh_buffer), + csize+= escape_string_hide_passwords(query, query_len, + uh_buffer, uh_buffer_size, "=", 1, NULL, 0, 1); break; default: - esc_q_len= escape_string(query, query_len, - uh_buffer, sizeof(uh_buffer)); + csize+= escape_string(query, query_len, + uh_buffer, uh_buffer_size); break; } - csize+= my_snprintf(message+csize, sizeof(message) - 1 - csize, - ",\'%.*s\',%d", esc_q_len, uh_buffer, error_code); + csize+= my_snprintf(message+csize, message_size - 1 - csize, + "\',%d", error_code); message[csize]= '\n'; - return write_log(message, csize + 1); + result= write_log(message, csize + 1); + if (message == big_buffer) + flogger_mutex_unlock(&lock_bigbuffer); + + return result; } @@ -1989,6 +2060,7 @@ static int server_audit_init(void *p __attribute__((unused))) PSI_server->register_mutex("server_audit", mutex_key_list, 1); #endif flogger_mutex_init(key_LOCK_operations, &lock_operations, MY_MUTEX_INIT_FAST); + flogger_mutex_init(key_LOCK_operations, &lock_bigbuffer, MY_MUTEX_INIT_FAST); my_hash_clear(&incl_user_hash); my_hash_clear(&excl_user_hash); @@ -2065,7 +2137,10 @@ static int server_audit_deinit(void *p __attribute__((unused))) logger_close(logfile); else if (output_type == OUTPUT_SYSLOG) closelog(); + + (void) free(big_buffer); flogger_mutex_destroy(&lock_operations); + flogger_mutex_destroy(&lock_bigbuffer); error_header(); fprintf(stderr, "STOPPED\n"); @@ -2166,10 +2241,12 @@ static void update_file_path(MYSQL_THD thd, struct st_mysql_sys_var *var __attribute__((unused)), void *var_ptr __attribute__((unused)), const void *save) { + char *new_name= (*(char **) save) ? *(char **) save : empty_str; + flogger_mutex_lock(&lock_operations); internal_stop_logging= 1; error_header(); - fprintf(stderr, "Log file name was changed to '%s'.\n", *(const char **) save); + fprintf(stderr, "Log file name was changed to '%s'.\n", new_name); if (logging) log_current_query(thd); @@ -2178,7 +2255,7 @@ static void update_file_path(MYSQL_THD thd, { char *sav_path= file_path; - file_path= *(char **) save; + file_path= new_name; internal_stop_logging= 1; stop_logging(); if (start_logging()) @@ -2198,7 +2275,7 @@ static void update_file_path(MYSQL_THD thd, internal_stop_logging= 0; } - strncpy(path_buffer, *(const char **) save, sizeof(path_buffer)); + strncpy(path_buffer, new_name, sizeof(path_buffer)); file_path= path_buffer; exit_func: internal_stop_logging= 0; @@ -2245,9 +2322,10 @@ static void update_incl_users(MYSQL_THD thd, struct st_mysql_sys_var *var __attribute__((unused)), void *var_ptr __attribute__((unused)), const void *save) { + char *new_users= (*(char **) save) ? *(char **) save : empty_str; flogger_mutex_lock(&lock_operations); mark_always_logged(thd); - strncpy(incl_user_buffer, *(const char **) save, sizeof(incl_user_buffer)); + strncpy(incl_user_buffer, new_users, sizeof(incl_user_buffer)); incl_users= incl_user_buffer; user_hash_fill(&incl_user_hash, incl_users, &excl_user_hash, 1); error_header(); @@ -2260,9 +2338,10 @@ static void update_excl_users(MYSQL_THD thd __attribute__((unused)), struct st_mysql_sys_var *var __attribute__((unused)), void *var_ptr __attribute__((unused)), const void *save) { + char *new_users= (*(char **) save) ? *(char **) save : empty_str; flogger_mutex_lock(&lock_operations); mark_always_logged(thd); - strncpy(excl_user_buffer, *(const char **) save, sizeof(excl_user_buffer)); + strncpy(excl_user_buffer, new_users, sizeof(excl_user_buffer)); excl_users= excl_user_buffer; user_hash_fill(&excl_user_hash, excl_users, &incl_user_hash, 0); error_header(); @@ -2387,8 +2466,8 @@ static void update_syslog_ident(MYSQL_THD thd __attribute__((unused)), struct st_mysql_sys_var *var __attribute__((unused)), void *var_ptr __attribute__((unused)), const void *save) { - strncpy(syslog_ident_buffer, *(const char **) save, - sizeof(syslog_ident_buffer)); + char *new_ident= (*(char **) save) ? *(char **) save : empty_str; + strncpy(syslog_ident_buffer, new_ident, sizeof(syslog_ident_buffer)); syslog_ident= syslog_ident_buffer; error_header(); fprintf(stderr, "SYSYLOG ident was changed to '%s'\n", syslog_ident); diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 98cc79c558a..fdb4464a98f 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -521,7 +521,7 @@ if [ -n "${PLUGIN_DIR}" ]; then plugin_dir="${PLUGIN_DIR}" else # Try to find plugin dir relative to basedir - for dir in lib/mysql/plugin lib/plugin + for dir in lib64/mysql/plugin lib64/plugin lib/mysql/plugin lib/plugin do if [ -d "${MY_BASEDIR_VERSION}/${dir}" ]; then plugin_dir="${MY_BASEDIR_VERSION}/${dir}" diff --git a/sql-common/client.c b/sql-common/client.c index 4b443680e7b..c180986cbe9 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1942,7 +1942,7 @@ static int ssl_verify_server_cert(Vio *vio, const char* server_hostname, const c SSL *ssl; X509 *server_cert; char *cp1, *cp2; - char buf[256]; + char *buf; DBUG_ENTER("ssl_verify_server_cert"); DBUG_PRINT("enter", ("server_hostname: %s", server_hostname)); @@ -1976,9 +1976,15 @@ static int ssl_verify_server_cert(Vio *vio, const char* server_hostname, const c are what we expect. */ - X509_NAME_oneline(X509_get_subject_name(server_cert), buf, sizeof(buf)); + buf= X509_NAME_oneline(X509_get_subject_name(server_cert), 0, 0); X509_free (server_cert); + if (!buf) + { + *errptr= "Out of memory"; + DBUG_RETURN(1); + } + DBUG_PRINT("info", ("hostname in cert: %s", buf)); cp1= strstr(buf, "/CN="); if (cp1) @@ -1991,11 +1997,13 @@ static int ssl_verify_server_cert(Vio *vio, const char* server_hostname, const c DBUG_PRINT("info", ("Server hostname in cert: %s", cp1)); if (!strcmp(cp1, server_hostname)) { + free(buf); /* Success */ DBUG_RETURN(0); } } *errptr= "SSL certificate validation failure"; + free(buf); DBUG_RETURN(1); } diff --git a/sql/field.h b/sql/field.h index 6f4bcc638c9..8d76f54e216 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1,7 +1,7 @@ #ifndef FIELD_INCLUDED #define FIELD_INCLUDED /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2008, 2014, SkySQL Ab. + Copyright (c) 2008, 2015, MariaDB 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 @@ -2561,6 +2561,14 @@ public: int store(longlong nr, bool unsigned_val); int store_decimal(const my_decimal *); uint size_of() const { return sizeof(*this); } + /** + Key length is provided only to support hash joins. (compared byte for byte) + Ex: SELECT .. FROM t1,t2 WHERE t1.field_geom1=t2.field_geom2. + + The comparison is not very relevant, as identical geometry might be + represented differently, but we need to support it either way. + */ + uint32 key_length() const { return packlength; } /** Non-nullable GEOMETRY types cannot have defaults, diff --git a/sql/item.cc b/sql/item.cc index 132cfa2846a..a465c2d4e36 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1,6 +1,6 @@ /* Copyright (c) 2000, 2014, Oracle and/or its affiliates. - Copyright (c) 2010, 2014, Monty Program Ab. + Copyright (c) 2010, 2015, MariaDB 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 @@ -7931,6 +7931,7 @@ bool Item_direct_view_ref::fix_fields(THD *thd, Item **reference) return TRUE; if (view->table && view->table->maybe_null) maybe_null= TRUE; + set_null_ref_table(); return FALSE; } @@ -9775,13 +9776,30 @@ void Item_ref::update_used_tables() (*ref)->update_used_tables(); } +void Item_direct_view_ref::update_used_tables() +{ + set_null_ref_table(); + Item_direct_ref::update_used_tables(); +} + + table_map Item_direct_view_ref::used_tables() const { - return get_depended_from() ? - OUTER_REF_TABLE_BIT : - ((view->is_merged_derived() || view->merged || !view->table) ? - (*ref)->used_tables() : - view->table->map); + DBUG_ASSERT(null_ref_table); + + if (get_depended_from()) + return OUTER_REF_TABLE_BIT; + + if (view->is_merged_derived() || view->merged || !view->table) + { + table_map used= (*ref)->used_tables(); + return (used ? + used : + ((null_ref_table != NO_NULL_TABLE) ? + null_ref_table->map : + (table_map)0 )); + } + return view->table->map; } table_map Item_direct_view_ref::not_null_tables() const diff --git a/sql/item.h b/sql/item.h index 7c61c5fc65f..ce757749217 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1,8 +1,8 @@ #ifndef SQL_ITEM_INCLUDED #define SQL_ITEM_INCLUDED -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2009, 2013 Monty Program Ab. +/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. + Copyright (c) 2009, 2015, MariaDB 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 @@ -3735,13 +3735,16 @@ class Item_direct_view_ref :public Item_direct_ref #define NO_NULL_TABLE (reinterpret_cast<TABLE *>(0x1)) + void set_null_ref_table() + { + if (!view->is_inner_table_of_outer_join() || + !(null_ref_table= view->get_real_join_table())) + null_ref_table= NO_NULL_TABLE; + } + bool check_null_ref() { - if (null_ref_table == NULL) - { - if (!(null_ref_table= view->get_real_join_table())) - null_ref_table= NO_NULL_TABLE; - } + DBUG_ASSERT(null_ref_table); if (null_ref_table != NO_NULL_TABLE && null_ref_table->null_row) { null_value= 1; @@ -3749,6 +3752,7 @@ class Item_direct_view_ref :public Item_direct_ref } return FALSE; } + public: Item_direct_view_ref(Name_resolution_context *context_arg, Item **item, const char *table_name_arg, @@ -3756,7 +3760,11 @@ public: TABLE_LIST *view_arg) :Item_direct_ref(context_arg, item, table_name_arg, field_name_arg), item_equal(0), view(view_arg), - null_ref_table(NULL) {} + null_ref_table(NULL) + { + if (fixed) + set_null_ref_table(); + } bool fix_fields(THD *, Item **); bool eq(const Item *item, bool binary_cmp) const; @@ -3774,7 +3782,9 @@ public: Item *equal_fields_propagator(uchar *arg); Item *replace_equal_field(uchar *arg); table_map used_tables() const; + void update_used_tables(); table_map not_null_tables() const; + bool const_item() const { return used_tables() == 0; } bool walk(Item_processor processor, bool walk_subquery, uchar *arg) { return (*ref)->walk(processor, walk_subquery, arg) || diff --git a/sql/item_geofunc.h b/sql/item_geofunc.h index 6d52661e5c9..94be38e26ee 100644 --- a/sql/item_geofunc.h +++ b/sql/item_geofunc.h @@ -2,7 +2,7 @@ #define ITEM_GEOFUNC_INCLUDED /* Copyright (c) 2000, 2010 Oracle and/or its affiliates. - Copyright (C) 2011 Monty Program Ab. + Copyright (C) 2011, 2015 MariaDB 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 @@ -116,7 +116,7 @@ class Item_func_point: public Item_geometry_func public: Item_func_point(Item *a, Item *b): Item_geometry_func(a, b) {} Item_func_point(Item *a, Item *b, Item *srid): Item_geometry_func(a, b, srid) {} - const char *func_name() const { return "st_point"; } + const char *func_name() const { return "point"; } String *val_str(String *); Field::geometry_type get_geometry_type() const; }; diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 8377a20e0a4..2886cb68f9b 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -3,7 +3,7 @@ /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. - Copyright (c) 2009, 2013, Monty Program Ab. + Copyright (c) 2009, 2015, MariaDB 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 @@ -937,7 +937,6 @@ public: Item_func_conv_charset(Item *a, CHARSET_INFO *cs, bool cache_if_const) :Item_str_func(a) { - DBUG_ASSERT(args[0]->fixed); conv_charset= cs; if (cache_if_const && args[0]->const_item() && !args[0]->is_expensive()) { diff --git a/sql/lex.h b/sql/lex.h index 10a52160cf0..a272504c0f2 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -1,7 +1,8 @@ #ifndef LEX_INCLUDED #define LEX_INCLUDED -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. + Copyright (c) 2009, 2015, MariaDB 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 @@ -389,6 +390,7 @@ static SYMBOL symbols[] = { { "MULTIPOINT", SYM(MULTIPOINT)}, { "MULTIPOLYGON", SYM(MULTIPOLYGON)}, { "MUTEX", SYM(MUTEX_SYM)}, + { "MYSQL", SYM(MYSQL_SYM)}, { "MYSQL_ERRNO", SYM(MYSQL_ERRNO_SYM)}, { "NAME", SYM(NAME_SYM)}, { "NAMES", SYM(NAMES_SYM)}, diff --git a/sql/log.cc b/sql/log.cc index 850b685be83..99d3fb69b18 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2009, 2014, SkySQL Ab. + Copyright (c) 2009, 2015, MariaDB 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 @@ -2493,6 +2493,8 @@ bool MYSQL_LOG::open( char buff[FN_REFLEN]; MY_STAT f_stat; File file= -1; + my_off_t seek_offset; + bool is_fifo = false; int open_flags= O_CREAT | O_BINARY; DBUG_ENTER("MYSQL_LOG::open"); DBUG_PRINT("enter", ("log_type: %d", (int) log_type_arg)); @@ -2509,15 +2511,17 @@ bool MYSQL_LOG::open( log_type_arg, io_cache_type_arg)) goto err; - /* File is regular writable file */ - if (my_stat(log_file_name, &f_stat, MYF(0)) && !MY_S_ISREG(f_stat.st_mode)) - goto err; + is_fifo = my_stat(log_file_name, &f_stat, MYF(0)) && + MY_S_ISFIFO(f_stat.st_mode); if (io_cache_type == SEQ_READ_APPEND) open_flags |= O_RDWR | O_APPEND; else open_flags |= O_WRONLY | (log_type == LOG_BIN ? 0 : O_APPEND); + if (is_fifo) + open_flags |= O_NONBLOCK; + db[0]= 0; #ifdef HAVE_PSI_INTERFACE @@ -2525,11 +2529,16 @@ bool MYSQL_LOG::open( m_log_file_key= log_file_key; #endif - if ((file= mysql_file_open(log_file_key, - log_file_name, open_flags, - MYF(MY_WME | ME_WAITTANG))) < 0 || - init_io_cache(&log_file, file, IO_SIZE, io_cache_type, - mysql_file_tell(file, MYF(MY_WME)), 0, + if ((file= mysql_file_open(log_file_key, log_file_name, open_flags, + MYF(MY_WME | ME_WAITTANG))) < 0) + goto err; + + if (is_fifo) + seek_offset= 0; + else if ((seek_offset= mysql_file_tell(file, MYF(MY_WME)))) + goto err; + + if (init_io_cache(&log_file, file, IO_SIZE, io_cache_type, seek_offset, 0, MYF(MY_WME | MY_NABP | ((log_type == LOG_BIN) ? MY_WAIT_IF_FULL : 0)))) goto err; @@ -2618,17 +2627,17 @@ void MYSQL_LOG::close(uint exiting) { end_io_cache(&log_file); - if (mysql_file_sync(log_file.file, MYF(MY_WME)) && ! write_error) + if (log_type == LOG_BIN && mysql_file_sync(log_file.file, MYF(MY_WME)) && ! write_error) { write_error= 1; - sql_print_error(ER(ER_ERROR_ON_WRITE), name, errno); + sql_print_error(ER_THD_OR_DEFAULT(current_thd, ER_ERROR_ON_WRITE), name, errno); } if (!(exiting & LOG_CLOSE_DELAYED_CLOSE) && mysql_file_close(log_file.file, MYF(MY_WME)) && ! write_error) { write_error= 1; - sql_print_error(ER(ER_ERROR_ON_WRITE), name, errno); + sql_print_error(ER_THD_OR_DEFAULT(current_thd, ER_ERROR_ON_WRITE), name, errno); } } @@ -6665,6 +6674,10 @@ bool MYSQL_BIN_LOG::write_incident(THD *thd) if (check_purge) checkpoint_and_purge(prev_binlog_id); } + else + { + mysql_mutex_unlock(&LOCK_log); + } DBUG_RETURN(error); } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 1df6622b9e7..2eaf8096795 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1,5 +1,5 @@ -/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. - Copyright (c) 2008, 2014, SkySQL Ab. +/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. + Copyright (c) 2008, 2015, MariaDB 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 @@ -2251,7 +2251,8 @@ static struct passwd *check_user(const char *user) { if (!opt_bootstrap && !opt_help) { - sql_print_error("Fatal error: Please read \"Security\" section of the manual to find out how to run mysqld as root!\n"); + sql_print_error("Fatal error: Please consult the Knowledge Base " + "to find out how to run mysqld as root!\n"); unireg_abort(1); } return NULL; @@ -4068,6 +4069,10 @@ static int init_common_variables() return 1; set_server_version(); + if (!opt_help) + sql_print_information("%s (mysqld %s) starting as process %lu ...", + my_progname, server_version, (ulong) getpid()); + #ifndef EMBEDDED_LIBRARY if (opt_abort && !opt_verbose) unireg_abort(0); diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 2122349f324..0ad90e2ef3d 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2010, 2012, Monty Program Ab + Copyright (c) 2010, 2015, MariaDB 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 @@ -1611,9 +1611,20 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred) sj_nest->sj_on_expr= and_items(sj_nest->sj_on_expr, item_eq); } } - /* Fix the created equality and AND */ - if (!sj_nest->sj_on_expr->fixed) - sj_nest->sj_on_expr->fix_fields(parent_join->thd, &sj_nest->sj_on_expr); + /* + Fix the created equality and AND + + Note that fix_fields() can actually fail in a meaningful way here. One + example is when the IN-equality is not valid, because it compares columns + with incompatible collations. (One can argue it would be more appropriate + to check for this at name resolution stage, but as a legacy of IN->EXISTS + we have in here). + */ + if (!sj_nest->sj_on_expr->fixed && + sj_nest->sj_on_expr->fix_fields(parent_join->thd, &sj_nest->sj_on_expr)) + { + DBUG_RETURN(TRUE); + } /* Walk through sj nest's WHERE and ON expressions and call @@ -1632,12 +1643,15 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred) /* Inject sj_on_expr into the parent's WHERE or ON */ if (emb_tbl_nest) { - emb_tbl_nest->on_expr= and_items(emb_tbl_nest->on_expr, + emb_tbl_nest->on_expr= and_items(emb_tbl_nest->on_expr, sj_nest->sj_on_expr); emb_tbl_nest->on_expr->top_level_item(); - if (!emb_tbl_nest->on_expr->fixed) - emb_tbl_nest->on_expr->fix_fields(parent_join->thd, - &emb_tbl_nest->on_expr); + if (!emb_tbl_nest->on_expr->fixed && + emb_tbl_nest->on_expr->fix_fields(parent_join->thd, + &emb_tbl_nest->on_expr)) + { + DBUG_RETURN(TRUE); + } } else { @@ -1650,8 +1664,12 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred) */ save_lex= thd->lex->current_select; thd->lex->current_select=parent_join->select_lex; - if (!parent_join->conds->fixed) - parent_join->conds->fix_fields(parent_join->thd, &parent_join->conds); + if (!parent_join->conds->fixed && + parent_join->conds->fix_fields(parent_join->thd, + &parent_join->conds)) + { + DBUG_RETURN(1); + } thd->lex->current_select=save_lex; parent_join->select_lex->where= parent_join->conds; } @@ -2508,10 +2526,16 @@ void advance_sj_state(JOIN *join, table_map remaining_tables, uint idx, LooseScan detector in best_access_path) */ remaining_tables &= ~new_join_tab->table->map; - pos->prefix_dups_producing_tables= join->cur_dups_producing_tables; + table_map dups_producing_tables; + + if (idx == join->const_tables) + dups_producing_tables= 0; + else + dups_producing_tables= pos[-1].dups_producing_tables; + TABLE_LIST *emb_sj_nest; if ((emb_sj_nest= new_join_tab->emb_sj_nest)) - join->cur_dups_producing_tables |= emb_sj_nest->sj_inner_tables; + dups_producing_tables |= emb_sj_nest->sj_inner_tables; Semi_join_strategy_picker **strategy; if (idx == join->const_tables) @@ -2564,7 +2588,7 @@ void advance_sj_state(JOIN *join, table_map remaining_tables, uint idx, fanout from semijoin X. 3. We have no clue what to do about fanount of semi-join Y. */ - if ((join->cur_dups_producing_tables & handled_fanout) || + if ((dups_producing_tables & handled_fanout) || (read_time < *current_read_time && !(handled_fanout & pos->inner_tables_handled_with_other_sjs))) { @@ -2577,7 +2601,7 @@ void advance_sj_state(JOIN *join, table_map remaining_tables, uint idx, join->sjm_lookup_tables &= ~handled_fanout; *current_read_time= read_time; *current_record_count= rec_count; - join->cur_dups_producing_tables &= ~handled_fanout; + dups_producing_tables &= ~handled_fanout; //TODO: update bitmap of semi-joins that were handled together with // others. if (is_multiple_semi_joins(join, join->positions, idx, handled_fanout)) @@ -2604,6 +2628,7 @@ void advance_sj_state(JOIN *join, table_map remaining_tables, uint idx, pos->prefix_cost.convert_from_cost(*current_read_time); pos->prefix_record_count= *current_record_count; + pos->dups_producing_tables= dups_producing_tables; } @@ -3115,8 +3140,6 @@ void restore_prev_sj_state(const table_map remaining_tables, tab->join->cur_sj_inner_tables &= ~emb_sj_nest->sj_inner_tables; } } - POSITION *pos= tab->join->positions + idx; - tab->join->cur_dups_producing_tables= pos->prefix_dups_producing_tables; } diff --git a/sql/opt_subselect.h b/sql/opt_subselect.h index acfbebed6b3..3da94d05521 100644 --- a/sql/opt_subselect.h +++ b/sql/opt_subselect.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2010, 2012, Monty Program Ab + Copyright (c) 2010, 2015, MariaDB 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 @@ -299,7 +299,7 @@ public: }; -extern void advance_sj_state(JOIN *join, table_map remaining_tables, uint idx, +void advance_sj_state(JOIN *join, table_map remaining_tables, uint idx, double *current_record_count, double *current_read_time, POSITION *loose_scan_pos); void restore_prev_sj_state(const table_map remaining_tables, diff --git a/sql/slave.cc b/sql/slave.cc index 896270acf36..30d55f8bc2a 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1,5 +1,5 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2008, 2014, SkySQL Ab. +/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. + Copyright (c) 2008, 2015, MariaDB 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 @@ -6061,7 +6061,23 @@ static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi, } #endif - mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset_info->csname); + /* + If server's default charset is not supported (like utf16, utf32) as client + charset, then set client charset to 'latin1' (default client charset). + */ + if (is_supported_parser_charset(default_charset_info)) + mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset_info->csname); + else + { + sql_print_information("'%s' can not be used as client character set. " + "'%s' will be used as default client character set " + "while connecting to master.", + default_charset_info->csname, + default_client_charset_info->csname); + mysql_options(mysql, MYSQL_SET_CHARSET_NAME, + default_client_charset_info->csname); + } + /* This one is not strictly needed but we have it here for completeness */ mysql_options(mysql, MYSQL_SET_CHARSET_DIR, (char *) charsets_dir); diff --git a/sql/sp.cc b/sql/sp.cc index 35155cf031a..334b5e12ba3 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -1,5 +1,6 @@ /* - Copyright (c) 2002, 2011, Oracle and/or its affiliates. + Copyright (c) 2002, 2015, Oracle and/or its affiliates. + Copyright (c) 2009, 2015, MariaDB 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 @@ -1476,6 +1477,9 @@ bool lock_db_routines(THD *thd, char *db) { char *sp_name= get_field(thd->mem_root, table->field[MYSQL_PROC_FIELD_NAME]); + if (sp_name == NULL) // skip invalid sp names (hand-edited mysql.proc?) + continue; + longlong sp_type= table->field[MYSQL_PROC_MYSQL_TYPE]->val_int(); MDL_request *mdl_request= new (thd->mem_root) MDL_request; mdl_request->init(sp_type == TYPE_ENUM_FUNCTION ? diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index ce8302af0b3..afce7794dd7 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2010, 2014, Oracle and/or its affiliates. - Copyright (c) 2012, 2014, Monty Program Ab. + Copyright (c) 2012, 2015, MariaDB 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 @@ -309,7 +309,8 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, HA_CHECK_OPT *), int (handler::*operator_func)(THD *, HA_CHECK_OPT *), - int (view_operator_func)(THD *, TABLE_LIST*)) + int (view_operator_func)(THD *, TABLE_LIST*, + HA_CHECK_OPT *)) { TABLE_LIST *table; SELECT_LEX *select= &thd->lex->select_lex; @@ -393,7 +394,18 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, lex->query_tables_own_last= 0; if (view_operator_func == NULL) + { table->required_type=FRMTYPE_TABLE; + DBUG_ASSERT(!lex->only_view); + } + else if (lex->only_view) + { + table->required_type= FRMTYPE_VIEW; + } + else if (!lex->only_view && lex->sql_command == SQLCOM_REPAIR) + { + table->required_type= FRMTYPE_TABLE; + } if (lex->sql_command == SQLCOM_CHECK || lex->sql_command == SQLCOM_REPAIR || @@ -521,9 +533,9 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, } /* - CHECK TABLE command is only command where VIEW allowed here and this - command use only temporary teble method for VIEWs resolving => there - can't be VIEW tree substitition of join view => if opening table + CHECK/REPAIR TABLE command is only command where VIEW allowed here and + this command use only temporary table method for VIEWs resolving => + there can't be VIEW tree substitition of join view => if opening table succeed then table->table will have real TABLE pointer as value (in case of join view substitution table->table can be 0, but here it is impossible) @@ -536,7 +548,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, ER_CHECK_NO_SUCH_TABLE, ER(ER_CHECK_NO_SUCH_TABLE)); /* if it was a view will check md5 sum */ if (table->view && - view_checksum(thd, table) == HA_ADMIN_WRONG_CHECKSUM) + view_check(thd, table, check_opt) == HA_ADMIN_WRONG_CHECKSUM) push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_VIEW_CHECKSUM, ER(ER_VIEW_CHECKSUM)); if (thd->get_stmt_da()->is_error() && @@ -551,7 +563,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, if (table->view) { DBUG_PRINT("admin", ("calling view_operator_func")); - result_code= (*view_operator_func)(thd, table); + result_code= (*view_operator_func)(thd, table, check_opt); goto send_result; } @@ -968,7 +980,16 @@ send_result_message: size_t length; protocol->store(STRING_WITH_LEN("error"), system_charset_info); - if (table->table->file->ha_table_flags() & HA_CAN_REPAIR) +#if MYSQL_VERSION_ID > 100104 +#error fix the error message to take TABLE or VIEW as an argument +#else + if (table->view) + length= my_snprintf(buf, sizeof(buf), + "Upgrade required. Please do \"REPAIR VIEW %`s\" or dump/reload to fix it!", + table->table_name); + else +#endif + if (table->table->file->ha_table_flags() & HA_CAN_REPAIR || table->view) length= my_snprintf(buf, sizeof(buf), ER(ER_TABLE_NEEDS_UPGRADE), table->table_name); else @@ -1189,7 +1210,7 @@ bool Sql_cmd_check_table::execute(THD *thd) res= mysql_admin_table(thd, first_table, &m_lex->check_opt, "check", lock_type, 0, 0, HA_OPEN_FOR_REPAIR, 0, - &handler::ha_check, &view_checksum); + &handler::ha_check, &view_check); m_lex->select_lex.table_list.first= first_table; m_lex->query_tables= first_table; @@ -1246,7 +1267,7 @@ bool Sql_cmd_repair_table::execute(THD *thd) TL_WRITE, 1, MY_TEST(m_lex->check_opt.sql_flags & TT_USEFRM), HA_OPEN_FOR_REPAIR, &prepare_for_repair, - &handler::ha_repair, 0); + &handler::ha_repair, &view_repair); /* ! we write after unlocking the table */ if (!res && !m_lex->no_write_to_binlog) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index f337b3b6283..3731c646b20 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1,5 +1,5 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2010, 2013 Monty Program Ab +/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. + Copyright (c) 2010, 2015, MariaDB 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 @@ -3456,7 +3456,7 @@ request_backoff_action(enum_open_table_action action_arg, if (action_arg != OT_REOPEN_TABLES && m_has_locks) { my_error(ER_LOCK_DEADLOCK, MYF(0)); - mark_transaction_to_rollback(m_thd, true); + m_thd->mark_transaction_to_rollback(true); return TRUE; } /* @@ -6985,7 +6985,7 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter, Item_field for tables. */ Item_ident *item_ref= (Item_ident *) item; - if (item_ref->name && item_ref->table_name && + if (field_name && item_ref->name && item_ref->table_name && !my_strcasecmp(system_charset_info, item_ref->name, field_name) && !my_strcasecmp(table_alias_charset, item_ref->table_name, table_name) && diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 8c52d5dd92d..1ef0827b943 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1,6 +1,6 @@ /* - Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2008, 2014, SkySQL Ab. + Copyright (c) 2000, 2015, Oracle and/or its affiliates. + Copyright (c) 2008, 2015, MariaDB 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 @@ -881,7 +881,7 @@ THD::THD() failed_com_change_user(0), is_fatal_error(0), transaction_rollback_request(0), - is_fatal_sub_stmt_error(0), + is_fatal_sub_stmt_error(false), rand_used(0), time_zone_used(0), in_lock_tables(0), @@ -1520,6 +1520,7 @@ void THD::cleanup(void) mysql_ha_cleanup(this); locked_tables_list.unlock_locked_tables(this); + delete_dynamic(&user_var_events); close_temporary_tables(this); transaction.xid_state.xa_state= XA_NOTR; @@ -1551,7 +1552,6 @@ void THD::cleanup(void) debug_sync_end_thread(this); #endif /* defined(ENABLED_DEBUG_SYNC) */ - delete_dynamic(&user_var_events); my_hash_free(&user_vars); sp_cache_clear(&sp_proc_cache); sp_cache_clear(&sp_func_cache); @@ -4450,7 +4450,8 @@ extern "C" int thd_binlog_format(const MYSQL_THD thd) extern "C" void thd_mark_transaction_to_rollback(MYSQL_THD thd, bool all) { - mark_transaction_to_rollback(thd, all); + DBUG_ASSERT(thd); + thd->mark_transaction_to_rollback(all); } extern "C" bool thd_binlog_filter_ok(const MYSQL_THD thd) @@ -4691,9 +4692,12 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup) If we've left sub-statement mode, reset the fatal error flag. Otherwise keep the current value, to propagate it up the sub-statement stack. + + NOTE: is_fatal_sub_stmt_error can be set only if we've been in the + sub-statement mode. */ if (!in_sub_stmt) - is_fatal_sub_stmt_error= FALSE; + is_fatal_sub_stmt_error= false; if ((variables.option_bits & OPTION_BIN_LOG) && is_update_query(lex->sql_command) && !is_current_stmt_binlog_format_row()) @@ -4935,17 +4939,18 @@ void THD::get_definer(LEX_USER *definer, bool role) /** Mark transaction to rollback and mark error as fatal to a sub-statement. - @param thd Thread handle @param all TRUE <=> rollback main transaction. */ -void mark_transaction_to_rollback(THD *thd, bool all) +void THD::mark_transaction_to_rollback(bool all) { - if (thd) - { - thd->is_fatal_sub_stmt_error= TRUE; - thd->transaction_rollback_request= all; - } + /* + There is no point in setting is_fatal_sub_stmt_error unless + we are actually in_sub_stmt. + */ + if (in_sub_stmt) + is_fatal_sub_stmt_error= true; + transaction_rollback_request= all; } /*************************************************************************** Handling of XA id cacheing diff --git a/sql/sql_class.h b/sql/sql_class.h index 38e3a383208..0746ac79b97 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1,5 +1,6 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2009, 2013, Monty Program Ab. +/* + Copyright (c) 2000, 2015, Oracle and/or its affiliates. + Copyright (c) 2009, 2015, MariaDB 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 @@ -772,9 +773,6 @@ void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var); void add_diff_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var, STATUS_VAR *dec_var); -void mark_transaction_to_rollback(THD *thd, bool all); - - /** Get collation by name, send error to client on failure. @param name Collation name @@ -802,7 +800,6 @@ mysqld_collation_get_by_name(const char *name, return cs; } - #ifdef MYSQL_SERVER void free_tmp_table(THD *thd, TABLE *entry); @@ -3113,6 +3110,8 @@ public: if (get_stmt_da()->is_error()) get_stmt_da()->reset_diagnostics_area(); is_slave_error= 0; + if (killed == KILL_BAD_DATA) + killed= NOT_KILLED; // KILL_BAD_DATA can be reset w/o a mutex DBUG_VOID_RETURN; } #ifndef EMBEDDED_LIBRARY @@ -3704,6 +3703,7 @@ public: wait_for_commit_ptr= suspended; } + void mark_transaction_to_rollback(bool all); private: /** The current internal error handler for this thread, or NULL. */ @@ -4885,8 +4885,6 @@ public: */ #define CF_SKIP_QUESTIONS (1U << 1) -void mark_transaction_to_rollback(THD *thd, bool all); - /* Inline functions */ inline bool add_item_to_list(THD *thd, Item *item) diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 99b44e6008c..5292b964576 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -1,5 +1,6 @@ /* Copyright (c) 2000, 2010, Oracle and/or its affiliates. + Copyright (c) 2010, 2015, MariaDB 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 @@ -850,7 +851,7 @@ int mysql_multi_delete_prepare(THD *thd) */ lex->select_lex.exclude_from_table_unique_test= FALSE; - if (lex->select_lex.save_prep_leaf_tables(thd)) + if (lex->save_prep_leaf_tables()) DBUG_RETURN(TRUE); DBUG_RETURN(FALSE); diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index c68e7f490cc..fdc615d0fae 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -1,5 +1,6 @@ /* Copyright (c) 2002, 2011, Oracle and/or its affiliates. + Copyright (c) 2010, 2015, MariaDB 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 @@ -169,7 +170,9 @@ mysql_handle_single_derived(LEX *lex, TABLE_LIST *derived, uint phases) uint8 allowed_phases= (derived->is_merged_derived() ? DT_PHASES_MERGE : DT_PHASES_MATERIALIZE); DBUG_ENTER("mysql_handle_single_derived"); - DBUG_PRINT("enter", ("phases: 0x%x allowed: 0x%x", phases, allowed_phases)); + DBUG_PRINT("enter", ("phases: 0x%x allowed: 0x%x alias: '%s'", + phases, allowed_phases, + (derived->alias ? derived->alias : "<NULL>"))); if (!lex->derived_tables) DBUG_RETURN(FALSE); diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 697988a6bf8..ba7d101a4cd 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2000, 2014, Oracle and/or its affiliates. - Copyright (c) 2009, 2014, Monty Program Ab. + Copyright (c) 2009, 2015, MariaDB 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 @@ -4113,27 +4113,48 @@ bool st_select_lex::save_leaf_tables(THD *thd) } -bool st_select_lex::save_prep_leaf_tables(THD *thd) +bool LEX::save_prep_leaf_tables() { if (!thd->save_prep_leaf_list) - return 0; + return FALSE; Query_arena *arena= thd->stmt_arena, backup; arena= thd->activate_stmt_arena_if_needed(&backup); + //It is used for DETETE/UPDATE so top level has only one SELECT + DBUG_ASSERT(select_lex.next_select() == NULL); + bool res= select_lex.save_prep_leaf_tables(thd); + + if (arena) + thd->restore_active_arena(arena, &backup); + + if (res) + return TRUE; + thd->save_prep_leaf_list= FALSE; + return FALSE; +} + + +bool st_select_lex::save_prep_leaf_tables(THD *thd) +{ List_iterator_fast<TABLE_LIST> li(leaf_tables); TABLE_LIST *table; while ((table= li++)) { if (leaf_tables_prep.push_back(table)) - return 1; + return TRUE; + } + is_prep_leaf_list_saved= TRUE; + for (SELECT_LEX_UNIT *u= first_inner_unit(); u; u= u->next_unit()) + { + for (SELECT_LEX *sl= u->first_select(); sl; sl= sl->next_select()) + { + if (sl->save_prep_leaf_tables(thd)) + return TRUE; + } } - thd->lex->select_lex.is_prep_leaf_list_saved= TRUE; - thd->save_prep_leaf_list= FALSE; - if (arena) - thd->restore_active_arena(arena, &backup); - return 0; + return FALSE; } diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 88491743d39..38f1417b40c 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1,5 +1,5 @@ /* Copyright (c) 2000, 2014, Oracle and/or its affiliates. - Copyright (c) 2010, 2014, Monty Program Ab. + Copyright (c) 2010, 2015, MariaDB 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 @@ -2743,6 +2743,8 @@ struct LEX: public Query_tables_list return FALSE; } + bool save_prep_leaf_tables(); + int print_explain(select_result_sink *output, uint8 explain_flags, bool *printed_anything); }; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index eb222b2f95a..2aeddf2415d 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2014 Oracle and/or its affiliates. +/* Copyright (c) 2000, 2015 Oracle and/or its affiliates. Copyright (c) 2009, 2015 MariaDB This program is free software; you can redistribute it and/or modify @@ -709,9 +709,7 @@ JOIN::prepare(Item ***rref_pointer_array, if (!(select_options & OPTION_SETUP_TABLES_DONE) && setup_tables_and_check_access(thd, &select_lex->context, join_list, tables_list, select_lex->leaf_tables, - FALSE, SELECT_ACL, SELECT_ACL, - (thd->lex->sql_command == - SQLCOM_UPDATE_MULTI))) + FALSE, SELECT_ACL, SELECT_ACL, FALSE)) DBUG_RETURN(-1); /* @@ -6466,7 +6464,6 @@ choose_plan(JOIN *join, table_map join_tables) DBUG_ENTER("choose_plan"); join->cur_embedding_map= 0; - join->cur_dups_producing_tables= 0; reset_nj_counters(join, join->join_list); qsort2_cmp jtab_sort_func; @@ -21149,18 +21146,33 @@ SORT_FIELD *make_unireg_sortorder(ORDER *order, uint *length, for (;order;order=order->next,pos++) { - Item *item= order->item[0]->real_item(); + Item *const item= order->item[0], *const real_item= item->real_item(); pos->field= 0; pos->item= 0; - if (item->type() == Item::FIELD_ITEM) - pos->field= ((Item_field*) item)->field; - else if (item->type() == Item::SUM_FUNC_ITEM && !item->const_item()) - pos->field= ((Item_sum*) item)->get_tmp_table_field(); - else if (item->type() == Item::COPY_STR_ITEM) - { // Blob patch - pos->item= ((Item_copy*) item)->get_item(); + if (real_item->type() == Item::FIELD_ITEM) + { + // Could be a field, or Item_direct_view_ref wrapping a field + DBUG_ASSERT(item->type() == Item::FIELD_ITEM || + (item->type() == Item::REF_ITEM && + static_cast<Item_ref*>(item)->ref_type() == + Item_ref::VIEW_REF)); + pos->field= static_cast<Item_field*>(real_item)->field; + } + else if (real_item->type() == Item::SUM_FUNC_ITEM && + !real_item->const_item()) + { + // Aggregate, or Item_aggregate_ref + DBUG_ASSERT(item->type() == Item::SUM_FUNC_ITEM || + (item->type() == Item::REF_ITEM && + static_cast<Item_ref*>(item)->ref_type() == + Item_ref::AGGREGATE_REF)); + pos->field= item->get_tmp_table_field(); + } + else if (real_item->type() == Item::COPY_STR_ITEM) + { // Blob patch + pos->item= static_cast<Item_copy*>(real_item)->get_item(); } else - pos->item= *order->item; + pos->item= item; pos->reverse=! order->asc; DBUG_ASSERT(pos->field != NULL || pos->item != NULL); } @@ -21404,6 +21416,17 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables, uint el= all_fields.elements; all_fields.push_front(order_item); /* Add new field to field list. */ ref_pointer_array[el]= order_item; + /* + If the order_item is a SUM_FUNC_ITEM, when fix_fields is called + ref_by is set to order->item which is the address of order_item. + But this needs to be address of order_item in the all_fields list. + As a result, when it gets replaced with Item_aggregate_ref + object in Item::split_sum_func2, we will be able to retrieve the + newly created object. + */ + if (order_item->type() == Item::SUM_FUNC_ITEM) + ((Item_sum *)order_item)->ref_by= all_fields.head_ref(); + order->item= ref_pointer_array + el; return FALSE; } diff --git a/sql/sql_select.h b/sql/sql_select.h index 45041def28f..5aa29715dc3 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -2,7 +2,7 @@ #define SQL_SELECT_INCLUDED /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2008, 2013, Monty Program Ab. + Copyright (c) 2008, 2015, MariaDB 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 @@ -825,7 +825,12 @@ typedef struct st_position :public Sql_alloc */ uint n_sj_tables; - table_map prefix_dups_producing_tables; + /* + Bitmap of semi-join inner tables that are in the join prefix and for + which there's no provision for how to eliminate semi-join duplicates + they produce. + */ + table_map dups_producing_tables; table_map inner_tables_handled_with_other_sjs; @@ -1046,13 +1051,6 @@ public: */ table_map cur_sj_inner_tables; - /* - Bitmap of semi-join inner tables that are in the join prefix and for - which there's no provision for how to eliminate semi-join duplicates - they produce. - */ - table_map cur_dups_producing_tables; - /* We also maintain a stack of join optimization states in * join->positions[] */ /******* Join optimization state members end *******/ diff --git a/sql/sql_table.cc b/sql/sql_table.cc index df71140bc1d..817ab6e8967 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1,6 +1,6 @@ /* - Copyright (c) 2000, 2014, Oracle and/or its affiliates. - Copyright (c) 2010, 2014, SkySQL Ab. + Copyright (c) 2000, 2015, Oracle and/or its affiliates. + Copyright (c) 2010, 2015, MariaDB 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 @@ -28,7 +28,6 @@ #include "sql_base.h" // open_table_uncached, lock_table_names #include "lock.h" // mysql_unlock_tables #include "strfunc.h" // find_type2, find_set -#include "sql_view.h" // view_checksum #include "sql_truncate.h" // regenerate_locked_table #include "sql_partition.h" // mem_alloc_error, // generate_partition_syntax, diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index fe2ea02a8e2..05869b70c8f 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -1,5 +1,5 @@ -/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. - Copyright (c) 2013, 2014, SkySQL Ab. +/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. + Copyright (c) 2013, 2015, MariaDB 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 @@ -283,6 +283,12 @@ static bool recreate_temporary_table(THD *thd, TABLE *table) table->file->info(HA_STATUS_AUTO | HA_STATUS_NO_LOCK); + /* + If LOCK TABLES list is not empty and contains this table + then unlock the table and remove it from this list. + */ + mysql_lock_remove(thd, thd->lock, table); + /* Don't free share. */ close_temporary_table(thd, table, FALSE, FALSE); diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 6c4d864e75a..f616549097b 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2011, 2013, Monty Program Ab. + Copyright (c) 2011, 2015, MariaDB 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 @@ -1520,7 +1520,7 @@ int mysql_multi_update_prepare(THD *thd) */ lex->select_lex.exclude_from_table_unique_test= FALSE; - if (lex->select_lex.save_prep_leaf_tables(thd)) + if (lex->save_prep_leaf_tables()) DBUG_RETURN(TRUE); DBUG_RETURN (FALSE); diff --git a/sql/sql_view.cc b/sql/sql_view.cc index be31a7df3f6..41647a7262f 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2004, 2013, Oracle and/or its affiliates. - Copyright (c) 2011, 2014, SkySQL Ab. + Copyright (c) 2011, 2015, MariaDB 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 @@ -685,6 +685,26 @@ err: } +static void make_view_filename(LEX_STRING *dir, char *dir_buff, + size_t dir_buff_len, + LEX_STRING *path, char *path_buff, + size_t path_buff_len, + LEX_STRING *file, + TABLE_LIST *view) +{ + /* print file name */ + dir->length= build_table_filename(dir_buff, dir_buff_len - 1, + view->db, "", "", 0); + dir->str= dir_buff; + + path->length= build_table_filename(path_buff, path_buff_len - 1, + view->db, view->table_name, reg_ext, 0); + path->str= path_buff; + + file->str= path->str + dir->length; + file->length= path->length - dir->length; +} + /* number of required parameters for making view */ static const int required_view_parameters= 15; @@ -747,6 +767,67 @@ static File_option view_parameters[]= static LEX_STRING view_file_type[]= {{(char*) STRING_WITH_LEN("VIEW") }}; +int mariadb_fix_view(THD *thd, TABLE_LIST *view, bool wrong_checksum, + bool swap_alg) +{ + char dir_buff[FN_REFLEN + 1], path_buff[FN_REFLEN + 1]; + LEX_STRING dir, file, path; + DBUG_ENTER("mariadb_fix_view"); + + if (!wrong_checksum && view->mariadb_version) + DBUG_RETURN(HA_ADMIN_OK); + + make_view_filename(&dir, dir_buff, sizeof(dir_buff), + &path, path_buff, sizeof(path_buff), + &file, view); + /* init timestamp */ + if (!view->timestamp.str) + view->timestamp.str= view->timestamp_buffer; + + if (swap_alg && view->algorithm != VIEW_ALGORITHM_UNDEFINED) + { + DBUG_ASSERT(view->algorithm == VIEW_ALGORITHM_MERGE || + view->algorithm == VIEW_ALGORITHM_TMPTABLE); + if (view->algorithm == VIEW_ALGORITHM_MERGE) + view->algorithm= VIEW_ALGORITHM_TMPTABLE; + else + view->algorithm= VIEW_ALGORITHM_MERGE; + } + else + swap_alg= 0; + if (wrong_checksum) + { + if (view->md5.length != 32) + { + if ((view->md5.str= (char *)thd->alloc(32 + 1)) == NULL) + DBUG_RETURN(HA_ADMIN_FAILED); + } + view->calc_md5(view->md5.str); + view->md5.length= 32; + } + view->mariadb_version= MYSQL_VERSION_ID; + + if (sql_create_definition_file(&dir, &file, view_file_type, + (uchar*)view, view_parameters)) + { + sql_print_error("View '%-.192s'.'%-.192s': algorithm swap error.", + view->db, view->table_name); + DBUG_RETURN(HA_ADMIN_INTERNAL_ERROR); + } + sql_print_information("View %`s.%`s: the version is set to %llu%s%s", + view->db, view->table_name, view->mariadb_version, + (wrong_checksum ? ", checksum corrected" : ""), + (swap_alg ? + ((view->algorithm == VIEW_ALGORITHM_MERGE) ? + ", algorithm restored to be MERGE" + : ", algorithm restored to be TEMPTABLE") + : "")); + + + DBUG_RETURN(HA_ADMIN_OK); +} + + /* Register VIEW (write .frm & process .frm's history backups) @@ -887,17 +968,9 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view, } loop_out: /* print file name */ - dir.length= build_table_filename(dir_buff, sizeof(dir_buff) - 1, - view->db, "", "", 0); - dir.str= dir_buff; - - path.length= build_table_filename(path_buff, sizeof(path_buff) - 1, - view->db, view->table_name, reg_ext, 0); - path.str= path_buff; - - file.str= path.str + dir.length; - file.length= path.length - dir.length; - + make_view_filename(&dir, dir_buff, sizeof(dir_buff), + &path, path_buff, sizeof(path_buff), + &file, view); /* init timestamp */ if (!view->timestamp.str) view->timestamp.str= view->timestamp_buffer; @@ -1023,7 +1096,7 @@ err: SYNOPSIS mysql_make_view() - thd Thread handler + thd Thread handle parser parser object table TABLE_LIST structure for filling flags flags @@ -1609,7 +1682,7 @@ err: SYNOPSIS mysql_drop_view() - thd - thread handler + thd - thread handle views - views to delete drop_mode - cascade/check @@ -1726,7 +1799,7 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode) SYNOPSIS check_key_in_view() - thd thread handler + thd thread handle view view for check with opened table DESCRIPTION @@ -1912,6 +1985,58 @@ int view_checksum(THD *thd, TABLE_LIST *view) HA_ADMIN_OK); } +/** + Check view + + @param thd thread handle + @param view view for check + @param check_opt check options + + @retval HA_ADMIN_OK OK + @retval HA_ADMIN_NOT_IMPLEMENTED it is not VIEW + @retval HA_ADMIN_WRONG_CHECKSUM check sum is wrong +*/ +int view_check(THD *thd, TABLE_LIST *view, HA_CHECK_OPT *check_opt) +{ + DBUG_ENTER("view_check"); + + int res= view_checksum(thd, view); + if (res != HA_ADMIN_OK) + DBUG_RETURN(res); + + if (((check_opt->sql_flags & TT_FOR_UPGRADE) && !view->mariadb_version)) + DBUG_RETURN(HA_ADMIN_NEEDS_UPGRADE); + + DBUG_RETURN(HA_ADMIN_OK); +} + + +/** + Repair view + + @param thd thread handle + @param view view for check + @param check_opt check options + + @retval HA_ADMIN_OK OK + @retval HA_ADMIN_NOT_IMPLEMENTED it is not VIEW + @retval HA_ADMIN_WRONG_CHECKSUM check sum is wrong +*/ + +int view_repair(THD *thd, TABLE_LIST *view, HA_CHECK_OPT *check_opt) +{ + DBUG_ENTER("view_repair"); + bool swap_alg= (check_opt->sql_flags & TT_FROM_MYSQL); + bool wrong_checksum= view_checksum(thd, view) != HA_ADMIN_OK; + int ret; + if (wrong_checksum || swap_alg || (!view->mariadb_version)) + { + ret= mariadb_fix_view(thd, view, wrong_checksum, swap_alg); + DBUG_RETURN(ret); + } + DBUG_RETURN(HA_ADMIN_OK); +} + /* rename view diff --git a/sql/sql_view.h b/sql/sql_view.h index abe95c63e6e..8d733a1867c 100644 --- a/sql/sql_view.h +++ b/sql/sql_view.h @@ -2,7 +2,8 @@ #define SQL_VIEW_INCLUDED /* -*- C++ -*- */ -/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. + Copyright (c) 2015, MariaDB 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 @@ -45,6 +46,8 @@ bool check_key_in_view(THD *thd, TABLE_LIST * view); bool insert_view_fields(THD *thd, List<Item> *list, TABLE_LIST *view); int view_checksum(THD *thd, TABLE_LIST *view); +int view_check(THD *thd, TABLE_LIST *view, HA_CHECK_OPT *check_opt); +int view_repair(THD *thd, TABLE_LIST *view, HA_CHECK_OPT *check_opt); extern TYPELIB updatable_views_with_limit_typelib; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index a23a88b7559..03022c7ed19 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1,6 +1,6 @@ /* - Copyright (c) 2000, 2014, Oracle and/or its affiliates. - Copyright (c) 2010, 2014, Monty Program Ab. + Copyright (c) 2000, 2015, Oracle and/or its affiliates. + Copyright (c) 2010, 2015, MariaDB 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 @@ -1331,6 +1331,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token MULTIPOINT %token MULTIPOLYGON %token MUTEX_SYM +%token MYSQL_SYM %token MYSQL_ERRNO_SYM %token NAMES_SYM /* SQL-2003-N */ %token NAME_SYM /* SQL-2003-N */ @@ -7018,6 +7019,7 @@ alter: { Lex->name.str= 0; Lex->name.length= 0; + Lex->only_view= FALSE; Lex->sql_command= SQLCOM_ALTER_TABLE; Lex->duplicates= DUP_ERROR; Lex->col_list.empty(); @@ -7910,7 +7912,7 @@ opt_checksum_type: ; repair: - REPAIR opt_no_write_to_binlog table_or_tables + REPAIR opt_no_write_to_binlog table_or_view { LEX *lex=Lex; lex->sql_command = SQLCOM_REPAIR; @@ -7923,6 +7925,15 @@ repair: table_list opt_mi_repair_type { LEX* lex= thd->lex; + if ((lex->only_view && + ((lex->check_opt.flags & (T_QUICK | T_EXTEND)) || + (lex->check_opt.sql_flags & TT_USEFRM))) || + (!lex->only_view && + (lex->check_opt.sql_flags & TT_FROM_MYSQL))) + { + my_parse_error(ER(ER_SYNTAX_ERROR)); + MYSQL_YYABORT; + } DBUG_ASSERT(!lex->m_sql_cmd); lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_repair_table(); if (lex->m_sql_cmd == NULL) @@ -7944,6 +7955,7 @@ mi_repair_type: QUICK { Lex->check_opt.flags|= T_QUICK; } | EXTENDED_SYM { Lex->check_opt.flags|= T_EXTEND; } | USE_FRM { Lex->check_opt.sql_flags|= TT_USEFRM; } + | FROM MYSQL_SYM { Lex->check_opt.sql_flags|= TT_FROM_MYSQL; } ; analyze: @@ -8063,7 +8075,7 @@ binlog_base64_event: ; check: - CHECK_SYM table_or_tables + CHECK_SYM table_or_view { LEX *lex=Lex; @@ -8081,6 +8093,13 @@ check: table_list opt_mi_check_type { LEX* lex= thd->lex; + if (lex->only_view && + (lex->check_opt.flags & (T_QUICK | T_FAST | T_EXTEND | + T_CHECK_ONLY_CHANGED))) + { + my_parse_error(ER(ER_SYNTAX_ERROR)); + MYSQL_YYABORT; + } DBUG_ASSERT(!lex->m_sql_cmd); lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_check_table(); if (lex->m_sql_cmd == NULL) @@ -8188,6 +8207,7 @@ keycache: LEX *lex=Lex; lex->sql_command= SQLCOM_ASSIGN_TO_KEYCACHE; lex->ident= $6; + lex->only_view= FALSE; } ; @@ -8232,6 +8252,7 @@ preload: LEX *lex=Lex; lex->sql_command=SQLCOM_PRELOAD_KEYS; lex->alter_info.reset(); + lex->only_view= FALSE; } preload_list_or_parts {} @@ -10093,7 +10114,8 @@ udf_expr: parse it out. If we hijack the input stream with remember_name we may get quoted or escaped names. */ - else if ($2->type() != Item::FIELD_ITEM) + else if ($2->type() != Item::FIELD_ITEM && + $2->type() != Item::REF_ITEM /* For HAVING */ ) $2->set_name($1, (uint) ($3 - $1), thd->charset()); $$= $2; } @@ -14199,6 +14221,7 @@ keyword_sp: | MULTIPOINT {} | MULTIPOLYGON {} | MUTEX_SYM {} + | MYSQL_SYM {} | MYSQL_ERRNO_SYM {} | NAME_SYM {} | NAMES_SYM {} @@ -14827,8 +14850,13 @@ lock: ; table_or_tables: - TABLE_SYM {} - | TABLES {} + TABLE_SYM { Lex->only_view= FALSE; } + | TABLES { Lex->only_view= FALSE; } + ; + +table_or_view: + table_or_tables + | VIEW_SYM { Lex->only_view= TRUE; } ; table_lock_list: @@ -15732,6 +15760,13 @@ subselect_end: */ lex->current_select->select_n_where_fields+= child->select_n_where_fields; + + /* + Aggregate functions in having clause may add fields to an outer + select. Count them also. + */ + lex->current_select->select_n_having_items+= + child->select_n_having_items; } ; diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 31bd712ee67..21ea70def63 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1,5 +1,5 @@ -/* Copyright (c) 2002, 2014, Oracle and/or its affiliates. - Copyright (c) 2012, 2014, SkySQL Ab. +/* Copyright (c) 2002, 2015, Oracle and/or its affiliates. + Copyright (c) 2012, 2015, MariaDB 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 @@ -2524,7 +2524,7 @@ static Sys_var_ulong Sys_trans_alloc_block_size( "transaction_alloc_block_size", "Allocation block size for transactions to be stored in binary log", SESSION_VAR(trans_alloc_block_size), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(1024, UINT_MAX), DEFAULT(QUERY_ALLOC_BLOCK_SIZE), + VALID_RANGE(1024, 128 * 1024 * 1024), DEFAULT(QUERY_ALLOC_BLOCK_SIZE), BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_trans_mem_root)); @@ -2532,7 +2532,7 @@ static Sys_var_ulong Sys_trans_prealloc_size( "transaction_prealloc_size", "Persistent buffer for transactions to be stored in binary log", SESSION_VAR(trans_prealloc_size), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(1024, UINT_MAX), DEFAULT(TRANS_ALLOC_PREALLOC_SIZE), + VALID_RANGE(1024, 128 * 1024 * 1024), DEFAULT(TRANS_ALLOC_PREALLOC_SIZE), BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_trans_mem_root)); diff --git a/sql/table.cc b/sql/table.cc index a9b525bd25f..053269ab435 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -5111,7 +5111,8 @@ TABLE *TABLE_LIST::get_real_join_table() TABLE_LIST *tbl= this; while (tbl->table == NULL || tbl->table->reginfo.join_tab == NULL) { - if (tbl->view == NULL && tbl->derived == NULL) + if ((tbl->view == NULL && tbl->derived == NULL) || + tbl->is_materialized_derived()) break; /* we do not support merging of union yet */ DBUG_ASSERT(tbl->view == NULL || @@ -5120,28 +5121,25 @@ TABLE *TABLE_LIST::get_real_join_table() tbl->derived->first_select()->next_select() == NULL); { - List_iterator_fast<TABLE_LIST> ti; + List_iterator_fast<TABLE_LIST> + ti(tbl->view != NULL ? + tbl->view->select_lex.top_join_list : + tbl->derived->first_select()->top_join_list); + for (;;) { - List_iterator_fast<TABLE_LIST> - ti(tbl->view != NULL ? - tbl->view->select_lex.top_join_list : - tbl->derived->first_select()->top_join_list); - for (;;) - { - tbl= NULL; - /* - Find left table in outer join on this level - (the list is reverted). - */ - for (TABLE_LIST *t= ti++; t; t= ti++) - tbl= t; - if (!tbl) - return NULL; // view/derived with no tables - if (!tbl->nested_join) - break; - /* go deeper if we've found nested join */ - ti= tbl->nested_join->join_list; - } + tbl= NULL; + /* + Find left table in outer join on this level + (the list is reverted). + */ + for (TABLE_LIST *t= ti++; t; t= ti++) + tbl= t; + if (!tbl) + return NULL; // view/derived with no tables + if (!tbl->nested_join) + break; + /* go deeper if we've found nested join */ + ti= tbl->nested_join->join_list; } } } diff --git a/sql/uniques.cc b/sql/uniques.cc index 912a38f8927..c755293035b 100644 --- a/sql/uniques.cc +++ b/sql/uniques.cc @@ -1,4 +1,5 @@ -/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. + Copyright (c) 2010, 2015, MariaDB 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 @@ -100,7 +101,7 @@ Unique::Unique(qsort_cmp2 comp_func, void * comp_func_fixed_arg, max_elements= (ulong) (max_in_memory_size / ALIGN_SIZE(sizeof(TREE_ELEMENT)+size)); (void) open_cached_file(&file, mysql_tmpdir,TEMP_PREFIX, DISK_BUFFER_SIZE, - MYF(MY_WME)); + MYF(MY_WME)); } @@ -641,8 +642,8 @@ bool Unique::walk(TABLE *table, tree_walk_action action, void *walk_action_arg) return 1; if (flush_io_cache(&file) || reinit_io_cache(&file, READ_CACHE, 0L, 0, 0)) return 1; - ulong buff_sz= (max_in_memory_size / full_size + 1) * full_size; - if (!(merge_buffer= (uchar *) my_malloc(buff_sz, MYF(MY_THREAD_SPECIFIC)))) + size_t buff_sz= (max_in_memory_size / full_size + 1) * full_size; + if (!(merge_buffer = (uchar *)my_malloc(buff_sz, MYF(MY_THREAD_SPECIFIC|MY_WME)))) return 1; if (buff_sz < full_size * (file_ptrs.elements + 1UL)) res= merge(table, merge_buffer, buff_sz >= full_size * MERGEBUFF2) ; @@ -773,9 +774,8 @@ bool Unique::get(TABLE *table) /* Not enough memory; Save the result to file && free memory used by tree */ if (flush()) return 1; - - ulong buff_sz= (max_in_memory_size / full_size + 1) * full_size; - if (!(sort_buffer= (uchar*) my_malloc(buff_sz, MYF(MY_THREAD_SPECIFIC)))) + size_t buff_sz= (max_in_memory_size / full_size + 1) * full_size; + if (!(sort_buffer= (uchar*) my_malloc(buff_sz, MYF(MY_THREAD_SPECIFIC|MY_WME)))) return 1; if (merge(table, sort_buffer, FALSE)) diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index ca3421089c2..ee44898f7bd 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2004, 2014, Oracle and/or its affiliates. +/* Copyright (c) 2004, 2015, Oracle and/or its affiliates. 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 @@ -2883,7 +2883,7 @@ int ha_federated::info(uint flag) } - if (flag & HA_STATUS_AUTO) + if ((flag & HA_STATUS_AUTO) && mysql) stats.auto_increment_value= mysql->insert_id; mysql_free_result(result); diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc index c0ac08da9cc..0d7b7c16785 100644 --- a/storage/innobase/rem/rem0rec.cc +++ b/storage/innobase/rem/rem0rec.cc @@ -842,8 +842,7 @@ rec_get_converted_size_comp_prefix_low( } ut_ad(len <= col->len || col->mtype == DATA_BLOB - || col->mtype == DATA_VARMYSQL - || (col->len == 0 && col->mtype == DATA_VARCHAR)); + || (col->len == 0 && col->mtype == DATA_VARCHAR)); fixed_len = field->fixed_len; if (temp && fixed_len @@ -1272,7 +1271,6 @@ rec_convert_dtuple_to_rec_comp( } else { ut_ad(len <= dtype_get_len(type) || dtype_get_mtype(type) == DATA_BLOB - || dtype_get_mtype(type) == DATA_VARMYSQL || !strcmp(index->name, FTS_INDEX_TABLE_IND_NAME)); if (len < 128 diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt index 73e223dc246..7768930e89c 100644 --- a/storage/tokudb/CMakeLists.txt +++ b/storage/tokudb/CMakeLists.txt @@ -25,7 +25,7 @@ IF (HAVE_WVLA) ENDIF() ############################################ -SET(TOKUDB_VERSION "tokudb-7.5.5") +SET(TOKUDB_VERSION "tokudb-7.5.6") SET(TOKUDB_DEB_FILES "usr/lib/mysql/plugin/ha_tokudb.so\netc/mysql/conf.d/tokudb.cnf\nusr/bin/tokuftdump\nusr/share/doc/mariadb-server-10.0/README-TOKUDB\nusr/share/doc/mariadb-server-10.0/README.md" PARENT_SCOPE) SET(USE_BDB OFF CACHE BOOL "") MARK_AS_ADVANCED(BUILDNAME) diff --git a/storage/tokudb/README.md b/storage/tokudb/README.md index 2ab2e21a5a1..0d4f09d4c86 100644 --- a/storage/tokudb/README.md +++ b/storage/tokudb/README.md @@ -30,14 +30,14 @@ working MySQL or MariaDB with Tokutek patches, and with the TokuDB storage engine, called `make.mysql.bash`. This script will download copies of the needed source code from github and build everything. -To build MySQL 5.5.40 with TokuDB 7.5.3: +To build MySQL 5.5.41 with TokuDB 7.5.5: ```sh -scripts/make.mysql.bash --mysqlbuild=mysql-5.5.40-tokudb-7.5.3-linux-x86_64 +scripts/make.mysql.bash --mysqlbuild=mysql-5.5.41-tokudb-7.5.5-linux-x86_64 ``` -To build MariaDB 5.5.40 with TokuDB 7.5.3: +To build MariaDB 5.5.41 with TokuDB 7.5.5: ```sh -scripts/make.mysql.bash --mysqlbuild=mariadb-5.5.40-tokudb-7.5.3-linux-x86_64 +scripts/make.mysql.bash --mysqlbuild=mariadb-5.5.41-tokudb-7.5.5-linux-x86_64 ``` Before you start, make sure you have a C++11-compatible compiler (GCC >= @@ -59,6 +59,7 @@ repositories, run this: scripts/make.mysql.debug.env.bash ``` +We use gcc from devtoolset-1.1 on CentOS 5.9 for builds. Contribute ---------- diff --git a/storage/tokudb/ft-index/buildheader/make_tdb.cc b/storage/tokudb/ft-index/buildheader/make_tdb.cc index 88f8882df78..3f9a721d9aa 100644 --- a/storage/tokudb/ft-index/buildheader/make_tdb.cc +++ b/storage/tokudb/ft-index/buildheader/make_tdb.cc @@ -572,7 +572,7 @@ static void print_db_txn_struct (void) { STRUCT_SETUP(DB_TXN, abort, "int (*%s) (DB_TXN *)"); STRUCT_SETUP(DB_TXN, api_internal,"void *%s"); STRUCT_SETUP(DB_TXN, commit, "int (*%s) (DB_TXN*, uint32_t)"); - STRUCT_SETUP(DB_TXN, prepare, "int (*%s) (DB_TXN*, uint8_t gid[DB_GID_SIZE])"); + STRUCT_SETUP(DB_TXN, prepare, "int (*%s) (DB_TXN*, uint8_t gid[DB_GID_SIZE], uint32_t flags)"); STRUCT_SETUP(DB_TXN, discard, "int (*%s) (DB_TXN*, uint32_t)"); STRUCT_SETUP(DB_TXN, id, "uint32_t (*%s) (DB_TXN *)"); STRUCT_SETUP(DB_TXN, mgrp, "DB_ENV *%s /* In TokuFT, mgrp is a DB_ENV, not a DB_TXNMGR */"); @@ -581,11 +581,12 @@ static void print_db_txn_struct (void) { "int (*txn_stat)(DB_TXN *, struct txn_stat **)", "int (*commit_with_progress)(DB_TXN*, uint32_t, TXN_PROGRESS_POLL_FUNCTION, void*)", "int (*abort_with_progress)(DB_TXN*, TXN_PROGRESS_POLL_FUNCTION, void*)", - "int (*xa_prepare) (DB_TXN*, TOKU_XA_XID *)", + "int (*xa_prepare) (DB_TXN*, TOKU_XA_XID *, uint32_t flags)", "uint64_t (*id64) (DB_TXN*)", "void (*set_client_id)(DB_TXN *, uint64_t client_id)", "uint64_t (*get_client_id)(DB_TXN *)", "bool (*is_prepared)(DB_TXN *)", + "DB_TXN *(*get_child)(DB_TXN *)", NULL}; sort_and_dump_fields("db_txn", false, extra); } @@ -614,7 +615,7 @@ static void print_dbc_struct (void) { "int (*c_getf_set_range_reverse)(DBC *, uint32_t, DBT *, YDB_CALLBACK_FUNCTION, void *)", "int (*c_getf_set_range_with_bound)(DBC *, uint32_t, DBT *k, DBT *k_bound, YDB_CALLBACK_FUNCTION, void *)", "int (*c_set_bounds)(DBC*, const DBT*, const DBT*, bool pre_acquire, int out_of_range_error)", - "void (*c_set_check_interrupt_callback)(DBC*, bool (*)(void*), void *)", + "void (*c_set_check_interrupt_callback)(DBC*, bool (*)(void*, uint64_t deleted_rows), void *)", "void (*c_remove_restriction)(DBC*)", "char _internal[512]", NULL}; diff --git a/storage/tokudb/ft-index/ft/ft-internal.h b/storage/tokudb/ft-index/ft/ft-internal.h index 88fc5dca686..4a820d5682b 100644 --- a/storage/tokudb/ft-index/ft/ft-internal.h +++ b/storage/tokudb/ft-index/ft/ft-internal.h @@ -655,7 +655,7 @@ int toku_upgrade_msn_from_root_to_header(int fd, FT ft) __attribute__((nonnull)) // When lock_only is true, the callback only does optional lock tree locking. typedef int (*FT_GET_CALLBACK_FUNCTION)(uint32_t keylen, const void *key, uint32_t vallen, const void *val, void *extra, bool lock_only); -typedef bool (*FT_CHECK_INTERRUPT_CALLBACK)(void *extra); +typedef bool (*FT_CHECK_INTERRUPT_CALLBACK)(void *extra, uint64_t deleted_rows); struct ft_cursor; int toku_ft_search(FT_HANDLE ft_handle, ft_search *search, FT_GET_CALLBACK_FUNCTION getf, void *getf_v, struct ft_cursor *ftcursor, bool can_bulk_fetch); diff --git a/storage/tokudb/ft-index/ft/ft-ops.cc b/storage/tokudb/ft-index/ft/ft-ops.cc index 34c9c46f1c6..b3c224afb7a 100644 --- a/storage/tokudb/ft-index/ft/ft-ops.cc +++ b/storage/tokudb/ft-index/ft/ft-ops.cc @@ -3387,7 +3387,7 @@ ok: ; idx++; if (idx >= bn->data_buffer.num_klpairs() || ((n_deleted % 64) == 0 && !search_continue(search, key, keylen))) { STATUS_INC(FT_CURSOR_SKIP_DELETED_LEAF_ENTRY, n_deleted); - if (ftcursor->interrupt_cb && ftcursor->interrupt_cb(ftcursor->interrupt_cb_extra)) { + if (ftcursor->interrupt_cb && ftcursor->interrupt_cb(ftcursor->interrupt_cb_extra, n_deleted)) { return TOKUDB_INTERRUPTED; } return DB_NOTFOUND; @@ -3396,7 +3396,7 @@ ok: ; case FT_SEARCH_RIGHT: if (idx == 0) { STATUS_INC(FT_CURSOR_SKIP_DELETED_LEAF_ENTRY, n_deleted); - if (ftcursor->interrupt_cb && ftcursor->interrupt_cb(ftcursor->interrupt_cb_extra)) { + if (ftcursor->interrupt_cb && ftcursor->interrupt_cb(ftcursor->interrupt_cb_extra, n_deleted)) { return TOKUDB_INTERRUPTED; } return DB_NOTFOUND; @@ -3410,6 +3410,8 @@ ok: ; assert_zero(r); // we just validated the index if (!le_val_is_del(le, ftcursor->is_snapshot_read, ftcursor->ttxn)) { STATUS_INC(FT_CURSOR_SKIP_DELETED_LEAF_ENTRY, n_deleted); + if (ftcursor->interrupt_cb) + ftcursor->interrupt_cb(ftcursor->interrupt_cb_extra, n_deleted); goto got_a_good_value; } } diff --git a/storage/tokudb/ft-index/ft/ft.cc b/storage/tokudb/ft-index/ft/ft.cc index bf99646351a..77948dfe358 100644 --- a/storage/tokudb/ft-index/ft/ft.cc +++ b/storage/tokudb/ft-index/ft/ft.cc @@ -1064,6 +1064,11 @@ garbage_helper(BLOCKNUM blocknum, int64_t UU(size), int64_t UU(address), void *e goto exit; } } + { + float a = info->used_space, b=info->total_space; + float percentage = (1 - (a / b)) * 100; + printf("LeafNode# %d has %d BasementNodes and %2.1f%% of the allocated space is garbage\n", (int)blocknum.b, node->n_children, percentage); + } exit: toku_ftnode_free(&node); toku_free(ndd); diff --git a/storage/tokudb/ft-index/ft/logger/recover.cc b/storage/tokudb/ft-index/ft/logger/recover.cc index 8dd7bf87624..cae7397651d 100644 --- a/storage/tokudb/ft-index/ft/logger/recover.cc +++ b/storage/tokudb/ft-index/ft/logger/recover.cc @@ -714,7 +714,7 @@ static int toku_recover_xstillopenprepared (struct logtype_xstillopenprepared *l } switch (renv->ss.ss) { case FORWARD_BETWEEN_CHECKPOINT_BEGIN_END: { - toku_txn_prepare_txn(txn, l->xa_xid); + toku_txn_prepare_txn(txn, l->xa_xid, 0); break; } case FORWARD_NEWER_CHECKPOINT_END: { @@ -778,7 +778,7 @@ static int toku_recover_xprepare (struct logtype_xprepare *l, RECOVER_ENV renv) assert(txn!=NULL); // Save the transaction - toku_txn_prepare_txn(txn, l->xa_xid); + toku_txn_prepare_txn(txn, l->xa_xid, 0); return 0; } diff --git a/storage/tokudb/ft-index/ft/txn/txn.cc b/storage/tokudb/ft-index/ft/txn/txn.cc index 216cb0d8dfd..18d5a6b67dd 100644 --- a/storage/tokudb/ft-index/ft/txn/txn.cc +++ b/storage/tokudb/ft-index/ft/txn/txn.cc @@ -558,7 +558,7 @@ static void copy_xid (TOKU_XA_XID *dest, TOKU_XA_XID *source) { memcpy(dest->data, source->data, source->gtrid_length+source->bqual_length); } -void toku_txn_prepare_txn (TOKUTXN txn, TOKU_XA_XID *xa_xid) { +void toku_txn_prepare_txn (TOKUTXN txn, TOKU_XA_XID *xa_xid, int nosync) { if (txn->parent || toku_txn_is_read_only(txn)) { // We do not prepare children. // @@ -573,7 +573,7 @@ void toku_txn_prepare_txn (TOKUTXN txn, TOKU_XA_XID *xa_xid) { txn->state = TOKUTXN_PREPARING; toku_txn_unlock_state(txn); // Do we need to do an fsync? - txn->do_fsync = (txn->force_fsync_on_commit || txn->roll_info.num_rollentries>0); + txn->do_fsync = txn->force_fsync_on_commit || (!nosync && txn->roll_info.num_rollentries>0); copy_xid(&txn->xa_xid, xa_xid); // This list will go away with #4683, so we wn't need the ydb lock for this anymore. toku_log_xprepare(txn->logger, &txn->do_fsync_lsn, 0, txn, txn->txnid, xa_xid); diff --git a/storage/tokudb/ft-index/ft/txn/txn.h b/storage/tokudb/ft-index/ft/txn/txn.h index c458df3b5b2..6381b5a7779 100644 --- a/storage/tokudb/ft-index/ft/txn/txn.h +++ b/storage/tokudb/ft-index/ft/txn/txn.h @@ -302,7 +302,7 @@ int toku_txn_abort_with_lsn(struct tokutxn *txn, LSN oplsn, int toku_txn_discard_txn(struct tokutxn *txn); -void toku_txn_prepare_txn (struct tokutxn *txn, TOKU_XA_XID *xid); +void toku_txn_prepare_txn (struct tokutxn *txn, TOKU_XA_XID *xid, int nosync); // Effect: Do the internal work of preparing a transaction (does not log the prepare record). void toku_txn_get_prepared_xa_xid(struct tokutxn *txn, TOKU_XA_XID *xa_xid); diff --git a/storage/tokudb/ft-index/src/tests/recover-5146.cc b/storage/tokudb/ft-index/src/tests/recover-5146.cc index c05f9effa7d..5e793830f1d 100644 --- a/storage/tokudb/ft-index/src/tests/recover-5146.cc +++ b/storage/tokudb/ft-index/src/tests/recover-5146.cc @@ -147,7 +147,7 @@ run_test(void) { uint8_t gid[DB_GID_SIZE]; memset(gid, 0, DB_GID_SIZE); gid[0]=42; - r = txn->prepare(txn, gid); CKERR(r); + r = txn->prepare(txn, gid, 0); CKERR(r); } r = env->txn_checkpoint(env, 0, 0, 0); CKERR(r); diff --git a/storage/tokudb/ft-index/src/tests/test-prepare.cc b/storage/tokudb/ft-index/src/tests/test-prepare.cc index 9033c633ea7..73d2105fa86 100644 --- a/storage/tokudb/ft-index/src/tests/test-prepare.cc +++ b/storage/tokudb/ft-index/src/tests/test-prepare.cc @@ -122,7 +122,7 @@ static void setup_env_and_prepare (DB_ENV **envp, const char *envdir, bool commi uint8_t gid[DB_GID_SIZE]; memset(gid, 0, DB_GID_SIZE); gid[0]=42; - CKERR(txn->prepare(txn, gid)); + CKERR(txn->prepare(txn, gid, 0)); if (commit) CKERR(txn->commit(txn, 0)); } diff --git a/storage/tokudb/ft-index/src/tests/test-prepare2.cc b/storage/tokudb/ft-index/src/tests/test-prepare2.cc index 8952f14cf31..12d78e4da7c 100644 --- a/storage/tokudb/ft-index/src/tests/test-prepare2.cc +++ b/storage/tokudb/ft-index/src/tests/test-prepare2.cc @@ -124,7 +124,7 @@ static void setup_env_and_prepare (DB_ENV **envp, const char *envdir, bool commi uint8_t gid[DB_GID_SIZE]; memset(gid, 0, DB_GID_SIZE); gid[0]=42; - CKERR(txn->prepare(txn, gid)); + CKERR(txn->prepare(txn, gid, 0)); if (commit) CKERR(txn->commit(txn, 0)); } diff --git a/storage/tokudb/ft-index/src/tests/test-prepare3.cc b/storage/tokudb/ft-index/src/tests/test-prepare3.cc index 3643d73f41a..30c5c728e94 100644 --- a/storage/tokudb/ft-index/src/tests/test-prepare3.cc +++ b/storage/tokudb/ft-index/src/tests/test-prepare3.cc @@ -147,7 +147,7 @@ static void setup_env_and_prepare (DB_ENV **envp, const char *envdir) { uint8_t gid[DB_GID_SIZE]; memset(gid, 0, DB_GID_SIZE); gid[0]='a'+tnum; - CKERR(txn->prepare(txn, gid)); + CKERR(txn->prepare(txn, gid, 0)); // Drop txn on the ground, since we will commit or abort it after recovery if (tnum==0) { //printf("commit %d\n", tnum); diff --git a/storage/tokudb/ft-index/src/tests/test-xa-prepare.cc b/storage/tokudb/ft-index/src/tests/test-xa-prepare.cc index e08e7361555..d3b1352f55d 100644 --- a/storage/tokudb/ft-index/src/tests/test-xa-prepare.cc +++ b/storage/tokudb/ft-index/src/tests/test-xa-prepare.cc @@ -125,7 +125,7 @@ static void setup_env_and_prepare (DB_ENV **envp, const char *envdir, bool commi .gtrid_length = 8, .bqual_length = 9}; for (int i=0; i<8+9; i++) x.data[i] = 42+i; - CKERR(txn->xa_prepare(txn, &x)); + CKERR(txn->xa_prepare(txn, &x, 0)); if (commit) CKERR(txn->commit(txn, 0)); } diff --git a/storage/tokudb/ft-index/src/tests/test5092.cc b/storage/tokudb/ft-index/src/tests/test5092.cc index 16652472b55..8ef31ae0340 100644 --- a/storage/tokudb/ft-index/src/tests/test5092.cc +++ b/storage/tokudb/ft-index/src/tests/test5092.cc @@ -118,7 +118,7 @@ static void setup_env_and_prepare (DB_ENV **envp, const char *envdir, bool commi uint8_t gid[DB_GID_SIZE]; memset(gid, 0, DB_GID_SIZE); gid[0]=42; - CKERR(txn->prepare(txn, gid)); + CKERR(txn->prepare(txn, gid, 0)); { int chk_r = db->close(db, 0); CKERR(chk_r); } if (commit) CKERR(txn->commit(txn, 0)); diff --git a/storage/tokudb/ft-index/src/tests/test_5015.cc b/storage/tokudb/ft-index/src/tests/test_5015.cc index 071b7f3660e..50900d342d0 100644 --- a/storage/tokudb/ft-index/src/tests/test_5015.cc +++ b/storage/tokudb/ft-index/src/tests/test_5015.cc @@ -133,7 +133,7 @@ test_main(int argc, char *const argv[]) { uint8_t gid[DB_GID_SIZE]; memset(gid, 0, DB_GID_SIZE); gid[0]='a'; - r = child_txn->prepare(child_txn, gid); + r = child_txn->prepare(child_txn, gid, 0); CKERR(r); r = env->txn_checkpoint(env, 0, 0, 0); diff --git a/storage/tokudb/ft-index/src/tests/test_cursor_interrupt.cc b/storage/tokudb/ft-index/src/tests/test_cursor_interrupt.cc index e992f86455b..5583b0283a6 100644 --- a/storage/tokudb/ft-index/src/tests/test_cursor_interrupt.cc +++ b/storage/tokudb/ft-index/src/tests/test_cursor_interrupt.cc @@ -95,12 +95,12 @@ PATENT RIGHTS GRANT: int num_interrupts_called; -static bool interrupt(void* extra UU()) { +static bool interrupt(void* extra UU(), uint64_t rows UU()) { num_interrupts_called++; return false; } -static bool interrupt_true(void* extra UU()) { +static bool interrupt_true(void* extra UU(), uint64_t rows UU()) { num_interrupts_called++; return true; } diff --git a/storage/tokudb/ft-index/src/tests/test_stress_hot_indexing.cc b/storage/tokudb/ft-index/src/tests/test_stress_hot_indexing.cc index fe237f063ab..d70f0411e01 100644 --- a/storage/tokudb/ft-index/src/tests/test_stress_hot_indexing.cc +++ b/storage/tokudb/ft-index/src/tests/test_stress_hot_indexing.cc @@ -211,7 +211,7 @@ cleanup: gid_count++; uint32_t *hi_gid_count_p = cast_to_typeof(hi_gid_count_p) hi_gid; // make gcc --happy about -Wstrict-aliasing *hi_gid_count_p = gid_count; - int rr = hi_txn->prepare(hi_txn, hi_gid); + int rr = hi_txn->prepare(hi_txn, hi_gid, 0); CKERR(rr); if (r || (random() % 2)) { rr = hi_txn->abort(hi_txn); diff --git a/storage/tokudb/ft-index/src/tests/test_txn_close_before_prepare_commit.cc b/storage/tokudb/ft-index/src/tests/test_txn_close_before_prepare_commit.cc index e3b715c4ce7..31267b17686 100644 --- a/storage/tokudb/ft-index/src/tests/test_txn_close_before_prepare_commit.cc +++ b/storage/tokudb/ft-index/src/tests/test_txn_close_before_prepare_commit.cc @@ -130,7 +130,7 @@ test_txn_close_before_prepare_commit (void) { uint8_t gid[DB_GID_SIZE]; memset(gid, 1, DB_GID_SIZE); - r = txn->prepare(txn, gid); assert(r == 0); + r = txn->prepare(txn, gid, 0); assert(r == 0); r = txn->commit(txn, 0); assert(r == 0); r = env->close(env, 0); assert(r == 0); diff --git a/storage/tokudb/ft-index/src/tests/threaded_stress_test_helpers.h b/storage/tokudb/ft-index/src/tests/threaded_stress_test_helpers.h index 2c2525a3165..f9da1693847 100644 --- a/storage/tokudb/ft-index/src/tests/threaded_stress_test_helpers.h +++ b/storage/tokudb/ft-index/src/tests/threaded_stress_test_helpers.h @@ -593,7 +593,7 @@ static void *worker(void *arg_v) { uint64_t gid_val = txn->id64(txn); uint64_t *gid_count_p = cast_to_typeof(gid_count_p) gid; // make gcc --happy about -Wstrict-aliasing *gid_count_p = gid_val; - int rr = txn->prepare(txn, gid); + int rr = txn->prepare(txn, gid, 0); assert_zero(rr); } if (r == 0) { diff --git a/storage/tokudb/ft-index/src/tests/xa-dirty-commit.cc b/storage/tokudb/ft-index/src/tests/xa-dirty-commit.cc index 126a7c1453e..008a41274ae 100644 --- a/storage/tokudb/ft-index/src/tests/xa-dirty-commit.cc +++ b/storage/tokudb/ft-index/src/tests/xa-dirty-commit.cc @@ -136,7 +136,7 @@ static void create_prepared_txn(void) { for (int i = 0; i < 8+9; i++) { xid.data[i] = i; } - r = txn->xa_prepare(txn, &xid); + r = txn->xa_prepare(txn, &xid, 0); CKERR(r); // discard the txn so that we can close the env and run xa recovery later diff --git a/storage/tokudb/ft-index/src/tests/xa-dirty-rollback.cc b/storage/tokudb/ft-index/src/tests/xa-dirty-rollback.cc index 2d13e559050..3f0debe4116 100644 --- a/storage/tokudb/ft-index/src/tests/xa-dirty-rollback.cc +++ b/storage/tokudb/ft-index/src/tests/xa-dirty-rollback.cc @@ -136,7 +136,7 @@ static void create_prepared_txn(void) { for (int i = 0; i < 8+9; i++) { xid.data[i] = i; } - r = txn->xa_prepare(txn, &xid); + r = txn->xa_prepare(txn, &xid, 0); CKERR(r); // discard the txn so that we can close the env and run xa recovery later diff --git a/storage/tokudb/ft-index/src/tests/xa-txn-discard-abort.cc b/storage/tokudb/ft-index/src/tests/xa-txn-discard-abort.cc index 3365a1bb139..95852c68192 100644 --- a/storage/tokudb/ft-index/src/tests/xa-txn-discard-abort.cc +++ b/storage/tokudb/ft-index/src/tests/xa-txn-discard-abort.cc @@ -138,7 +138,7 @@ static void create_prepared_txn(void) { for (int i = 0; i < 8+9; i++) { xid.data[i] = i; } - r = txn->xa_prepare(txn, &xid); + r = txn->xa_prepare(txn, &xid, 0); CKERR(r); // discard the txn so that we can close the env and run xa recovery later diff --git a/storage/tokudb/ft-index/src/tests/xa-txn-discard-commit.cc b/storage/tokudb/ft-index/src/tests/xa-txn-discard-commit.cc index c4d164017ae..a21f8813f90 100644 --- a/storage/tokudb/ft-index/src/tests/xa-txn-discard-commit.cc +++ b/storage/tokudb/ft-index/src/tests/xa-txn-discard-commit.cc @@ -139,7 +139,7 @@ static void create_prepared_txn(void) { for (int i = 0; i < 8+9; i++) { xid.data[i] = i; } - r = txn->xa_prepare(txn, &xid); + r = txn->xa_prepare(txn, &xid, 0); CKERR(r); // discard the txn so that we can close the env and run xa recovery later diff --git a/storage/tokudb/ft-index/src/ydb_cursor.cc b/storage/tokudb/ft-index/src/ydb_cursor.cc index 57f3b5808b6..eed519455fc 100644 --- a/storage/tokudb/ft-index/src/ydb_cursor.cc +++ b/storage/tokudb/ft-index/src/ydb_cursor.cc @@ -769,7 +769,7 @@ c_remove_restriction(DBC *dbc) { } static void -c_set_check_interrupt_callback(DBC* dbc, bool (*interrupt_callback)(void*), void *extra) { +c_set_check_interrupt_callback(DBC* dbc, bool (*interrupt_callback)(void*, uint64_t), void *extra) { toku_ft_cursor_set_check_interrupt_cb(dbc_ftcursor(dbc), interrupt_callback, extra); } diff --git a/storage/tokudb/ft-index/src/ydb_txn.cc b/storage/tokudb/ft-index/src/ydb_txn.cc index ce06e78b23f..82903849535 100644 --- a/storage/tokudb/ft-index/src/ydb_txn.cc +++ b/storage/tokudb/ft-index/src/ydb_txn.cc @@ -240,7 +240,7 @@ static int toku_txn_abort(DB_TXN * txn, return r; } -static int toku_txn_xa_prepare (DB_TXN *txn, TOKU_XA_XID *xid) { +static int toku_txn_xa_prepare (DB_TXN *txn, TOKU_XA_XID *xid, uint32_t flags) { int r = 0; if (!txn) { r = EINVAL; @@ -273,9 +273,11 @@ static int toku_txn_xa_prepare (DB_TXN *txn, TOKU_XA_XID *xid) { HANDLE_PANICKED_ENV(txn->mgrp); } assert(!db_txn_struct_i(txn)->child); + int nosync; + nosync = (flags & DB_TXN_NOSYNC)!=0 || (db_txn_struct_i(txn)->flags&DB_TXN_NOSYNC); TOKUTXN ttxn; ttxn = db_txn_struct_i(txn)->tokutxn; - toku_txn_prepare_txn(ttxn, xid); + toku_txn_prepare_txn(ttxn, xid, nosync); TOKULOGGER logger; logger = txn->mgrp->i->logger; LSN do_fsync_lsn; @@ -292,14 +294,14 @@ exit: // requires: must hold the multi operation lock. it is // released in toku_txn_xa_prepare before the fsync. -static int toku_txn_prepare (DB_TXN *txn, uint8_t gid[DB_GID_SIZE]) { +static int toku_txn_prepare (DB_TXN *txn, uint8_t gid[DB_GID_SIZE], uint32_t flags) { TOKU_XA_XID xid; TOKU_ANNOTATE_NEW_MEMORY(&xid, sizeof(xid)); xid.formatID=0x756b6f54; // "Toku" xid.gtrid_length=DB_GID_SIZE/2; // The maximum allowed gtrid length is 64. See the XA spec in source:/import/opengroup.org/C193.pdf page 20. xid.bqual_length=DB_GID_SIZE/2; // The maximum allowed bqual length is 64. memcpy(xid.data, gid, DB_GID_SIZE); - return toku_txn_xa_prepare(txn, &xid); + return toku_txn_xa_prepare(txn, &xid, flags); } static int toku_txn_txn_stat (DB_TXN *txn, struct txn_stat **txn_stat) { @@ -427,6 +429,10 @@ static bool toku_txn_is_prepared(DB_TXN *txn) { return toku_txn_get_state(ttxn) == TOKUTXN_PREPARING; } +static DB_TXN *toku_txn_get_child(DB_TXN *txn) { + return db_txn_struct_i(txn)->child; +} + static inline void txn_func_init(DB_TXN *txn) { #define STXN(name) txn->name = locked_txn_ ## name STXN(abort); @@ -444,6 +450,7 @@ static inline void txn_func_init(DB_TXN *txn) { #undef SUTXN txn->id64 = toku_txn_id64; txn->is_prepared = toku_txn_is_prepared; + txn->get_child = toku_txn_get_child; } // diff --git a/storage/tokudb/ft-index/tools/CMakeLists.txt b/storage/tokudb/ft-index/tools/CMakeLists.txt index 4ed0cb4cbdc..71c44df9acd 100644 --- a/storage/tokudb/ft-index/tools/CMakeLists.txt +++ b/storage/tokudb/ft-index/tools/CMakeLists.txt @@ -14,7 +14,7 @@ target_link_libraries(ftverify m) install( TARGETS tokuftdump - DESTINATION bin + DESTINATION ${INSTALL_BINDIR} COMPONENT Server ) diff --git a/storage/tokudb/ft-index/tools/tokuftdump.cc b/storage/tokudb/ft-index/tools/tokuftdump.cc index 3f73136fb5c..d680a3dd0d0 100644 --- a/storage/tokudb/ft-index/tools/tokuftdump.cc +++ b/storage/tokudb/ft-index/tools/tokuftdump.cc @@ -99,7 +99,10 @@ PATENT RIGHTS GRANT: #include <stdlib.h> #include <inttypes.h> #include <limits.h> - +#include <string> +#include <iostream> +#include <fstream> +#include <string.h> #include "ft/serialize/block_table.h" #include "ft/cachetable/cachetable.h" #include "ft/ft.h" @@ -108,8 +111,11 @@ PATENT RIGHTS GRANT: #include "ft/serialize/ft_node-serialize.h" #include "ft/node.h" +using namespace std; + static int do_dump_data = 1; static int do_interactive = 0; +static int do_json = 0; static int do_header = 0; static int do_fragmentation = 0; static int do_garbage = 0; @@ -118,10 +124,24 @@ static int do_rootnode = 0; static int do_node = 0; static BLOCKNUM do_node_num; static int do_tsv = 0; - static const char *arg0; static const char *fname; +//it holdes the messges count for each FT's node +typedef struct nodeMessage{ + int id; + int clean;//0=clean >=1 dirty + int *count;//holds the messages + nodeMessage *nextNode; +}NMC; +enum { maxline = 128}; + +static int printNodeMessagesToSTDout(NMC* ptr); + +static int printLevelSTDout(int *); + +static void treeToSTDout(NMC *msgs[], int height); + static void format_time(const uint64_t time_int, char *buf) { time_t timer = (time_t) time_int; ctime_r(&timer, buf); @@ -225,12 +245,202 @@ static void dump_header(FT ft) { printf(" estimated numbytes=%" PRId64 "\n", ft->in_memory_stats.numbytes); } +static int64_t getRootNode(FT ft) { + return ft->h->root_blocknum.b; +} + static int print_le(const void* key, const uint32_t keylen, const LEAFENTRY &le, const uint32_t idx UU(), void *const ai UU()) { print_klpair(stdout, key, keylen, le); printf("\n"); return 0; } +static int getHeight(int fd, BLOCKNUM blocknum, FT ft){ + FTNODE n; + FTNODE_DISK_DATA ndd = nullptr; + ftnode_fetch_extra bfe; + bfe.create_for_full_read(ft); + int r = toku_deserialize_ftnode_from (fd, blocknum, 0 /*pass zero for hash, it doesn't matter*/, &n, &ndd, &bfe); + assert_zero(r); + assert(n!=0); + return n->height; +} + +static FTNODE getNode(int fd, BLOCKNUM blocknum, FT ft) { + FTNODE n; + FTNODE_DISK_DATA ndd = nullptr; + ftnode_fetch_extra bfe; + bfe.create_for_full_read(ft); + int r = toku_deserialize_ftnode_from (fd, blocknum, 0 /*pass zero for hash, it doesn't matter*/, &n, &ndd, &bfe); + assert_zero(r);; + return n; +} + +static int countNodes(NMC *level){ + int count=0; + NMC *ptr=level; + while(ptr!=NULL){ + count++; + ptr=ptr->nextNode; + } + return count; +} + +static int * countMessages(NMC *level){ + int *counts=new int[16]; + for(int i=0;i<16;i++){ + counts[i]=0; + } + NMC *ptr=level; + while(ptr!=NULL){ + for(int i=0;i<16;i++){ + counts[i]+=ptr->count[i]; + } + ptr=ptr->nextNode; + } + return counts; +} + +static NMC * getLast(NMC *level){ + if (level==NULL) return NULL; + NMC *ptr=level; + while(ptr->nextNode!=NULL){ + ptr=ptr->nextNode; + } + return ptr; +} + +/* + * Prints the total messages at each to STDout + */ +static int printLevelSTDout(int *count){ + int isEmpty=0; + for(int j=0;j<16;j++){ + if(count[j]>0){ + cout <<count[j]<<" "; + isEmpty++; + switch (j) { + case FT_INSERT: printf("INSERT(s) "); break; + case FT_INSERT_NO_OVERWRITE: printf("INSERT_NO_OVERWRITE(s) "); break; + case FT_DELETE_ANY: printf("DELETE_ANY(s) "); break; + case FT_ABORT_ANY: printf("ABORT_ANY(s) "); break; + case FT_COMMIT_ANY: printf("COMMIT_ANY(s) "); break; + case FT_COMMIT_BROADCAST_ALL: printf("COMMIT_BROADCAST_ALL(s) "); break; + case FT_COMMIT_BROADCAST_TXN: printf("COMMIT_BROADCAST_TXN(s) "); break; + case FT_ABORT_BROADCAST_TXN: printf("ABORT_BROADCAST_TXN(s) "); break; + case FT_OPTIMIZE: printf("OPTIMIZE(s) "); break; + case FT_OPTIMIZE_FOR_UPGRADE: printf("OPTIMIZE_FOR_UPGRADE(s) "); break; + case FT_UPDATE: printf("UPDATE(s) "); break; + case FT_UPDATE_BROADCAST_ALL: printf("UPDATE_BROADCAST_ALL(s) "); break; + } + + } + } + return isEmpty; +} + +/* + * Prints the total # of messages in a node to STD output + */ +static int printNodeMessagesToSTDout(NMC *ptr){ + cout <<"\nNode :"<<ptr->id<<" has :"; + for(int j=0;j<16;j++){ + if(ptr->count[j]>0){ + cout <<ptr->count[j]<<" "; + switch (j) { + case FT_INSERT: printf("INSERT(s) "); break; + case FT_INSERT_NO_OVERWRITE: printf("INSERT_NO_OVERWRITE(s) "); break; + case FT_DELETE_ANY: printf("DELETE_ANY(s) "); break; + case FT_ABORT_ANY: printf("ABORT_ANY(s) "); break; + case FT_COMMIT_ANY: printf("COMMIT_ANY(s) "); break; + case FT_COMMIT_BROADCAST_ALL: printf("COMMIT_BROADCAST_ALL(s) "); break; + case FT_COMMIT_BROADCAST_TXN: printf("COMMIT_BROADCAST_TXN(s) "); break; + case FT_ABORT_BROADCAST_TXN: printf("ABORT_BROADCAST_TXN(s) "); break; + case FT_OPTIMIZE: printf("OPTIMIZE(s) "); break; + case FT_OPTIMIZE_FOR_UPGRADE: printf("OPTIMIZE_FOR_UPGRADE(s) "); break; + case FT_UPDATE: printf("UPDATE(s) "); break; + case FT_UPDATE_BROADCAST_ALL: printf("UPDATE_BROADCAST_ALL(s) "); break; + } + } + } + return 1; +} + +static void levelToSTDout(NMC *list, int level){ + NMC *ptr=list; + cout <<endl<<"Height : "<<level<<endl; + while(ptr!=NULL){ + if(ptr->clean!=0){ + printNodeMessagesToSTDout(ptr); + } + else{ + cout << "\nNode : "<<ptr->id<<" has no messages"; + } + ptr=ptr->nextNode; + } + cout <<endl; +} + +/* + * prints the tree total # of nodes and total # of messages at each height in : + * STDout in human readable format + */ +static void treeToSTDout(NMC *msgs[], int height){ + for(int i=height; i>=0 ; i--){ + cout <<"At height "<<i; + int *counts=countMessages(msgs[i]); + cout <<"\n Node Count: "<< countNodes(msgs[i])<<endl; + cout <<" Messages: "; + if(printLevelSTDout(counts)==0) cout <<"0\n"; + else cout <<endl; + } +} + +//traverse through the FT and report back the count of messages in every node +static void countMessagesInFT(int fd, BLOCKNUM blocknum, FT ft,NMC *msgs[]){ + FTNODE n=getNode(fd,blocknum,ft); + + NMC *last=NULL; + if(msgs[n->height]==NULL){ + last = msgs[n->height]=new NMC; + }else { + last=getLast(msgs[n->height]); + last->nextNode=new NMC; + last=last->nextNode; + } + last->id=blocknum.b; + last->count=new int[16]; + for(int i=0;i<16;i++){ + last->count[i]=0; + } + last->clean=0; + last->nextNode=NULL; + + if (n->height==0){ + toku_ftnode_free(&n); + return; + } + for(int i=0;i<n->n_children;i++){ + NONLEAF_CHILDINFO bnc = BNC(n, i); + if (n->height==1 && n->bp[i].ptr.tag==BCT_NULL){ + cout <<n->bp[i].ptr.tag; + } + auto dump_fn=[&](const ft_msg &msg, bool UU(is_fresh)) { + enum ft_msg_type type = (enum ft_msg_type) msg.type(); + last->count[type]++; + last->clean=1; + return 0; + }; + + bnc->msg_buffer.iterate(dump_fn); + + blocknum=make_blocknum(BP_BLOCKNUM(n, i).b); + countMessagesInFT(fd,blocknum,ft, msgs); + } + + toku_ftnode_free(&n); +} + static void dump_node(int fd, BLOCKNUM blocknum, FT ft) { FTNODE n; FTNODE_DISK_DATA ndd = nullptr; @@ -254,9 +464,9 @@ static void dump_node(int fd, BLOCKNUM blocknum, FT ft) { printf(" layout_version_read_from_disk=%d\n", n->layout_version_read_from_disk); printf(" build_id=%d\n", n->build_id); printf(" max_msn_applied_to_node_on_disk=%" PRId64 " (0x%" PRIx64 ")\n", n->max_msn_applied_to_node_on_disk.msn, n->max_msn_applied_to_node_on_disk.msn); - printf(" io time %lf decompress time %lf deserialize time %lf\n", - tokutime_to_seconds(bfe.io_time), - tokutime_to_seconds(bfe.decompress_time), + printf(" io time %lf decompress time %lf deserialize time %lf\n", + tokutime_to_seconds(bfe.io_time), + tokutime_to_seconds(bfe.decompress_time), tokutime_to_seconds(bfe.deserialize_time)); printf(" n_children=%d\n", n->n_children); @@ -277,7 +487,7 @@ static void dump_node(int fd, BLOCKNUM blocknum, FT ft) { if (n->height > 0) { printf("%" PRId64 "\n", BP_BLOCKNUM(n, i).b); NONLEAF_CHILDINFO bnc = BNC(n, i); - unsigned int n_bytes = toku_bnc_nbytesinbuf(bnc); + unsigned int n_bytes = toku_bnc_nbytesinbuf(bnc); int n_entries = toku_bnc_n_entries(bnc); if (n_bytes > 0 || n_entries > 0) { printf(" buffer contains %u bytes (%d items)\n", n_bytes, n_entries); @@ -402,8 +612,12 @@ static void dump_garbage_stats(int fd, FT ft) { uint64_t total_space = 0; uint64_t used_space = 0; toku_ft_get_garbage(ft, &total_space, &used_space); - printf("garbage total size\t%" PRIu64 "\n", total_space); - printf("garbage used size\t%" PRIu64 "\n", used_space); + printf("garbage total size :%20" PRIu64 "\n", total_space); + printf("garbage used size :%20" PRIu64 "\n", used_space); + float a=used_space,b=total_space; + + float percentage=((1-a/b)*100); + printf("Total garbage : %2.3f%%\n", percentage); } typedef struct __dump_node_extra { @@ -438,7 +652,7 @@ static void sub_block_deserialize(struct dump_sub_block *sb, unsigned char *sub_ static void verify_block(unsigned char *cp, uint64_t file_offset, uint64_t size) { // verify the header checksum const size_t node_header = 8 + sizeof (uint32_t) + sizeof (uint32_t) + sizeof (uint32_t); - + printf("%.8s layout_version=%u %u build=%d\n", cp, get_unaligned_uint32(cp+8), get_unaligned_uint32(cp+12), get_unaligned_uint32(cp+16)); unsigned char *sub_block_header = &cp[node_header]; @@ -544,7 +758,9 @@ static uint64_t getuint64(const char *f) { static void interactive_help(void) { fprintf(stderr, "help\n"); fprintf(stderr, "header\n"); - fprintf(stderr, "node NUMBER\n"); + cout <<"mr/MessagesReport [NUMBER] \n Reports messages for the level of the tree you want get more details about\n"; + cout <<"rf/readFile ft-file-name \n Switch to a different FT\n"; + fprintf(stderr, "node NUMBER \n"); fprintf(stderr, "bx OFFSET | block_translation OFFSET\n"); fprintf(stderr, "dumpdata 0|1\n"); fprintf(stderr, "fragmentation\n"); @@ -554,10 +770,160 @@ static void interactive_help(void) { fprintf(stderr, "quit\n"); } +static void freeNMC(NMC *msgs[], int height){ + for(int i=0;i<height;i++){ + if(msgs[i]!=NULL){ + delete(msgs[i]->count); + + while(msgs[i]->nextNode!=NULL){ + NMC* ptr=msgs[i]->nextNode; + msgs[i]=msgs[i]->nextNode; + delete ptr; + + } + msgs[i]=NULL; + } + } +} + +static void writeTree(NMC *msgs[],int height,char *name UU()){ + ofstream mytree ("/tmp/tree.txt",fstream::out); + if (mytree.is_open()){ + for(int i=height;i>=0;i--){ + NMC * ptr=msgs[i]; + mytree <<i<<endl; + while(ptr!=NULL){ + mytree << ptr->id<<"\t"; + if(ptr->clean!=0)mytree << "1"<<"\t"; + else mytree << "0"<<"\t"; + for(int j=0;j<15;j++)mytree << ptr->count[j]<<" "; + mytree << ptr->count[i]<<endl; + ptr=ptr->nextNode; + } + mytree <<endl; + } + } + else cout << "Unable to open file"; + mytree.close(); +} + +static void writeJson(NMC *msgs[],int height,const char *name){ + ofstream mytree (name,fstream::out); + if (mytree.is_open()){ + mytree <<"{\n \"FT\":["; + for(int i=height;i>=0;i--){ + NMC * ptr=msgs[i]; + mytree <<"{\n\"Level\": {\"Height\":\""<<i<<"\",\n \"Nodes\":["; + while(ptr!=NULL){ + mytree <<"{\"ID\":\""<< ptr->id<<"\","; + if(ptr->clean!=0){ + mytree <<"\"Messages\":["; + for(int j=0;j<16;j++) + { + mytree <<"{"; + switch (j) { + case FT_INSERT: mytree <<"\"INSERT\":\""<<ptr->count[j]<<"\""; break; + case FT_INSERT_NO_OVERWRITE: mytree <<"\"INSERT_NOVERWTE\":\""<<ptr->count[j]<<"\""; break; + case FT_DELETE_ANY: mytree <<"\"DELETE\":\""<<ptr->count[j]<<"\""; break; + case FT_ABORT_ANY: mytree <<"\"ABORT\":\""<<ptr->count[j]<<"\""; break; + case FT_COMMIT_ANY: mytree <<"\"COMMITY\":\""<<ptr->count[j]<<"\""; break; + case FT_COMMIT_BROADCAST_ALL: mytree <<"\"COMMIT_BROADCAST_ALL\":\""<<ptr->count[j]<<"\"" ; break; + case FT_COMMIT_BROADCAST_TXN: mytree <<"\"COMMIT_BROADCAST_TXN\":\""<<ptr->count[j]<<"\""; break; + case FT_ABORT_BROADCAST_TXN: mytree <<"\"ABORT_BROADCAST_TXN\":\""<<ptr->count[j]<<"\"";break; + case FT_OPTIMIZE: mytree <<"\"OPTIMIZE\":\""<<ptr->count[j]<<"\""; break; + case FT_OPTIMIZE_FOR_UPGRADE: mytree <<"\"OPTIMIZE_FOR_UPGRADE\":\""<<ptr->count[j]<<"\"";break; + case FT_UPDATE: mytree <<"\"UPDATE\":\""<<ptr->count[j]<<"\""; break; + case FT_UPDATE_BROADCAST_ALL: mytree <<"\"UPDATE_BROADCAST_ALL\":\""<<ptr->count[j]<<"\""; break; + } + mytree <<"}"; + if(j<15)mytree<<","; + } + + mytree <<"]}"; + + } + else { + mytree <<"\"Messages\":\""<< "0"<<"\"}"; + } + if(ptr->nextNode!=NULL)mytree <<",\n"; + else mytree <<"]}\n"; + ptr=ptr->nextNode; + } + mytree <<"\n}\n"; + if(i!=0)mytree <<",\n"; + } + mytree <<"\n]}\n"; + + } + else cout << "Unable to open file"; + mytree.close(); +} + +static void writeTree(NMC *msgs[],int height){ + ofstream mytree ("/tmp/tree1.txt",fstream::out); + if (mytree.is_open()){ + for(int i=height;i>=0;i--){ + NMC * ptr=msgs[i]; + mytree <<i<<endl; + while(ptr!=NULL){ + mytree << ptr->id<<","; + if(ptr->clean!=0)mytree << "1"<<","; + else mytree << "0"<<","; + for(int j=0;j<15;j++)mytree << ptr->count[j]<<","; + mytree << ptr->count[i]<<endl; + ptr=ptr->nextNode; + } + mytree <<".\""; + } + } + else cout << "Unable to open file"; + mytree.close(); +} + +static void FT_to_JSON(int fd, FT ft, CACHEFILE cf, const char * JsonFile){ + toku_ft_free(ft); + open_header(fd, &ft, cf); + int root=getRootNode(ft); + BLOCKNUM off = make_blocknum(root); + int height=getHeight(fd,off, ft); + NMC *msgs[height]; + for(int i=0;i<=height;i++){ + msgs[i]=NULL; + } + open_header(fd, &ft, cf); + root=getRootNode(ft); + off = make_blocknum(root); + countMessagesInFT(fd,off, ft,msgs); + cout <<"to STD output: \n"; + treeToSTDout(msgs,height); + writeTree(msgs,height); + cout<<"FT's json file was generated here:"; + if(JsonFile!=NULL) { + cout <<JsonFile; + writeJson(msgs,height,JsonFile); + } + else { + cout <<"./FT.json"; + writeJson(msgs,height,"./FT.json"); + } + cout<<endl; + freeNMC(msgs,height); + exit(0); +} + static void run_iteractive_loop(int fd, FT ft, CACHEFILE cf) { + toku_ft_free(ft); + open_header(fd, &ft, cf); + int root=getRootNode(ft); + BLOCKNUM off = make_blocknum(root); + int height=getHeight(fd,off, ft); + NMC *msgs[height]; + for(int i=0;i<=height;i++){ + msgs[i]=NULL; + } while (1) { - printf("ftdump>"); fflush(stdout); - enum { maxline = 64}; + printf("ftdump>"); + fflush(stdout); char line[maxline+1]; int r = readline(line, maxline); if (r == EOF) @@ -565,23 +931,57 @@ static void run_iteractive_loop(int fd, FT ft, CACHEFILE cf) { const int maxfields = 4; char *fields[maxfields]; int nfields = split_fields(line, fields, maxfields); - if (nfields == 0) + if (nfields == 0) continue; if (strcmp(fields[0], "help") == 0) { interactive_help(); } else if (strcmp(fields[0], "header") == 0) { toku_ft_free(ft); open_header(fd, &ft, cf); - dump_header(ft); + } else if (strcmp(fields[0], "rn") == 0||strcmp(fields[0], "rootNode")==0||strcmp(fields[0], "rootnode") == 0) { + printf("Root node :%d\n",root); } else if (strcmp(fields[0], "block") == 0 && nfields == 2) { BLOCKNUM blocknum = make_blocknum(getuint64(fields[1])); dump_block(fd, blocknum, ft); + }else if ((strcmp(fields[0], "readFile") == 0 ||strcmp(fields[0], "readfile") == 0 ||strcmp(fields[0], "rf") == 0 )&& nfields == 2) { + fname=fields[1]; + fd = open(fname, O_RDWR + O_BINARY); + toku_ft_free(ft); + open_header(fd, &ft, cf); + root=getRootNode(ft); + off = make_blocknum(root); + height=getHeight(fd,off, ft); + if (fd < 0) { + fprintf(stderr, "%s: can not open the FT dump %s errno %d\n", arg0, fname, errno); + continue; + } } else if (strcmp(fields[0], "node") == 0 && nfields == 2) { - BLOCKNUM off = make_blocknum(getuint64(fields[1])); + off = make_blocknum(getuint64(fields[1])); dump_node(fd, off, ft); - } else if (strcmp(fields[0], "dumpdata") == 0 && nfields == 2) { + }else if ((strcmp(fields[0], "mr") == 0||(strcmp(fields[0], "nc")) == 0 ||strcmp(fields[0], "messagesReport") == 0 )) { + freeNMC(msgs,height); + toku_ft_free(ft); + open_header(fd, &ft, cf); + root=getRootNode(ft); + off = make_blocknum(root); + countMessagesInFT(fd,off, ft,msgs); + int level=-1; + if(nfields == 2)level=getuint64(fields[1]); + if(level>=0){ + levelToSTDout(msgs[level], level); + } + else{ + cout <<"to STD output: \n"; + treeToSTDout(msgs,height); + } + writeTree(msgs,height); + writeTree(msgs,height, NULL); + + }else if (strcmp(fields[0], "dumpdata") == 0 && nfields == 2) { + do_dump_data = strtol(fields[1], NULL, 10); - } else if (strcmp(fields[0], "block_translation") == 0 || strcmp(fields[0], "bx") == 0) { + } + else if (strcmp(fields[0], "block_translation") == 0 || strcmp(fields[0], "bx") == 0) { uint64_t offset = 0; if (nfields == 2) offset = getuint64(fields[1]); @@ -590,7 +990,7 @@ static void run_iteractive_loop(int fd, FT ft, CACHEFILE cf) { dump_fragmentation(fd, ft, do_tsv); } else if (strcmp(fields[0], "nodesizes") == 0) { dump_nodesizes(fd, ft); - } else if (strcmp(fields[0], "garbage") == 0) { + } else if (strcmp(fields[0], "garbage") == 0||strcmp(fields[0], "g") == 0) { dump_garbage_stats(fd, ft); } else if (strcmp(fields[0], "file") == 0 && nfields >= 3) { uint64_t offset = getuint64(fields[1]); @@ -604,14 +1004,18 @@ static void run_iteractive_loop(int fd, FT ft, CACHEFILE cf) { unsigned char newc = getuint64(fields[2]); set_file(fd, offset, newc); } else if (strcmp(fields[0], "quit") == 0 || strcmp(fields[0], "q") == 0) { - break; + toku_ft_free(ft); + exit(0); } } + freeNMC(msgs,height); } static int usage(void) { fprintf(stderr, "Usage: %s ", arg0); fprintf(stderr, "--interactive "); + fprintf(stderr, "--support /path/to/fractal-tree/file \n\t an interactive way to see what messages and/or switch between FTs"); + fprintf(stderr, "--json /path/to/fractal-tree/file [output json file]\n\t if left empty an FT.json will be created automatically"); fprintf(stderr, "--nodata "); fprintf(stderr, "--dumpdata 0|1 "); fprintf(stderr, "--header "); @@ -632,10 +1036,15 @@ int main (int argc, const char *const argv[]) { while (argc>0) { if (strcmp(argv[0], "--interactive") == 0 || strcmp(argv[0], "--i") == 0) { do_interactive = 1; + } + else if ((strcmp(argv[0], "--json") == 0 || strcmp(argv[0], "--s")== 0)&& argc >= 2) { + do_json = 1; + fname=argv[1]; + argc--; argv++; + break; } else if (strcmp(argv[0], "--nodata") == 0) { do_dump_data = 0; } else if (strcmp(argv[0], "--dumpdata") == 0 && argc > 1) { - argc--; argv++; do_dump_data = atoi(argv[0]); } else if (strcmp(argv[0], "--header") == 0) { do_header = 1; @@ -660,39 +1069,39 @@ int main (int argc, const char *const argv[]) { } argc--; argv++; } - if (argc != 1) - return usage(); + if (argc != 1 && do_json==0) + return usage(); int r = toku_ft_layer_init(); assert_zero(r); - - fname = argv[0]; + if(fname==NULL)fname = argv[0]; int fd = open(fname, O_RDWR + O_BINARY); if (fd < 0) { fprintf(stderr, "%s: can not open %s errno %d\n", arg0, fname, errno); return 1; } - // create a cachefile for the header CACHETABLE ct = NULL; toku_cachetable_create(&ct, 1<<25, (LSN){0}, 0); - CACHEFILE cf = NULL; r = toku_cachetable_openfd (&cf, ct, fd, fname); assert_zero(r); - FT ft = NULL; open_header(fd, &ft, cf); - + if (do_json ) { + const char *arg=argv[1]; + FT_to_JSON(fd, ft, cf,arg); + } if (do_interactive) { run_iteractive_loop(fd, ft, cf); - } else { + } + else { if (do_header) { dump_header(ft); } if (do_rootnode) { dump_node(fd, ft->h->root_blocknum, ft); - } + } if (do_node) { dump_node(fd, do_node_num, ft); } @@ -708,14 +1117,12 @@ int main (int argc, const char *const argv[]) { if (!do_header && !do_rootnode && !do_fragmentation && !do_translation_table && !do_garbage) { printf("Block translation:"); ft->blocktable.dump_translation_table(stdout); - dump_header(ft); - struct __dump_node_extra info; info.fd = fd; info.ft = ft; ft->blocktable.iterate(block_table::TRANSLATION_CHECKPOINTED, - dump_node_wrapper, &info, true, true); + dump_node_wrapper, &info, true, true); } } toku_cachefile_close(&cf, false, ZERO_LSN); diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc index d08fd15ecf7..d6c74aeb1d1 100644 --- a/storage/tokudb/ha_tokudb.cc +++ b/storage/tokudb/ha_tokudb.cc @@ -3272,7 +3272,7 @@ void ha_tokudb::start_bulk_insert(ha_rows rows) { lock_count = 0; if ((rows == 0 || rows > 1) && share->try_table_lock) { - if (get_prelock_empty(thd) && may_table_be_empty(transaction)) { + if (get_prelock_empty(thd) && may_table_be_empty(transaction) && transaction != NULL) { if (using_ignore || is_insert_ignore(thd) || thd->lex->duplicates != DUP_ERROR || table->s->next_number_key_offset) { acquire_table_lock(transaction, lock_write); @@ -3963,13 +3963,13 @@ int ha_tokudb::write_row(uchar * record) { goto cleanup; } } - txn = create_sub_trans ? sub_trans : transaction; - + if (tokudb_debug & TOKUDB_DEBUG_TXN) { + TOKUDB_HANDLER_TRACE("txn %p", txn); + } if (tokudb_debug & TOKUDB_DEBUG_CHECK_KEY) { test_row_packing(record,&prim_key,&row); } - if (loader) { error = loader->put(loader, &prim_key, &row); if (error) { @@ -4243,7 +4243,7 @@ int ha_tokudb::delete_row(const uchar * record) { bool has_null; THD* thd = ha_thd(); uint curr_num_DBs; - tokudb_trx_data* trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton);; + tokudb_trx_data* trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton); ha_statistic_increment(&SSV::ha_delete_count); @@ -4268,10 +4268,14 @@ int ha_tokudb::delete_row(const uchar * record) { goto cleanup; } + if (tokudb_debug & TOKUDB_DEBUG_TXN) { + TOKUDB_HANDLER_TRACE("all %p stmt %p sub_sp_level %p transaction %p", trx->all, trx->stmt, trx->sub_sp_level, transaction); + } + error = db_env->del_multiple( db_env, share->key_file[primary_key], - transaction, + transaction, &prim_key, &row, curr_num_DBs, @@ -7181,12 +7185,15 @@ To rename the table, make sure no transactions touch the table.", from, to); double ha_tokudb::scan_time() { TOKUDB_HANDLER_DBUG_ENTER(""); double ret_val = (double)stats.records / 3; + if (tokudb_debug & TOKUDB_DEBUG_RETURN) { + TOKUDB_HANDLER_TRACE("return %" PRIu64 " %f", (uint64_t) stats.records, ret_val); + } DBUG_RETURN(ret_val); } double ha_tokudb::keyread_time(uint index, uint ranges, ha_rows rows) { - TOKUDB_HANDLER_DBUG_ENTER(""); + TOKUDB_HANDLER_DBUG_ENTER("%u %u %" PRIu64, index, ranges, (uint64_t) rows); double ret_val; if (index == primary_key || key_is_clustering(&table->key_info[index])) { ret_val = read_time(index, ranges, rows); @@ -7204,6 +7211,9 @@ double ha_tokudb::keyread_time(uint index, uint ranges, ha_rows rows) (table->key_info[index].key_length + ref_length) + 1); ret_val = (rows + keys_per_block - 1)/ keys_per_block; + if (tokudb_debug & TOKUDB_DEBUG_RETURN) { + TOKUDB_HANDLER_TRACE("return %f", ret_val); + } DBUG_RETURN(ret_val); } @@ -7224,7 +7234,7 @@ double ha_tokudb::read_time( ha_rows rows ) { - TOKUDB_HANDLER_DBUG_ENTER(""); + TOKUDB_HANDLER_DBUG_ENTER("%u %u %" PRIu64, index, ranges, (uint64_t) rows); double total_scan; double ret_val; bool is_primary = (index == primary_key); @@ -7266,12 +7276,18 @@ double ha_tokudb::read_time( ret_val = is_clustering ? ret_val + 0.00001 : ret_val; cleanup: + if (tokudb_debug & TOKUDB_DEBUG_RETURN) { + TOKUDB_HANDLER_TRACE("return %f", ret_val); + } DBUG_RETURN(ret_val); } double ha_tokudb::index_only_read_time(uint keynr, double records) { - TOKUDB_HANDLER_DBUG_ENTER(""); + TOKUDB_HANDLER_DBUG_ENTER("%u %f", keynr, records); double ret_val = keyread_time(keynr, 1, (ha_rows)records); + if (tokudb_debug & TOKUDB_DEBUG_RETURN) { + TOKUDB_HANDLER_TRACE("return %f", ret_val); + } DBUG_RETURN(ret_val); } @@ -7346,7 +7362,7 @@ ha_rows ha_tokudb::records_in_range(uint keynr, key_range* start_key, key_range* cleanup: if (tokudb_debug & TOKUDB_DEBUG_RETURN) { - TOKUDB_HANDLER_TRACE("%" PRIu64 " %" PRIu64, (uint64_t) ret_val, rows); + TOKUDB_HANDLER_TRACE("return %" PRIu64 " %" PRIu64, (uint64_t) ret_val, rows); } DBUG_RETURN(ret_val); } diff --git a/storage/tokudb/ha_tokudb_admin.cc b/storage/tokudb/ha_tokudb_admin.cc index d6da45733a5..b109cd1b976 100644 --- a/storage/tokudb/ha_tokudb_admin.cc +++ b/storage/tokudb/ha_tokudb_admin.cc @@ -156,18 +156,47 @@ int ha_tokudb::analyze(THD *thd, HA_CHECK_OPT *check_opt) { bool is_unique = false; if (i == primary_key || (key_info->flags & HA_NOSAME)) is_unique = true; + uint64_t rows = 0; + uint64_t deleted_rows = 0; int error = tokudb::analyze_card(share->key_file[i], txn, is_unique, num_key_parts, &rec_per_key[total_key_parts], - tokudb_cmp_dbt_key_parts, analyze_progress, &analyze_progress_extra); + tokudb_cmp_dbt_key_parts, analyze_progress, &analyze_progress_extra, + &rows, &deleted_rows); + sql_print_information("tokudb analyze %d %" PRIu64 " %" PRIu64, error, rows, deleted_rows); if (error != 0 && error != ETIME) { result = HA_ADMIN_FAILED; - } else { - // debug - if (tokudb_debug & TOKUDB_DEBUG_ANALYZE) { - TOKUDB_HANDLER_TRACE("%s.%s.%s", - table_share->db.str, table_share->table_name.str, i == primary_key ? "primary" : table_share->key_info[i].name); - for (uint j = 0; j < num_key_parts; j++) - TOKUDB_HANDLER_TRACE("%lu", rec_per_key[total_key_parts+j]); - } + } + if (error != 0 && rows == 0 && deleted_rows > 0) { + result = HA_ADMIN_FAILED; + } + double f = THDVAR(thd, analyze_delete_fraction); + if (result == HA_ADMIN_FAILED || (double) deleted_rows > f * (rows + deleted_rows)) { + char name[256]; int namelen; + namelen = snprintf(name, sizeof name, "%.*s.%.*s.%s", + (int) table_share->db.length, table_share->db.str, + (int) table_share->table_name.length, table_share->table_name.str, + key_name); + thd->protocol->prepare_for_resend(); + thd->protocol->store(name, namelen, system_charset_info); + thd->protocol->store("analyze", 7, system_charset_info); + thd->protocol->store("info", 4, system_charset_info); + char rowmsg[256]; int rowmsglen; + rowmsglen = snprintf(rowmsg, sizeof rowmsg, "rows processed %" PRIu64 " rows deleted %" PRIu64, rows, deleted_rows); + thd->protocol->store(rowmsg, rowmsglen, system_charset_info); + thd->protocol->write(); + + sql_print_information("tokudb analyze on %.*s %.*s", + namelen, name, rowmsglen, rowmsg); + } + if (tokudb_debug & TOKUDB_DEBUG_ANALYZE) { + char name[256]; int namelen; + namelen = snprintf(name, sizeof name, "%.*s.%.*s.%s", + (int) table_share->db.length, table_share->db.str, + (int) table_share->table_name.length, table_share->table_name.str, + key_name); + TOKUDB_HANDLER_TRACE("%.*s rows %" PRIu64 " deleted %" PRIu64, + namelen, name, rows, deleted_rows); + for (uint j = 0; j < num_key_parts; j++) + TOKUDB_HANDLER_TRACE("%lu", rec_per_key[total_key_parts+j]); } total_key_parts += num_key_parts; } diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc index bfc9f09f0e7..5dada7777a0 100644 --- a/storage/tokudb/hatoku_hton.cc +++ b/storage/tokudb/hatoku_hton.cc @@ -780,7 +780,7 @@ extern "C" enum durability_properties thd_get_durability_property(const MYSQL_TH #endif // Determine if an fsync is used when a transaction is committed. -static bool tokudb_fsync_on_commit(THD *thd, tokudb_trx_data *trx, DB_TXN *txn) { +static bool tokudb_sync_on_commit(THD *thd, tokudb_trx_data *trx, DB_TXN *txn) { #if MYSQL_VERSION_ID >= 50600 // Check the client durability property which is set during 2PC if (thd_get_durability_property(thd) == HA_IGNORE_DURABILITY) @@ -791,17 +791,19 @@ static bool tokudb_fsync_on_commit(THD *thd, tokudb_trx_data *trx, DB_TXN *txn) if (txn->is_prepared(txn) && mysql_bin_log.is_open()) return false; #endif + if (tokudb_fsync_log_period > 0) + return false; return THDVAR(thd, commit_sync) != 0; } static int tokudb_commit(handlerton * hton, THD * thd, bool all) { - TOKUDB_DBUG_ENTER(""); + TOKUDB_DBUG_ENTER("%u", all); DBUG_PRINT("trans", ("ending transaction %s", all ? "all" : "stmt")); tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, hton); DB_TXN **txn = all ? &trx->all : &trx->stmt; DB_TXN *this_txn = *txn; if (this_txn) { - uint32_t syncflag = tokudb_fsync_on_commit(thd, trx, this_txn) ? 0 : DB_TXN_NOSYNC; + uint32_t syncflag = tokudb_sync_on_commit(thd, trx, this_txn) ? 0 : DB_TXN_NOSYNC; if (tokudb_debug & TOKUDB_DEBUG_TXN) { TOKUDB_TRACE("commit trx %u txn %p syncflag %u", all, this_txn, syncflag); } @@ -811,11 +813,11 @@ static int tokudb_commit(handlerton * hton, THD * thd, bool all) { commit_txn_with_progress(this_txn, syncflag, thd); // test hook to induce a crash on a debug build DBUG_EXECUTE_IF("tokudb_crash_commit_after", DBUG_SUICIDE();); - if (this_txn == trx->sp_level) { - trx->sp_level = 0; - } - *txn = 0; + *txn = NULL; trx->sub_sp_level = NULL; + if (this_txn == trx->sp_level || trx->all == NULL) { + trx->sp_level = NULL; + } } else if (tokudb_debug & TOKUDB_DEBUG_TXN) { TOKUDB_TRACE("nothing to commit %d", all); @@ -825,7 +827,7 @@ static int tokudb_commit(handlerton * hton, THD * thd, bool all) { } static int tokudb_rollback(handlerton * hton, THD * thd, bool all) { - TOKUDB_DBUG_ENTER(""); + TOKUDB_DBUG_ENTER("%u", all); DBUG_PRINT("trans", ("aborting transaction %s", all ? "all" : "stmt")); tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, hton); DB_TXN **txn = all ? &trx->all : &trx->stmt; @@ -836,11 +838,11 @@ static int tokudb_rollback(handlerton * hton, THD * thd, bool all) { } tokudb_cleanup_handlers(trx, this_txn); abort_txn_with_progress(this_txn, thd); - if (this_txn == trx->sp_level) { - trx->sp_level = 0; - } - *txn = 0; + *txn = NULL; trx->sub_sp_level = NULL; + if (this_txn == trx->sp_level || trx->all == NULL) { + trx->sp_level = NULL; + } } else { if (tokudb_debug & TOKUDB_DEBUG_TXN) { @@ -852,6 +854,13 @@ static int tokudb_rollback(handlerton * hton, THD * thd, bool all) { } #if TOKU_INCLUDE_XA +static bool tokudb_sync_on_prepare(void) { + // skip sync of log if fsync log period > 0 + if (tokudb_fsync_log_period > 0) + return false; + else + return true; +} static int tokudb_xa_prepare(handlerton* hton, THD* thd, bool all) { TOKUDB_DBUG_ENTER(""); @@ -866,6 +875,7 @@ static int tokudb_xa_prepare(handlerton* hton, THD* thd, bool all) { tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, hton); DB_TXN* txn = all ? trx->all : trx->stmt; if (txn) { + uint32_t syncflag = tokudb_sync_on_prepare() ? 0 : DB_TXN_NOSYNC; if (tokudb_debug & TOKUDB_DEBUG_TXN) { TOKUDB_TRACE("doing txn prepare:%d:%p", all, txn); } @@ -874,7 +884,7 @@ static int tokudb_xa_prepare(handlerton* hton, THD* thd, bool all) { thd_get_xid(thd, (MYSQL_XID*) &thd_xid); // test hook to induce a crash on a debug build DBUG_EXECUTE_IF("tokudb_crash_prepare_before", DBUG_SUICIDE();); - r = txn->xa_prepare(txn, &thd_xid); + r = txn->xa_prepare(txn, &thd_xid, syncflag); // test hook to induce a crash on a debug build DBUG_EXECUTE_IF("tokudb_crash_prepare_after", DBUG_SUICIDE();); } @@ -939,7 +949,7 @@ cleanup: #endif static int tokudb_savepoint(handlerton * hton, THD * thd, void *savepoint) { - TOKUDB_DBUG_ENTER(""); + TOKUDB_DBUG_ENTER("%p", savepoint); int error; SP_INFO save_info = (SP_INFO)savepoint; tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, hton); @@ -960,6 +970,9 @@ static int tokudb_savepoint(handlerton * hton, THD * thd, void *savepoint) { trx->sp_level = save_info->txn; save_info->in_sub_stmt = false; } + if (tokudb_debug & TOKUDB_DEBUG_TXN) { + TOKUDB_TRACE("begin txn %p", save_info->txn); + } save_info->trx = trx; error = 0; cleanup: @@ -967,7 +980,7 @@ cleanup: } static int tokudb_rollback_to_savepoint(handlerton * hton, THD * thd, void *savepoint) { - TOKUDB_DBUG_ENTER(""); + TOKUDB_DBUG_ENTER("%p", savepoint); int error; SP_INFO save_info = (SP_INFO)savepoint; DB_TXN* parent = NULL; @@ -975,6 +988,9 @@ static int tokudb_rollback_to_savepoint(handlerton * hton, THD * thd, void *save tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, hton); parent = txn_to_rollback->parent; + if (tokudb_debug & TOKUDB_DEBUG_TXN) { + TOKUDB_TRACE("rollback txn %p", txn_to_rollback); + } if (!(error = txn_to_rollback->abort(txn_to_rollback))) { if (save_info->in_sub_stmt) { trx->sub_sp_level = parent; @@ -988,24 +1004,27 @@ static int tokudb_rollback_to_savepoint(handlerton * hton, THD * thd, void *save } static int tokudb_release_savepoint(handlerton * hton, THD * thd, void *savepoint) { - TOKUDB_DBUG_ENTER(""); - int error; - + TOKUDB_DBUG_ENTER("%p", savepoint); + int error = 0; SP_INFO save_info = (SP_INFO)savepoint; DB_TXN* parent = NULL; DB_TXN* txn_to_commit = save_info->txn; tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, hton); parent = txn_to_commit->parent; - if (!(error = txn_to_commit->commit(txn_to_commit, 0))) { + if (tokudb_debug & TOKUDB_DEBUG_TXN) { + TOKUDB_TRACE("commit txn %p", txn_to_commit); + } + DB_TXN *child = txn_to_commit->get_child(txn_to_commit); + if (child == NULL && !(error = txn_to_commit->commit(txn_to_commit, 0))) { if (save_info->in_sub_stmt) { trx->sub_sp_level = parent; } else { trx->sp_level = parent; } - save_info->txn = NULL; } + save_info->txn = NULL; TOKUDB_DBUG_RETURN(error); } @@ -1447,6 +1466,7 @@ static struct st_mysql_sys_var *tokudb_system_variables[] = { MYSQL_SYSVAR(disable_slow_upsert), #endif MYSQL_SYSVAR(analyze_time), + MYSQL_SYSVAR(analyze_delete_fraction), MYSQL_SYSVAR(fsync_log_period), #if TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL MYSQL_SYSVAR(gdb_path), diff --git a/storage/tokudb/hatoku_hton.h b/storage/tokudb/hatoku_hton.h index ff17ecc276d..71d78e57d63 100644 --- a/storage/tokudb/hatoku_hton.h +++ b/storage/tokudb/hatoku_hton.h @@ -316,16 +316,9 @@ static MYSQL_THDVAR_BOOL(disable_slow_upsert, ); #endif -static MYSQL_THDVAR_UINT(analyze_time, - 0, - "analyze time", - NULL, - NULL, - 5, // default - 0, // min - ~0U, // max - 1 // blocksize -); +static MYSQL_THDVAR_UINT(analyze_time, 0, "analyze time (seconds)", NULL /*check*/, NULL /*update*/, 5 /*default*/, 0 /*min*/, ~0U /*max*/, 1 /*blocksize*/); + +static MYSQL_THDVAR_DOUBLE(analyze_delete_fraction, 0, "fraction of rows allowed to be deleted", NULL /*check*/, NULL /*update*/, 1.0 /*def*/, 0 /*min*/, 1.0 /*max*/, 1); static void tokudb_checkpoint_lock(THD * thd); static void tokudb_checkpoint_unlock(THD * thd); @@ -430,7 +423,7 @@ static int tokudb_killed_callback(void) { return thd_killed(thd); } -static bool tokudb_killed_thd_callback(void *extra) { +static bool tokudb_killed_thd_callback(void *extra, uint64_t deleted_rows) { THD *thd = static_cast<THD *>(extra); return thd_killed(thd) != 0; } diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/5733_tokudb.result b/storage/tokudb/mysql-test/tokudb_bugs/r/5733_tokudb.result index 07e8b37c263..a05587cb0a6 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/5733_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/5733_tokudb.result @@ -10005,7 +10005,7 @@ insert into t values (9999,0); commit; explain select id from t where id>0 limit 10; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t index_or_range PRIMARY PRIMARY 8 NULL # Using where; Using index_or_range +1 SIMPLE t range_or_index PRIMARY PRIMARY 8 NULL # Using where; Using index explain select * from t where id>0 limit 10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t range PRIMARY PRIMARY 8 NULL # Using where diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db817.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db817.result new file mode 100644 index 00000000000..d69f0dabcb3 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db817.result @@ -0,0 +1,33 @@ +drop table if exists ti; +create table ti (id int primary key) engine=innodb; +begin; +insert into ti values (0); +savepoint b; +insert into ti values (1); +savepoint a2; +insert into ti values (2); +savepoint b; +insert into ti values (3); +rollback to a2; +commit; +select * from ti; +id +0 +1 +drop table if exists tt; +create table tt (id int primary key) engine=tokudb; +begin; +insert into tt values (0); +savepoint b; +insert into tt values (1); +savepoint a2; +insert into tt values (2); +savepoint b; +insert into tt values (3); +rollback to a2; +commit; +select * from tt; +id +0 +1 +drop table ti,tt; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/5733_tokudb.test b/storage/tokudb/mysql-test/tokudb_bugs/t/5733_tokudb.test index 2e30c839905..192004cb113 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/t/5733_tokudb.test +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/5733_tokudb.test @@ -20,9 +20,18 @@ while ($i < $n) { } commit; -# TokuDB may do index or range scan on this. Both are ok -replace_column 9 #; ---replace_result index index_or_range range index_or_range +# the plan for the following query should be a range scan. about 1 of 10 times, +# the plan is an index scan. the different scan type occurs because the query optimizer +# is handed different row counts by tokudb::records_in_range. the cost estimates made +# by the query optimizer are very close to begin with. sometimes, the cost of an index +# scan is less than the cost of a range scan. +# +# if a tokudb checkpoint occurs before this query is run, then the records_in_range +# function returns a larger than expected row estimate. +# +# column 4 is the join type (should be range or index) +# column 9 is the estimated key count +replace_column 4 range_or_index 9 #; explain select id from t where id>0 limit 10; replace_column 9 #; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db817.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db817.test new file mode 100644 index 00000000000..53c9edc3893 --- /dev/null +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db817.test @@ -0,0 +1,38 @@ +# verify that duplicate savepoint names in innodb and tokudb work the same +source include/have_innodb.inc; +source include/have_tokudb.inc; +disable_warnings; +drop table if exists ti; +enable_warnings; +create table ti (id int primary key) engine=innodb; +begin; +insert into ti values (0); +savepoint b; +insert into ti values (1); +savepoint a2; +insert into ti values (2); +savepoint b; +insert into ti values (3); +rollback to a2; +commit; +select * from ti; + +disable_warnings; +drop table if exists tt; +enable_warnings; +create table tt (id int primary key) engine=tokudb; +begin; +insert into tt values (0); +savepoint b; +insert into tt values (1); +savepoint a2; +insert into tt values (2); +savepoint b; +insert into tt values (3); +rollback to a2; +commit; +select * from tt; + +drop table ti,tt; + + diff --git a/storage/tokudb/scripts/make.mysql.bash b/storage/tokudb/scripts/make.mysql.bash index a614424d9a0..c1259797590 100755 --- a/storage/tokudb/scripts/make.mysql.bash +++ b/storage/tokudb/scripts/make.mysql.bash @@ -117,6 +117,7 @@ elif [ $build_type = enterprise ] ; then github_download Tokutek/tokudb-backup-plugin $(git_tree $git_tag $backup_tree) tokudb-backup-plugin mv tokudb-backup-plugin plugin github_download Tokutek/backup-enterprise $(git_tree $git_tag $backup_tree) backup-enterprise + rm -rf plugin/tokudb-backup-plugin/backup mv backup-enterprise/backup plugin/tokudb-backup-plugin rm -rf backup-enterprise fi diff --git a/storage/tokudb/scripts/make.mysql.debug.env.bash b/storage/tokudb/scripts/make.mysql.debug.env.bash index 08ea19827bc..3f8b4e6c219 100755 --- a/storage/tokudb/scripts/make.mysql.debug.env.bash +++ b/storage/tokudb/scripts/make.mysql.debug.env.bash @@ -62,7 +62,7 @@ tokudbengine=tokudb-engine tokudbengine_tree=master ftindex=ft-index ftindex_tree=master -backup=backup-community +backup=tokudb-backup-plugin backup_tree=master cc=gcc cxx=g++ @@ -119,9 +119,9 @@ if [ $? != 0 ] ; then exit 1; fi ln -s ../../$tokudbengine/storage/tokudb tokudb if [ $? != 0 ] ; then exit 1; fi popd -pushd $mysql_tree +pushd $mysql_tree/plugin if [ $? != 0 ] ; then exit 1; fi -ln -s ../$backup/backup toku_backup +ln -s ../../$backup $backup if [ $? != 0 ] ; then exit 1; fi popd pushd $mysql_tree/scripts diff --git a/storage/tokudb/tokudb_card.h b/storage/tokudb/tokudb_card.h index 797c705bbaf..22e6fb9b3da 100644 --- a/storage/tokudb/tokudb_card.h +++ b/storage/tokudb/tokudb_card.h @@ -218,15 +218,32 @@ namespace tokudb { return error; } + struct analyze_card_cursor_callback_extra { + int (*analyze_progress)(void *extra, uint64_t rows); + void *analyze_extra; + uint64_t *rows; + uint64_t *deleted_rows; + }; + + bool analyze_card_cursor_callback(void *extra, uint64_t deleted_rows) { + analyze_card_cursor_callback_extra *a_extra = static_cast<analyze_card_cursor_callback_extra *>(extra); + *a_extra->deleted_rows += deleted_rows; + int r = a_extra->analyze_progress(a_extra->analyze_extra, *a_extra->rows); + sql_print_information("tokudb analyze_card_cursor_callback %u %" PRIu64 " %" PRIu64, r, *a_extra->deleted_rows, deleted_rows); + return r != 0; + } + // Compute records per key for all key parts of the ith key of the table. // For each key part, put records per key part in *rec_per_key_part[key_part_index]. // Returns 0 if success, otherwise an error number. // TODO statistical dives into the FT int analyze_card(DB *db, DB_TXN *txn, bool is_unique, uint64_t num_key_parts, uint64_t *rec_per_key_part, int (*key_compare)(DB *, const DBT *, const DBT *, uint), - int (*analyze_progress)(void *extra, uint64_t rows), void *progress_extra) { + int (*analyze_progress)(void *extra, uint64_t rows), void *progress_extra, + uint64_t *return_rows, uint64_t *return_deleted_rows) { int error = 0; uint64_t rows = 0; + uint64_t deleted_rows = 0; uint64_t unique_rows[num_key_parts]; if (is_unique && num_key_parts == 1) { // dont compute for unique keys with a single part. we already know the answer. @@ -235,6 +252,8 @@ namespace tokudb { DBC *cursor = NULL; error = db->cursor(db, txn, &cursor, 0); if (error == 0) { + analyze_card_cursor_callback_extra e = { analyze_progress, progress_extra, &rows, &deleted_rows }; + cursor->c_set_check_interrupt_callback(cursor, analyze_card_cursor_callback, &e); for (uint64_t i = 0; i < num_key_parts; i++) unique_rows[i] = 1; // stop looking when the entire dictionary was analyzed, or a cap on execution time was reached, or the analyze was killed. @@ -243,8 +262,8 @@ namespace tokudb { while (1) { error = cursor->c_get(cursor, &key, 0, DB_NEXT); if (error != 0) { - if (error == DB_NOTFOUND) - error = 0; // eof is not an error + if (error == DB_NOTFOUND || error == TOKUDB_INTERRUPTED) + error = 0; // not an error break; } rows++; @@ -287,10 +306,12 @@ namespace tokudb { } } // return cardinality - if (error == 0 || error == ETIME) { - for (uint64_t i = 0; i < num_key_parts; i++) - rec_per_key_part[i] = rows / unique_rows[i]; - } + if (return_rows) + *return_rows = rows; + if (return_deleted_rows) + *return_deleted_rows = deleted_rows; + for (uint64_t i = 0; i < num_key_parts; i++) + rec_per_key_part[i] = rows / unique_rows[i]; return error; } } diff --git a/storage/xtradb/include/os0sync.h b/storage/xtradb/include/os0sync.h index f968de7c6dd..bd37287f1a0 100644 --- a/storage/xtradb/include/os0sync.h +++ b/storage/xtradb/include/os0sync.h @@ -531,7 +531,7 @@ amount of increment. */ os_atomic_increment_ulint((ulong_t*) ptr, amount) # define os_atomic_increment_uint64(ptr, amount) \ - atomic_add_64_nv(ptr, amount) + atomic_add_64_nv((uint64_t *) ptr, amount) /* Returns the resulting value, ptr is pointer to target, amount is the amount to decrement. */ diff --git a/storage/xtradb/rem/rem0rec.cc b/storage/xtradb/rem/rem0rec.cc index c0ac08da9cc..c5cc9f02f04 100644 --- a/storage/xtradb/rem/rem0rec.cc +++ b/storage/xtradb/rem/rem0rec.cc @@ -842,7 +842,6 @@ rec_get_converted_size_comp_prefix_low( } ut_ad(len <= col->len || col->mtype == DATA_BLOB - || col->mtype == DATA_VARMYSQL || (col->len == 0 && col->mtype == DATA_VARCHAR)); fixed_len = field->fixed_len; @@ -1272,7 +1271,6 @@ rec_convert_dtuple_to_rec_comp( } else { ut_ad(len <= dtype_get_len(type) || dtype_get_mtype(type) == DATA_BLOB - || dtype_get_mtype(type) == DATA_VARMYSQL || !strcmp(index->name, FTS_INDEX_TABLE_IND_NAME)); if (len < 128 diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 60de0a106a1..2351ee9d932 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -1,5 +1,5 @@ /* Copyright (c) 2004, 2013, Oracle and/or its affiliates. - Copyright (c) 2009, 2014, SkySQL Ab. + Copyright (c) 2009, 2015, MariaDB This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -20583,7 +20583,25 @@ static int my_uca_scanner_next_any(my_uca_scanner *scanner) if (((mblen= scanner->cs->cset->mb_wc(scanner->cs, wc, scanner->sbeg, scanner->send)) <= 0)) - return -1; + { + if (scanner->sbeg >= scanner->send) + return -1; /* No more bytes, end of line reached */ + /* + There are some more bytes left. Non-positive mb_len means that + we got an incomplete or a bad byte sequence. Consume mbminlen bytes. + */ + if ((scanner->sbeg+= scanner->cs->mbminlen) > scanner->send) + { + /* For safety purposes don't go beyond the string range. */ + scanner->sbeg= scanner->send; + } + /* + Treat every complete or incomplete mbminlen unit as a weight which is + greater than weight for any possible normal character. + 0xFFFF is greater than any possible weight in the UCA weight table. + */ + return 0xFFFF; + } scanner->sbeg+= mblen; if (wc[0] > scanner->level->maxchar) |