diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-11-03 14:49:17 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-11-03 14:49:17 +0200 |
commit | 533a13af069d8c9e6c5f4e1a72851497185ade03 (patch) | |
tree | 4623752e0c114e582fbbc0afcc02b67dede26b50 | |
parent | 4b3690b50433a169d9feed5dc45044a8934b5582 (diff) | |
parent | e6290a8270daf884f551230307225b358939bfab (diff) | |
download | mariadb-git-533a13af069d8c9e6c5f4e1a72851497185ade03.tar.gz |
Merge 10.3 into 10.4
96 files changed, 3165 insertions, 826 deletions
diff --git a/client/completion_hash.cc b/client/completion_hash.cc index 0d88aa9b15e..e5d3f485810 100644 --- a/client/completion_hash.cc +++ b/client/completion_hash.cc @@ -205,7 +205,8 @@ Bucket *find_longest_match(HashTable *ht, char *str, uint length, void completion_hash_clean(HashTable *ht) { free_root(&ht->mem_root,MYF(0)); - bzero((char*) ht->arBuckets,ht->nTableSize*sizeof(Bucket *)); + if (size_t s= ht->nTableSize) + bzero((char*) ht->arBuckets, s * sizeof(Bucket *)); } diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 4f3f1ff86da..5e350cf66bc 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -18,7 +18,7 @@ #include "client_priv.h" #include <sslopt-vars.h> -#include "../scripts/mysql_fix_privilege_tables_sql.c" +#include <../scripts/mysql_fix_privilege_tables_sql.c> #include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */ diff --git a/client/mysqldump.c b/client/mysqldump.c index 674788cafe0..d6ff2dd275f 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -39,7 +39,8 @@ ** 10 Jun 2003: SET NAMES and --no-set-names by Alexander Barkov */ -#define DUMP_VERSION "10.18" +/* on merge conflict, bump to a higher version again */ +#define DUMP_VERSION "10.19" #include <my_global.h> #include <my_sys.h> @@ -117,6 +118,21 @@ static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0, opt_no_data_m opt_events= 0, opt_comments_used= 0, opt_alltspcs=0, opt_notspcs= 0, opt_logging, opt_drop_trigger= 0 ; +#define OPT_SYSTEM_ALL 1 +#define OPT_SYSTEM_USERS 2 +#define OPT_SYSTEM_PLUGINS 4 +#define OPT_SYSTEM_UDFS 8 +#define OPT_SYSTEM_SERVERS 16 +#define OPT_SYSTEM_STATS 32 +#define OPT_SYSTEM_TIMEZONES 64 +static const char *opt_system_type_values[]= + {"all", "users", "plugins", "udfs", "servers", "stats", "timezones"}; +static TYPELIB opt_system_types= +{ + array_elements(opt_system_type_values), "system dump options", + opt_system_type_values, NULL +}; +static ulonglong opt_system= 0ULL; static my_bool insert_pat_inited= 0, debug_info_flag= 0, debug_check_flag= 0, select_field_names_inited= 0; static ulong opt_max_allowed_packet, opt_net_buffer_length; @@ -526,6 +542,8 @@ static struct my_option my_long_options[] = &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #include <sslopt-longopts.h> + {"system", 256, "Dump system tables as portable SQL", + &opt_system, &opt_system, &opt_system_types, GET_SET, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"tab",'T', "Create tab-separated textfile for each table to given path. (Create .sql " "and .txt files.) NOTE: This only works if mysqldump is run on the same " @@ -569,7 +587,7 @@ static const char *load_default_groups[]= static void maybe_exit(int error); static void die(int error, const char* reason, ...); static void maybe_die(int error, const char* reason, ...); -static void write_header(FILE *sql_file, char *db_name); +static void write_header(FILE *sql_file, const char *db_name); static void print_value(FILE *file, MYSQL_RES *result, MYSQL_ROW row, const char *prefix,const char *name, int string_value); @@ -580,6 +598,12 @@ static int init_dumping_tables(char *); static int init_dumping(char *, int init_func(char*)); static int dump_databases(char **); static int dump_all_databases(); +static int dump_all_users_roles_and_grants(); +static int dump_all_plugins(); +static int dump_all_udfs(); +static int dump_all_servers(); +static int dump_all_stats(); +static int dump_all_timezones(); static char *quote_name(const char *name, char *buff, my_bool force); char check_if_ignore_table(const char *table_name, char *table_type); static char *primary_key_fields(const char *table_name); @@ -641,9 +665,10 @@ static void print_version(void) static void short_usage_sub(FILE *f) { fprintf(f, "Usage: %s [OPTIONS] database [tables]\n", my_progname_short); - fprintf(f, "OR %s [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]\n", + fprintf(f, "OR %s [OPTIONS] --databases DB1 [DB2 DB3...]\n", my_progname_short); - fprintf(f, "OR %s [OPTIONS] --all-databases [OPTIONS]\n", my_progname_short); + fprintf(f, "OR %s [OPTIONS] --all-databases\n", my_progname_short); + fprintf(f, "OR %s [OPTIONS] --system=[SYSTEMOPTIONS]]\n", my_progname_short); } @@ -691,7 +716,7 @@ static const char *fix_for_comment(const char *ident) } -static void write_header(FILE *sql_file, char *db_name) +static void write_header(FILE *sql_file, const char *db_name) { if (opt_xml) { @@ -1038,6 +1063,76 @@ static int get_options(int *argc, char ***argv) if ((ho_error= handle_options(argc, argv, my_long_options, get_one_option))) return(ho_error); + if (opt_system & OPT_SYSTEM_ALL) + opt_system|= ~0; + + if (opt_system & OPT_SYSTEM_USERS && + (my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.db", MYF(MY_WME))) || + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.global_priv", MYF(MY_WME))) || + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.tables_priv", MYF(MY_WME))) || + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.columns_priv", MYF(MY_WME))) || + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.procs_priv", MYF(MY_WME))) || + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.user", MYF(MY_WME))) || + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.host", MYF(MY_WME))) || + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.proxies_priv", MYF(MY_WME))) || + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.roles_mapping", MYF(MY_WME))) || + /* and MySQL-8.0 role tables (role_edges and default_roles) as well */ + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.role_edges", MYF(MY_WME))) || + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.default_roles", MYF(MY_WME))))) + return(EX_EOM); + + if (opt_system & OPT_SYSTEM_PLUGINS && + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.plugin", MYF(MY_WME)))) + return(EX_EOM); + + if (opt_system & OPT_SYSTEM_UDFS && + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.func", MYF(MY_WME)))) + return(EX_EOM); + + if (opt_system & OPT_SYSTEM_SERVERS && + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.servers", MYF(MY_WME)))) + return(EX_EOM); + + if (opt_system & OPT_SYSTEM_STATS && + (my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.column_stats", MYF(MY_WME))) || + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.index_stats", MYF(MY_WME))) || + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.table_stats", MYF(MY_WME))) || + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.innodb_table_stats", MYF(MY_WME))) || + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.innodb_index_stats", MYF(MY_WME))))) + return(EX_EOM); + + if (opt_system & OPT_SYSTEM_TIMEZONES && + (my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.time_zone", MYF(MY_WME))) || + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.time_zone_leap_second", MYF(MY_WME))) || + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.time_zone_name", MYF(MY_WME))) || + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.time_zone_transition", MYF(MY_WME))) || + my_hash_insert(&ignore_table, + (uchar*) my_strdup("mysql.time_zone_transition_type", MYF(MY_WME))))) + return(EX_EOM); + *mysql_params->p_max_allowed_packet= opt_max_allowed_packet; *mysql_params->p_net_buffer_length= opt_net_buffer_length; if (debug_info_flag) @@ -1102,7 +1197,7 @@ static int get_options(int *argc, char ***argv) !(charset_info= get_charset_by_csname(default_charset, MY_CS_PRIMARY, MYF(MY_WME)))) exit(1); - if ((*argc < 1 && !opt_alldbs) || (*argc > 0 && opt_alldbs)) + if ((*argc < 1 && (!opt_alldbs && !opt_system)) || (*argc > 0 && opt_alldbs)) { short_usage(stderr); return EX_USAGE; @@ -1226,7 +1321,6 @@ static int fetch_db_collation(const char *db_name, my_bool err_status= FALSE; MYSQL_RES *db_cl_res; MYSQL_ROW db_cl_row; - if (mysql_select_db(mysql, db_name)) { DB_error(mysql, "when selecting the database"); @@ -2806,7 +2900,7 @@ static void get_sequence_structure(const char *seq, const char *db) number of fields in table, 0 if error */ -static uint get_table_structure(char *table, char *db, char *table_type, +static uint get_table_structure(const char *table, const char *db, char *table_type, char *ignore_flag) { my_bool init=0, delayed, write_data, complete_insert; @@ -3755,7 +3849,7 @@ static char *alloc_query_str(size_t size) */ -static void dump_table(char *table, char *db, const uchar *hash_key, size_t len) +static void dump_table(const char *table, const char *db, const uchar *hash_key, size_t len) { char ignore_flag; char buf[200], table_buff[NAME_LEN+3]; @@ -4288,6 +4382,442 @@ static char *getTableName(int reset) /* + dump user/role grants + ARGS + user_role: is either a user, or a role +*/ + +static int dump_grants(const char *user_role) +{ + DYNAMIC_STRING sqlbuf; + MYSQL_ROW row; + MYSQL_RES *tableres; + + init_dynamic_string_checked(&sqlbuf, "SHOW GRANTS FOR ", 256, 1024); + dynstr_append_checked(&sqlbuf, user_role); + + if (mysql_query_with_error_report(mysql, &tableres, sqlbuf.str)) + { + dynstr_free(&sqlbuf); + return 1; + } + while ((row= mysql_fetch_row(tableres))) + { + if (strncmp(row[0], "SET DEFAULT ROLE", sizeof("SET DEFAULT ROLE") - 1) == 0) + continue; + fprintf(md_result_file, "%s;\n", row[0]); + } + mysql_free_result(tableres); + dynstr_free(&sqlbuf); + return 0; +} + + +/* + dump create user +*/ + +static int dump_create_user(const char *user) +{ + DYNAMIC_STRING sqlbuf; + MYSQL_ROW row; + MYSQL_RES *tableres; + + init_dynamic_string_checked(&sqlbuf, "SHOW CREATE USER ", 256, 1024); + dynstr_append_checked(&sqlbuf, user); + + if (mysql_query_with_error_report(mysql, &tableres, sqlbuf.str)) + { + dynstr_free(&sqlbuf); + return 1; + } + while ((row= mysql_fetch_row(tableres))) + { + fprintf(md_result_file, "CREATE %sUSER %s%s;\n", opt_replace_into ? "/*M!100103 OR REPLACE */ ": "", + opt_ignore ? "IF NOT EXISTS " : "", + row[0] + sizeof("CREATE USER")); + } + mysql_free_result(tableres); + dynstr_free(&sqlbuf); + return 0; +} + + +/* + dump all users, roles and their grants +*/ + +static int dump_all_users_roles_and_grants() +{ + MYSQL_ROW row; + MYSQL_RES *tableres; + int result= 0; + /* Roles added in MariaDB-10.0.5 or MySQL-8.0 */ + my_bool maria_roles_exist= (mysql_get_server_version(mysql) >= 100005); + my_bool mysql_roles_exist= (mysql_get_server_version(mysql) >= 80001) && !maria_roles_exist; + + if (mysql_query_with_error_report(mysql, &tableres, + "SELECT CONCAT(QUOTE(u.user), '@', QUOTE(u.Host)) AS u " + "FROM mysql.user u " + " /*!80001 LEFT JOIN mysql.role_edges e " + " ON u.user=e.from_user " + " AND u.host=e.from_host " + " WHERE e.from_user IS NULL */" + " /*M!100005 WHERE is_role='N' */")) + return 1; + while ((row= mysql_fetch_row(tableres))) + { + if (opt_replace_into) + /* Protection against removing the current import user */ + /* MySQL-8.0 export capability */ + fprintf(md_result_file, + "DELIMITER |\n" + "/*M!100101 IF current_user()=\"%s\" THEN\n" + " SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001," + " MESSAGE_TEXT=\"Don't remove current user %s'\";\n" + "END IF */|\n" + "DELIMITER ;\n" + "/*!50701 DROP USER IF EXISTS %s */;\n", row[0], row[0], row[0]); + if (dump_create_user(row[0])) + result= 1; + /* if roles exist, defer dumping grants until after roles created */ + if (maria_roles_exist || mysql_roles_exist) + continue; + if (dump_grants(row[0])) + result= 1; + } + mysql_free_result(tableres); + + if (!(maria_roles_exist || mysql_roles_exist)) + goto exit; + + /* + Preserve current role active role, in case this dump is imported + in the same connection that assumes the active role at the beginning + is the same as at the end of the connection. This is so: + + #!/bin/sh + ( + echo "set role special_role; "; + cat mysqldump.sql; + echo "$dosomethingspecial" + ) | mysql -h $host + + doesn't end up with a suprise that the $dosomethingspecial cannot + be done because `special_role` isn't active. + + We create a new role for importing that becomes the default admin for new + roles. This is because without being a admin on new roles we don't + have the necessary privileges to grant users to a created role or to + create new admins for the created role. + + At the end of the import the mariadb_dump_import_role is be dropped, + which implictly drops all its admin aspects of the dropped role. + This is significiantly easlier than revoking the ADMIN of each role + from the current user. + */ + fputs("SELECT COALESCE(CURRENT_ROLE(),'NONE') into @current_role;\n" + "CREATE ROLE IF NOT EXISTS mariadb_dump_import_role;\n" + "GRANT mariadb_dump_import_role TO CURRENT_USER();\n" + "SET ROLE mariadb_dump_import_role;\n" + , md_result_file); + /* No show create role yet, MDEV-22311 */ + /* Roles, with user admins first, then roles they administer, and recurse on that */ + if (maria_roles_exist && mysql_query_with_error_report(mysql, &tableres, + "WITH RECURSIVE create_role_order AS" + " (SELECT 1 as n, roles_mapping.*" + " FROM mysql.roles_mapping" + " JOIN mysql.user USING (user,host)" + " WHERE is_role='N'" + " AND Admin_option='Y'" + " UNION SELECT c.n+1, r.*" + " FROM create_role_order c" + " JOIN mysql.roles_mapping r ON c.role=r.user" + " AND r.host=''" + " AND r.Admin_option='Y') " + "SELECT QUOTE(ROLE) AS r," + " CONCAT(QUOTE(user)," + " IF(HOST='', '', CONCAT('@', QUOTE(HOST)))) AS c," + " Admin_option " + "FROM create_role_order ORDER BY n, r, user")) + return 1; + /* + TODO Mysql - misses roles that have no admin or role members. + MySQL roles don't require an admin. + */ + if (mysql_roles_exist && mysql_query_with_error_report(mysql, &tableres, + "WITH RECURSIVE create_role_order AS" + " (SELECT 1 AS n," + " re.*" + " FROM mysql.role_edges re" + " JOIN mysql.user u ON re.TO_HOST=u.HOST" + " AND re.TO_USER = u.USER" + " LEFT JOIN mysql.role_edges re2 ON re.TO_USER=re2.FROM_USER" + " AND re2.TO_HOST=re2.FROM_HOST" + " WHERE re2.FROM_USER IS NULL" + " UNION SELECT c.n+1," + " re.*" + " FROM create_role_order c" + " JOIN mysql.role_edges re ON c.FROM_USER=re.TO_USER" + " AND c.FROM_HOST=re.TO_HOST) " + "SELECT CONCAT(QUOTE(FROM_USER), '/*!80001 @', QUOTE(FROM_HOST), '*/') AS r," + " CONCAT(QUOTE(TO_USER), IF(n=1, CONCAT('@', QUOTE(TO_HOST))," + " CONCAT('/*!80001 @', QUOTE(TO_HOST), ' */'))) AS u," + " WITH_ADMIN_OPTION " + "FROM create_role_order " + "ORDER BY n," + " FROM_USER," + " FROM_HOST," + " TO_USER," + " TO_HOST," + " WITH_ADMIN_OPTION")) + return 1; + while ((row= mysql_fetch_row(tableres))) + { + /* MySQL-8.0 export capability */ + if (opt_replace_into) + fprintf(md_result_file, + "/*!80001 DROP ROLE IF EXISTS %s */;\n", row[0]); + fprintf(md_result_file, + "/*!80001 CREATE ROLE %s%s */;\n", opt_ignore ? "IF NOT EXISTS " : "", row[0]); + /* By default created with current role */ + fprintf(md_result_file, + "%sROLE %s%s WITH ADMIN mariadb_dump_import_role */;\n", + opt_replace_into ? "/*M!100103 CREATE OR REPLACE ": "/*M!100005 CREATE ", + opt_ignore ? "IF NOT EXISTS " : "", row[0]); + fprintf(md_result_file, "/*M!100005 GRANT %s TO %s%s*/;\n", + row[0], row[1], (row[2][0] == 'Y') ? " WITH ADMIN OPTION " : ""); + } + mysql_free_result(tableres); + + /* users and their default role */ + if (maria_roles_exist && mysql_query_with_error_report(mysql, &tableres, + "select IF(default_role='', 'NONE', QUOTE(default_role)) as r," + "concat(QUOTE(User), '@', QUOTE(Host)) as u FROM mysql.user " + "/*M!100005 WHERE is_role='N' */")) + return 1; + if (mysql_roles_exist && mysql_query_with_error_report(mysql, &tableres, + "SELECT IF(DEFAULT_ROLE_HOST IS NULL, 'NONE', CONCAT(QUOTE(DEFAULT_ROLE_USER)," + " '@', QUOTE(DEFAULT_ROLE_HOST))) as r," + " CONCAT(QUOTE(mu.USER),'@',QUOTE(mu.HOST)) as u " + "FROM mysql.user mu LEFT JOIN mysql.default_roles using (USER, HOST)")) + return 1; + while ((row= mysql_fetch_row(tableres))) + { + if (dump_grants(row[1])) + result= 1; + fprintf(md_result_file, "/*M!100005 SET DEFAULT ROLE %s FOR %s */;\n", row[0], row[1]); + fprintf(md_result_file, "/*!80001 ALTER USER %s DEFAULT ROLE %s */;\n", row[1], row[0]); + } + mysql_free_result(tableres); + + if (maria_roles_exist && mysql_query_with_error_report(mysql, &tableres, + "SELECT DISTINCT QUOTE(m.role) AS r " + " FROM mysql.roles_mapping m" + " JOIN mysql.user u ON u.user = m.role" + " WHERE is_role='Y'" + " AND Admin_option='Y'" + " ORDER BY m.role")) + return 1; + if (mysql_roles_exist && mysql_query_with_error_report(mysql, &tableres, + "SELECT DISTINCT CONCAT(QUOTE(FROM_USER),'@', QUOTE(FROM_HOST)) AS r " + "FROM mysql.role_edges")) + return 1; + while ((row= mysql_fetch_row(tableres))) + { + if (dump_grants(row[0])) + result= 1; + } + mysql_free_result(tableres); + /* switch back */ + fputs("SET ROLE NONE;\n" + "DROP ROLE mariadb_dump_import_role;\n" + "/*M!100203 EXECUTE IMMEDIATE CONCAT('SET ROLE ', @current_role) */;\n", + md_result_file); +exit: + + return result; +} + + +/* + dump all plugins +*/ + +static int dump_all_plugins() +{ + MYSQL_ROW row; + MYSQL_RES *tableres; + + if (mysql_query_with_error_report(mysql, &tableres, "SHOW PLUGINS")) + return 1; + /* Name, Status, Type, Library, License */ + while ((row= mysql_fetch_row(tableres))) + { + if (strcmp("ACTIVE", row[1]) != 0) + continue; + /* Should we be skipping builtins? */ + if (row[3] == NULL) + continue; + if (opt_replace_into) + { + fprintf(md_result_file, "/*M!100401 UNINSTALL PLUGIN IF EXIST %s */;\n", + row[0]); + } + fprintf(md_result_file, + "INSTALL PLUGIN %s %s SONAME '%s';\n", row[0], + opt_ignore ? "/*M!100401 IF NOT EXISTS */" : "", row[3]); + } + mysql_free_result(tableres); + + return 0; +} + + +/* + dump all udfs +*/ + +static int dump_all_udfs() +{ + /* we don't support all these types yet, but get prepared if we do */ + static const char *udf_types[] = {"STRING", "REAL", "INT", "ROW", "DECIMAL", "TIME" }; + MYSQL_ROW row; + MYSQL_RES *tableres; + int retresult, result= 0; + + if (mysql_query_with_error_report(mysql, &tableres, "SELECT * FROM mysql.func")) + return 1; + /* Name, ret, dl, type*/ + while ((row= mysql_fetch_row(tableres))) + { + retresult= atoi(row[1]); + if (retresult < 0 || array_elements(udf_types) <= (size_t) retresult) + { + fprintf(stderr, "%s: Error: invalid return type on udf function '%s'\n", + my_progname_short, row[0]); + result= 1; + continue; + } + if (opt_replace_into) + { + fprintf(md_result_file, "/*!50701 DROP FUNCTION IF EXISTS %s */;\n", + row[0]); + } + fprintf(md_result_file, + "CREATE %s%sFUNCTION %s%s RETURNS %s SONAME '%s';\n", + opt_replace_into ? "/*M!100103 OR REPLACE */ ": "", + (strcmp("AGGREGATE", row[2])==0 ? "AGGREGATE " : ""), + opt_ignore ? "IF NOT EXISTS " : "", row[0], udf_types[retresult], row[2]); + } + mysql_free_result(tableres); + + return result; +} + + +/* + dump all servers +*/ + +static int dump_all_servers() +{ + /* No create server yet - MDEV-15696 */ + MYSQL_ROW row; + MYSQL_RES *tableres; + MYSQL_FIELD *f; + unsigned int num_fields, i; + my_bool comma_prepend= 0; + const char *qstring; + + if (mysql_query_with_error_report(mysql, &tableres, "SELECT * FROM mysql.servers")) + return 1; + num_fields= mysql_num_fields(tableres); + while ((row= mysql_fetch_row(tableres))) + { + fprintf(md_result_file,"CREATE %sSERVER %s%s FOREIGN DATA WRAPPER %s OPTIONS (", + opt_replace_into ? "/*M!100103 OR REPLACE */ ": "", + opt_ignore ? "/*M!100103 IF NOT EXISTS */ " : "", row[0], row[7]); + for (i= 1; i < num_fields; i++) + { + if (i == 7 || row[i][0] == '\0') /* Wrapper or empty string */ + continue; + f= &tableres->fields[i]; + qstring= (f->type == MYSQL_TYPE_STRING || f->type == MYSQL_TYPE_VAR_STRING) ? "'" : ""; + fprintf(md_result_file, "%s%s %s%s%s", + (comma_prepend ? ", " : ""), f->name, qstring, row[i], qstring); + comma_prepend= 1; + } + fputs(");\n", md_result_file); + } + mysql_free_result(tableres); + + return 0; +} + + +/* + dump all system statistical tables +*/ + +static int dump_all_stats() +{ + my_bool prev_no_create_info; + + if (mysql_select_db(mysql, "mysql")) + { + DB_error(mysql, "when selecting the database"); + return 1; /* If --force */ + } + fprintf(md_result_file,"\nUSE mysql;\n"); + prev_no_create_info= opt_no_create_info; + opt_no_create_info= 1; /* don't overwrite recreate tables */ + /* EITS added in 10.0.1 */ + if (mysql_get_server_version(mysql) >= 100001) + { + dump_table("column_stats", "mysql", NULL, 0); + dump_table("index_stats", "mysql", NULL, 0); + dump_table("table_stats", "mysql", NULL, 0); + } + /* Innodb may be disabled */ + if (!mysql_query(mysql, "show fields from innodb_index_stats")) + { + MYSQL_RES *tableres= mysql_store_result(mysql); + mysql_free_result(tableres); + dump_table("innodb_index_stats", "mysql", NULL, 0); + dump_table("innodb_table_stats", "mysql", NULL, 0); + } + opt_no_create_info= prev_no_create_info; + return 0; +} + + +/* + dump all system timezones +*/ + +static int dump_all_timezones() +{ + my_bool opt_prev_no_create_info; + if (mysql_select_db(mysql, "mysql")) + { + DB_error(mysql, "when selecting the database"); + return 1; /* If --force */ + } + opt_prev_no_create_info= opt_no_create_info; + opt_no_create_info= 1; + fprintf(md_result_file,"\nUSE mysql;\n"); + dump_table("time_zone", "mysql", NULL, 0); + dump_table("time_zone_name", "mysql", NULL, 0); + dump_table("time_zone_leap_second", "mysql", NULL, 0); + dump_table("time_zone_transition", "mysql", NULL, 0); + dump_table("time_zone_transition_type", "mysql", NULL, 0); + opt_no_create_info= opt_prev_no_create_info; + return 0; +} + + +/* dump all logfile groups and tablespaces */ @@ -6319,7 +6849,7 @@ int main(int argc, char **argv) dump_tablespaces_for_tables(*argv, (argv + 1), (argc - 1)); dump_selected_tables(*argv, (argv + 1), (argc - 1)); } - else + else if (argc > 0) { /* One or more databases, all tables */ if (!opt_alltspcs && !opt_notspcs) @@ -6328,6 +6858,25 @@ int main(int argc, char **argv) } } + if (opt_system & OPT_SYSTEM_PLUGINS) + dump_all_plugins(); + + if (opt_system & OPT_SYSTEM_USERS) + dump_all_users_roles_and_grants(); + + if (opt_system & OPT_SYSTEM_UDFS) + dump_all_udfs(); + + if (opt_system & OPT_SYSTEM_SERVERS) + dump_all_servers(); + + /* These must be last as they explictly change the current database to mysql */ + if (opt_system & OPT_SYSTEM_STATS) + dump_all_stats(); + + if (opt_system & OPT_SYSTEM_TIMEZONES) + dump_all_timezones(); + /* add 'START SLAVE' to end of dump */ if (opt_slave_apply && add_slave_statements()) goto err; diff --git a/cmake/Internal/CPack/CPackRPM.cmake b/cmake/Internal/CPack/CPackRPM.cmake index 2729667e319..92bcc6c6c25 100644 --- a/cmake/Internal/CPack/CPackRPM.cmake +++ b/cmake/Internal/CPack/CPackRPM.cmake @@ -26,26 +26,28 @@ set_from_component(VENDOR) # the scriptlet, if present, is appended (together with the %posttrans tag) # to the pre-uninstall scriptlet # -set(base_time "PRE") -set(base_type "UNINSTALL") -set(base_var CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_${base_time}_${base_type}_SCRIPT_FILE) -set(acc) +if(CMAKE_VERSION VERSION_LESS 3.18) + set(base_time "PRE") + set(base_type "UNINSTALL") + set(base_var CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_${base_time}_${base_type}_SCRIPT_FILE) + set(acc) -macro(read_one_file time_ type_ tag_) - set(var CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_${time_}_${type_}_SCRIPT_FILE) - if (${var}) - file(READ ${${var}} content) - set(acc "${tag_}\n${content}\n\n${acc}") - endif() -endmacro() + macro(read_one_file time_ type_ tag_) + set(var CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_${time_}_${type_}_SCRIPT_FILE) + if (${var}) + file(READ ${${var}} content) + set(acc "${tag_}\n${content}\n\n${acc}") + endif() + endmacro() -read_one_file("POST" "TRANS" "%posttrans") -if (acc) - set(orig_${base_var} ${${base_var}}) - read_one_file(${base_time} ${base_type} "") - set(${base_var} ${CPACK_TOPLEVEL_DIRECTORY}/SPECS/${CPACK_RPM_PACKAGE_COMPONENT}_${base_time}_${base_type}.scriptlet) - file(WRITE ${${base_var}} "${acc}") -endif() + read_one_file("POST" "TRANS" "%posttrans") + if (acc) + set(orig_${base_var} ${${base_var}}) + read_one_file(${base_time} ${base_type} "") + set(${base_var} ${CPACK_TOPLEVEL_DIRECTORY}/SPECS/${CPACK_RPM_PACKAGE_COMPONENT}_${base_time}_${base_type}.scriptlet) + file(WRITE ${${base_var}} "${acc}") + endif() +endif(CMAKE_VERSION VERSION_LESS 3.18) # load the original CPackRPM.cmake set(orig_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) @@ -59,7 +61,9 @@ set(CMAKE_MODULE_PATH ${orig_CMAKE_MODULE_PATH}) restore(LICENSE) restore(VENDOR) -set(${base_var} ${orig_${base_var}}) +if(${orig_${base_var}}) + set(${base_var} ${orig_${base_var}}) +endif() # per-component cleanup foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV) diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc index 525481d5e9e..c8ce5346bfb 100644 --- a/extra/mariabackup/backup_copy.cc +++ b/extra/mariabackup/backup_copy.cc @@ -1444,7 +1444,7 @@ out: void backup_fix_ddl(void); -static lsn_t get_current_lsn(MYSQL *connection) +lsn_t get_current_lsn(MYSQL *connection) { static const char lsn_prefix[] = "\nLog sequence number "; lsn_t lsn = 0; diff --git a/extra/mariabackup/backup_copy.h b/extra/mariabackup/backup_copy.h index fbc09eaded3..7c886719f37 100644 --- a/extra/mariabackup/backup_copy.h +++ b/extra/mariabackup/backup_copy.h @@ -3,6 +3,7 @@ #define XTRABACKUP_BACKUP_COPY_H #include <my_global.h> +#include <mysql.h> #include "datasink.h" /* special files */ @@ -48,4 +49,7 @@ is_path_separator(char); bool directory_exists(const char *dir, bool create); +lsn_t +get_current_lsn(MYSQL *connection); + #endif diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index 15c9d0d0d8d..0a45b7c4f9d 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -2570,6 +2570,8 @@ static my_bool xtrabackup_copy_datafile(fil_node_t *node, uint thread_n, return(FALSE); } + memset(&write_filt_ctxt, 0, sizeof(xb_write_filt_ctxt_t)); + bool was_dropped; pthread_mutex_lock(&backup_mutex); was_dropped = (ddl_tracker.drops.find(node->space->id) != ddl_tracker.drops.end()); @@ -2601,7 +2603,6 @@ static my_bool xtrabackup_copy_datafile(fil_node_t *node, uint thread_n, sizeof dst_name - 1); dst_name[sizeof dst_name - 1] = '\0'; - memset(&write_filt_ctxt, 0, sizeof(xb_write_filt_ctxt_t)); ut_a(write_filter.process != NULL); if (write_filter.init != NULL && @@ -2941,8 +2942,14 @@ static void dbug_mariabackup_event(const char *event,const char *key) } #define DBUG_MARIABACKUP_EVENT(A, B) DBUG_EXECUTE_IF("mariabackup_events", dbug_mariabackup_event(A,B);); +#define DBUG_MB_INJECT_CODE(EVENT, KEY, CODE) \ + DBUG_EXECUTE_IF("mariabackup_inject_code", {\ + char *env = getenv(EVENT); \ + if (env && !strcmp(env, KEY)) { CODE } \ + }) #else #define DBUG_MARIABACKUP_EVENT(A,B) +#define DBUG_MB_INJECT_CODE(EVENT, KEY, CODE) #endif /************************************************************************** @@ -2967,6 +2974,8 @@ DECLARE_THREAD(data_copy_thread_func)( while ((node = datafiles_iter_next(ctxt->it)) != NULL) { DBUG_MARIABACKUP_EVENT("before_copy", node->space->name); + DBUG_MB_INJECT_CODE("wait_innodb_redo_before_copy", node->space->name, + backup_wait_for_lsn(get_current_lsn(mysql_connection));); /* copy the datafile */ if (xtrabackup_copy_datafile(node, num, NULL, xtrabackup_incremental ? wf_incremental : wf_write_through)) diff --git a/include/my_sys.h b/include/my_sys.h index 505f3a056a5..d8101057f7c 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -538,8 +538,11 @@ static inline int my_b_write(IO_CACHE *info, const uchar *Buffer, size_t Count) MEM_CHECK_DEFINED(Buffer, Count); if (info->write_pos + Count <= info->write_end) { - memcpy(info->write_pos, Buffer, Count); - info->write_pos+= Count; + if (Count) + { + memcpy(info->write_pos, Buffer, Count); + info->write_pos+= Count; + } return 0; } return _my_b_write(info, Buffer, Count); diff --git a/libmariadb b/libmariadb -Subproject 62427520a5ba20e42fe51f5045062a7a9cadb46 +Subproject e38244220646a7e95c9be22576460aa7a4eb715 diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 09e46be19a1..9fd6eb7805a 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -333,7 +333,7 @@ static my_bool emb_read_query_result(MYSQL *mysql) static int emb_stmt_execute(MYSQL_STMT *stmt) { DBUG_ENTER("emb_stmt_execute"); - uchar header[5]; + uchar header[9]; THD *thd; my_bool res; @@ -345,6 +345,7 @@ static int emb_stmt_execute(MYSQL_STMT *stmt) int4store(header, stmt->stmt_id); header[4]= (uchar) stmt->flags; + header[5]= header[6]= header[7]= header[8]= 0; // safety thd= (THD*)stmt->mysql->thd; thd->client_param_count= stmt->param_count; thd->client_params= stmt->params; diff --git a/man/mysqldump.1 b/man/mysqldump.1 index e1a8141e69b..705a3cdd7ad 100644 --- a/man/mysqldump.1 +++ b/man/mysqldump.1 @@ -1,6 +1,6 @@ '\" t .\" -.TH "\FBMYSQLDUMP\FR" "1" "28 March 2019" "MariaDB 10\&.4" "MariaDB Database System" +.TH "\FBMYSQLDUMP\FR" "1" "24 October 2020" "MariaDB 10\&.4" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -36,7 +36,7 @@ tables, consider using the instead because it can accomplish faster backups and faster restores\&. See \fBmysqlhotcopy\fR(1)\&. .PP -There are three general ways to invoke +There are four general ways to invoke \fBmysqldump\fR: .sp .if n \{\ @@ -46,6 +46,7 @@ There are three general ways to invoke shell> \fBmysqldump [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIdb_name\fR\fR\fB [\fR\fB\fItbl_name\fR\fR\fB \&.\&.\&.]\fR shell> \fBmysqldump [\fR\fB\fIoptions\fR\fR\fB] \-\-databases \fR\fB\fIdb_name\fR\fR\fB \&.\&.\&.\fR shell> \fBmysqldump [\fR\fB\fIoptions\fR\fR\fB] \-\-all\-databases\fR +shell> \fBmysqldump [\fR\fB\fIoptions\fR\fR\fB] \-\-system={options}\fR .fi .if n \{\ .RE @@ -2192,6 +2193,110 @@ Verify server's "Common Name" in its cert against hostname used when connecting. .sp -1 .IP \(bu 2.3 .\} +.\" mysqladmin: Dump system tables option +.\" Dump system tables option: mysqladmin +\fB\-\-system=\fR\fB\fI{all, users, plugins, udfs, servers, stats, timezones}\fR\fR +.sp +Dump the system tables in the mysql database in a logical form\&. This option is an empty set by default\&. +.sp +One or more options can be listed in comma separated list\&. +.sp +The options here are: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +all \- an alias to enabling all of the below options\&. +.RE +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +users \- the users, roles and their grants outputed as \fBCREATE USER\fB, \fBCREATE ROLE\fR, \fBGRANT\fR, and \fBSET DEFAULT ROLE\fR (\fBALTER USER\fR for MySQL-8.0+)\&. +.RE +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +plugins \- active plugins of the server outputed as \fBINSTALL PLUGIN\fR\&. +.RE +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +udfs \- user define functions outputed as \fBCREATE FUNCTION\fR\&. +.RE +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +servers \- remote (federated) servers as \fBCREATE SERVER\fR\&. +.RE +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +stats \- statistics tables, InnoDB and Engine Independent Table Statistics (EITS), are dumped as \fBINSERT\fR/\fBREPLACE INFO\fR statements without (re)creating tables\&. +.RE +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +timezones \- timezone related system tables dumped as \fBINSERT\fR/\fBREPLACE INTO\fR statements without (re)creating tables\&. +.RE +.sp +The format of the output is affected by \fB\-\-replace\fR and \fB\-\-insert\-into\fR\&. The \fB\-\-replace\fR option will output \fBCREATE OR REPLACE\fR +forms of SQL, and also \fBDROP IF EXISTS\fR prior to \fBCREATE\fR, if a \fBCREATE OR REPLACE\fR option isn't available. +.sp +With \fB\-\-system=user\fR (or \fBall\fR), and \fB\-\-replace\fR, SQL is generated to generate an error if attempting to import the dump with a connection user that is being replaced within the dump\&. +.sp +The \fB\-\-insert\-into\fR option will cause \fBCREATE IF NOT EXIST\fR forms of SQL to generated if available. +.sp +For stats, and timezones, \fB\-\-replace\fR and \fB\-\-insert\-info\fR have the usual effects. +.sp +Enabling specific options here will cause the relevant tables in the mysql database to be ignored when dumping the mysql database or \fB\-\-all\-databases\fR\&. +.sp +Experimentally this option is designed to be able to dump system information from MySQL-5\&.7 and 8\&.0 servers\&. SQL generated is also +experimentally compatible with MySQL-5\&.7/8\&.0\&. Mappings of implemenation specific grants/plugins isn't always one-to-one however\&. +.sp +.RE +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqldump: tab option .\" tab option: mysqldump \fB\-\-tab=\fR\fB\fIpath\fR\fR, @@ -2673,7 +2778,7 @@ If you encounter problems backing up views, please read the section that covers .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2020 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -2681,12 +2786,6 @@ This documentation is distributed in the hope that it will be useful, but WITHOU .PP You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA or see http://www.gnu.org/licenses/. .sp -.SH "NOTES" -.IP " 1." 4 -Bug#30123 -.RS 4 -\%http://bugs.mysql.com/bug.php?id=30123 -.RE .SH "SEE ALSO" For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ .SH AUTHOR diff --git a/mysql-test/include/have_static_innodb.inc b/mysql-test/include/have_static_innodb.inc new file mode 100644 index 00000000000..0d7bb856f4f --- /dev/null +++ b/mysql-test/include/have_static_innodb.inc @@ -0,0 +1,7 @@ +source include/have_innodb.inc; + +if (!`select count(*) from information_schema.plugins + where plugin_name = 'innodb' and plugin_status = 'active' and + plugin_library is null`) { + skip Need compiled-in InnoDB; +} diff --git a/mysql-test/include/not_true.require b/mysql-test/include/not_true.require deleted file mode 100644 index 0032832f3d1..00000000000 --- a/mysql-test/include/not_true.require +++ /dev/null @@ -1,2 +0,0 @@ -TRUE -NULL diff --git a/mysql-test/main/blackhole.result b/mysql-test/main/blackhole.result index 36f5459ff85..a7281c42ca7 100644 --- a/mysql-test/main/blackhole.result +++ b/mysql-test/main/blackhole.result @@ -24,3 +24,9 @@ SELECT 0 FROM t1 FORCE INDEX FOR GROUP BY(a) WHERE a = 0 OR b = 0 AND c = 0; 0 DROP TABLE t1; End of 5.6 tests +CREATE TABLE `t` ( +`a` varchar(3000) NOT NULL default '', +PRIMARY KEY (`a`) +) ENGINE=BLACKHOLE; +DROP TABLE `t`; +End of 10.1 tests diff --git a/mysql-test/main/blackhole.test b/mysql-test/main/blackhole.test index 7f394e0f846..c80ceffef4c 100644 --- a/mysql-test/main/blackhole.test +++ b/mysql-test/main/blackhole.test @@ -38,3 +38,19 @@ SELECT 0 FROM t1 FORCE INDEX FOR GROUP BY(a) WHERE a = 0 OR b = 0 AND c = 0; DROP TABLE t1; --echo End of 5.6 tests + +# +# MDEV-24017 / bug 53588 test case. +# +# Create long enough index (between 1000 and 3500). 1000 is the old value, +# 3500 is innodb value (see ha_innobase::max_supported_key_length()). Without +# the fix the test will fail with "Specified key was too long" error. +# +CREATE TABLE `t` ( + `a` varchar(3000) NOT NULL default '', + PRIMARY KEY (`a`) +) ENGINE=BLACKHOLE; + +DROP TABLE `t`; + +--echo End of 10.1 tests diff --git a/mysql-test/main/bootstrap_innodb.result b/mysql-test/main/bootstrap_innodb.result new file mode 100644 index 00000000000..2807a9776a5 --- /dev/null +++ b/mysql-test/main/bootstrap_innodb.result @@ -0,0 +1,8 @@ +create table t1(a int) engine=innodb; +# restart +select * from t1; +a +1 +2 +5 +drop table t1; diff --git a/mysql-test/main/bootstrap_innodb.test b/mysql-test/main/bootstrap_innodb.test new file mode 100644 index 00000000000..ddaefb32155 --- /dev/null +++ b/mysql-test/main/bootstrap_innodb.test @@ -0,0 +1,27 @@ +source include/have_static_innodb.inc; +source include/not_embedded.inc; + +let $datadir= `select @@datadir`; + +create table t1(a int) engine=innodb; +source include/shutdown_mysqld.inc; + +write_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql; +use test; +insert t1 values (1); +start transaction; +insert t1 values (2); +savepoint s1; +insert t1 values (3); +savepoint s2; +insert t1 values (4); +rollback to savepoint s1; +insert t1 values (5); +commit; +EOF +exec $MYSQLD_BOOTSTRAP_CMD --datadir=$datadir --innodb < $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1; +remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql; + +source include/start_mysqld.inc; +select * from t1; +drop table t1; diff --git a/mysql-test/main/func_group.result b/mysql-test/main/func_group.result index 57f5744373e..9311a556191 100644 --- a/mysql-test/main/func_group.result +++ b/mysql-test/main/func_group.result @@ -1186,13 +1186,13 @@ i count(*) std(e1/e2) 3 4 0.00000000 select std(s1/s2) from bug22555; std(s1/s2) -0.21328517 +0.21325764 select std(o1/o2) from bug22555; std(o1/o2) 0.2132576358664934 select std(e1/e2) from bug22555; std(e1/e2) -0.21328517 +0.21325764 set @saved_div_precision_increment=@@div_precision_increment; set div_precision_increment=19; select i, count(*), std(s1/s2) from bug22555 group by i order by i; diff --git a/mysql-test/main/kill.result b/mysql-test/main/kill.result index 55839817fd4..1ea06aee096 100644 --- a/mysql-test/main/kill.result +++ b/mysql-test/main/kill.result @@ -375,8 +375,7 @@ SELECT SLEEP(1000); connection con1; KILL QUERY ID @id; connection default; -SLEEP(1000) -1 +ERROR 70100: Query execution was interrupted KILL QUERY ID 0; ERROR HY000: Unknown query id: 0 # @@ -392,8 +391,7 @@ ERROR HY000: You are not owner of query ID connection con1; KILL QUERY ID @id; connection default; -SLEEP(1000) -1 +ERROR 70100: Query execution was interrupted disconnect con5; DROP USER u1@localhost; SET DEBUG_SYNC = 'RESET'; diff --git a/mysql-test/main/kill.test b/mysql-test/main/kill.test index 45d672aebc1..c5bbd349574 100644 --- a/mysql-test/main/kill.test +++ b/mysql-test/main/kill.test @@ -607,6 +607,7 @@ let $wait_condition= SELECT @id:=QUERY_ID FROM INFORMATION_SCHEMA.PROCESSLIST WH source include/wait_condition.inc; KILL QUERY ID @id; connection default; +--error ER_QUERY_INTERRUPTED reap; --error ER_NO_SUCH_QUERY @@ -633,6 +634,7 @@ connection con1; KILL QUERY ID @id; connection default; +--error ER_QUERY_INTERRUPTED reap; disconnect con5; DROP USER u1@localhost; diff --git a/mysql-test/main/lock_view.result b/mysql-test/main/lock_view.result new file mode 100644 index 00000000000..4d375bace42 --- /dev/null +++ b/mysql-test/main/lock_view.result @@ -0,0 +1,231 @@ +create database mysqltest1; +create database mysqltest2; +create database mysqltest3; +create user invoker@localhost; +create user definer@localhost; +grant select,show view on mysqltest1.* to invoker@localhost; +grant select,show view on mysqltest1.* to definer@localhost; +grant select,show view on mysqltest2.* to invoker@localhost; +grant select,show view on mysqltest2.* to definer@localhost; +grant select,show view on mysqltest3.* to invoker@localhost; +grant select on performance_schema.* to definer@localhost; +create table mysqltest1.t1 (a int); +create definer=definer@localhost view mysqltest2.v2 as select * from mysqltest1.t1; +create definer=definer@localhost view mysqltest3.v3 as select * from mysqltest2.v2; +create definer=definer@localhost view mysqltest3.v3is as select schema_name from information_schema.schemata order by schema_name; +create definer=definer@localhost view mysqltest3.v3ps as select user from performance_schema.users where current_connections>0 order by user; +create definer=definer@localhost view mysqltest3.v3nt as select 1; +create definer=definer@localhost sql security invoker view mysqltest3.v3i as select * from mysqltest1.t1; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `mysqltest1`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `mysqltest2`; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v2` ( + `a` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `mysqltest3`; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v3` ( + `a` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v3i` ( + `a` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v3is` ( + `schema_name` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v3nt` ( + `1` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v3ps` ( + `user` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; + +USE `mysqltest1`; + +USE `mysqltest2`; +/*!50001 DROP TABLE IF EXISTS `v2`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`definer`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v2` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; + +USE `mysqltest3`; +/*!50001 DROP TABLE IF EXISTS `v3`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`definer`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v3` AS select `v2`.`a` AS `a` from `mysqltest2`.`v2` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v3i`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`definer`@`localhost` SQL SECURITY INVOKER */ +/*!50001 VIEW `v3i` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v3is`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`definer`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v3is` AS select `information_schema`.`schemata`.`SCHEMA_NAME` AS `schema_name` from `information_schema`.`schemata` order by `information_schema`.`schemata`.`SCHEMA_NAME` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v3nt`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`definer`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v3nt` AS select 1 AS `1` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v3ps`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`definer`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v3ps` AS select `performance_schema`.`users`.`USER` AS `user` from `performance_schema`.`users` where `performance_schema`.`users`.`CURRENT_CONNECTIONS` > 0 order by `performance_schema`.`users`.`USER` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +connect inv,localhost,invoker; +lock table mysqltest3.v3 write; +ERROR 42000: Access denied for user 'invoker'@'localhost' to database 'mysqltest3' +disconnect inv; +connection default; +grant lock tables on mysqltest3.* to invoker@localhost; +connect inv,localhost,invoker; +show create view mysqltest3.v3; +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`definer`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest3`.`v3` AS select `v2`.`a` AS `a` from `mysqltest2`.`v2` latin1 latin1_swedish_ci +show create view mysqltest3.v3is; +View Create View character_set_client collation_connection +v3is CREATE ALGORITHM=UNDEFINED DEFINER=`definer`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest3`.`v3is` AS select `information_schema`.`schemata`.`SCHEMA_NAME` AS `schema_name` from `information_schema`.`schemata` order by `information_schema`.`schemata`.`SCHEMA_NAME` latin1 latin1_swedish_ci +show create view mysqltest3.v3ps; +View Create View character_set_client collation_connection +v3ps CREATE ALGORITHM=UNDEFINED DEFINER=`definer`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest3`.`v3ps` AS select `performance_schema`.`users`.`USER` AS `user` from `performance_schema`.`users` where `performance_schema`.`users`.`CURRENT_CONNECTIONS` > 0 order by `performance_schema`.`users`.`USER` latin1 latin1_swedish_ci +show create view mysqltest3.v3nt; +View Create View character_set_client collation_connection +v3nt CREATE ALGORITHM=UNDEFINED DEFINER=`definer`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest3`.`v3nt` AS select 1 AS `1` latin1 latin1_swedish_ci +show create view mysqltest3.v3i; +View Create View character_set_client collation_connection +v3i CREATE ALGORITHM=UNDEFINED DEFINER=`definer`@`localhost` SQL SECURITY INVOKER VIEW `mysqltest3`.`v3i` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1` latin1 latin1_swedish_ci +lock table mysqltest3.v3 write; +ERROR HY000: View 'mysqltest3.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +lock table mysqltest3.v3i write; +ERROR HY000: View 'mysqltest3.v3i' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +lock table mysqltest3.v3is write; +select * from mysqltest3.v3is; +schema_name +information_schema +mysqltest1 +mysqltest2 +performance_schema +test +lock table mysqltest3.v3ps write; +select * from mysqltest3.v3ps; +user +NULL +invoker +root +lock table mysqltest3.v3nt write; +select * from mysqltest3.v3nt; +1 +1 +disconnect inv; +connection default; +grant lock tables on mysqltest2.* to invoker@localhost; +connect inv,localhost,invoker; +lock table mysqltest3.v3 write; +ERROR HY000: View 'mysqltest3.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +lock table mysqltest3.v3i write; +ERROR HY000: View 'mysqltest3.v3i' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +disconnect inv; +connection default; +grant lock tables on mysqltest1.* to definer@localhost; +connect inv,localhost,invoker; +lock table mysqltest3.v3 write; +select * from mysqltest3.v3; +a +lock table mysqltest3.v3i write; +ERROR HY000: View 'mysqltest3.v3i' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +disconnect inv; +connection default; +grant lock tables on mysqltest1.* to invoker@localhost; +connect inv,localhost,invoker; +lock table mysqltest3.v3i write; +select * from mysqltest3.v3i; +a +disconnect inv; +connection default; +drop user invoker@localhost; +drop user definer@localhost; +drop database mysqltest1; +drop database mysqltest2; +drop database mysqltest3; diff --git a/mysql-test/main/lock_view.test b/mysql-test/main/lock_view.test new file mode 100644 index 00000000000..dd8809ab89d --- /dev/null +++ b/mysql-test/main/lock_view.test @@ -0,0 +1,76 @@ +source include/not_embedded.inc; +# +# LOCK TABLES and privileges on views +# +create database mysqltest1; +create database mysqltest2; +create database mysqltest3; +create user invoker@localhost; +create user definer@localhost; +grant select,show view on mysqltest1.* to invoker@localhost; +grant select,show view on mysqltest1.* to definer@localhost; +grant select,show view on mysqltest2.* to invoker@localhost; +grant select,show view on mysqltest2.* to definer@localhost; +grant select,show view on mysqltest3.* to invoker@localhost; +grant select on performance_schema.* to definer@localhost; +create table mysqltest1.t1 (a int); +create definer=definer@localhost view mysqltest2.v2 as select * from mysqltest1.t1; +create definer=definer@localhost view mysqltest3.v3 as select * from mysqltest2.v2; +create definer=definer@localhost view mysqltest3.v3is as select schema_name from information_schema.schemata order by schema_name; +create definer=definer@localhost view mysqltest3.v3ps as select user from performance_schema.users where current_connections>0 order by user; +create definer=definer@localhost view mysqltest3.v3nt as select 1; +create definer=definer@localhost sql security invoker view mysqltest3.v3i as select * from mysqltest1.t1; + +exec $MYSQL_DUMP --compact -B mysqltest1 mysqltest2 mysqltest3; + +connect inv,localhost,invoker; +error ER_DBACCESS_DENIED_ERROR; +lock table mysqltest3.v3 write; +disconnect inv; +connection default; + +grant lock tables on mysqltest3.* to invoker@localhost; +connect inv,localhost,invoker; +show create view mysqltest3.v3; +show create view mysqltest3.v3is; +show create view mysqltest3.v3ps; +show create view mysqltest3.v3nt; +show create view mysqltest3.v3i; +error ER_VIEW_INVALID; +lock table mysqltest3.v3 write; +error ER_VIEW_INVALID; +lock table mysqltest3.v3i write; +lock table mysqltest3.v3is write; select * from mysqltest3.v3is; +lock table mysqltest3.v3ps write; select * from mysqltest3.v3ps; +lock table mysqltest3.v3nt write; select * from mysqltest3.v3nt; +disconnect inv; +connection default; + +grant lock tables on mysqltest2.* to invoker@localhost; +connect inv,localhost,invoker; +error ER_VIEW_INVALID; +lock table mysqltest3.v3 write; +error ER_VIEW_INVALID; +lock table mysqltest3.v3i write; +disconnect inv; +connection default; + +grant lock tables on mysqltest1.* to definer@localhost; +connect inv,localhost,invoker; +lock table mysqltest3.v3 write; select * from mysqltest3.v3; +error ER_VIEW_INVALID; +lock table mysqltest3.v3i write; +disconnect inv; +connection default; + +grant lock tables on mysqltest1.* to invoker@localhost; +connect inv,localhost,invoker; +lock table mysqltest3.v3i write; select * from mysqltest3.v3i; +disconnect inv; +connection default; + +drop user invoker@localhost; +drop user definer@localhost; +drop database mysqltest1; +drop database mysqltest2; +drop database mysqltest3; diff --git a/mysql-test/main/mysqldump-system,win.rdiff b/mysql-test/main/mysqldump-system,win.rdiff new file mode 100644 index 00000000000..a46b422e95f --- /dev/null +++ b/mysql-test/main/mysqldump-system,win.rdiff @@ -0,0 +1,21 @@ +--- mysqldump-system.result ++++ mysqldump-system,win.result +@@ -442,7 +442,7 @@ + mysql.time_zone_transition 3895294076 + mysql.plugin 0 + mysql.servers 2783974349 +-mysql.func 3241572444 ++mysql.func 310494789 + mysql.innodb_table_stats 347867921 + mysql.table_stats 664320059 + # Opps.... +@@ -477,7 +477,7 @@ + mysql.time_zone_transition 3895294076 + mysql.plugin 0 + mysql.servers 2783974349 +-mysql.func 3241572444 ++mysql.func 310494789 + mysql.innodb_table_stats 347867921 + mysql.table_stats 664320059 + DROP FUNCTION IF EXISTS metaphon; + diff --git a/mysql-test/main/mysqldump-system.result b/mysql-test/main/mysqldump-system.result new file mode 100644 index 00000000000..d887df81d2b --- /dev/null +++ b/mysql-test/main/mysqldump-system.result @@ -0,0 +1,497 @@ +# +# MDEV-23630: mysqldump to logically dump system tables +# +# +create table backup_users like mysql.global_priv; +create table tables_priv like mysql.tables_priv; +insert into backup_users select * from mysql.global_priv; +insert into tables_priv select * from mysql.tables_priv; +delete from mysql.global_priv where host not in ('localhost'); +flush privileges; +alter user 'mariadb.sys'@'localhost' ACCOUNT UNLOCK; +create user USER; +CREATE ROLE role_1; +CREATE ROLE role_2 WITH ADMIN role_1; +GRANT SHOW DATABASES ON *.* TO role_1; +GRANT role_1 TO USER; +GRANT role_2 TO USER; +SET DEFAULT ROLE role_2 FOR USER; +ALTER TABLE mysql.roles_mapping ORDER BY Host, User, Role; +set @save_innodb_stats_persistent= @@innodb_stats_persistent; +create table mysql.tz like mysql.time_zone_transition; +alter table mysql.tz engine=innodb; +insert into mysql.tz select * from mysql.time_zone_transition; +set global innodb_stats_persistent=1; +ANALYZE TABLE mysql.tz PERSISTENT FOR ALL; +Table Op Msg_type Msg_text +mysql.tz analyze status Engine-independent statistics collected +mysql.tz analyze status OK +delete from mysql.index_stats where prefix_arity!=1; +delete from mysql.column_stats where column_name!='Time_zone_id'; +set time_zone="+03:00"; +update mysql.innodb_index_stats set last_update="2020-01-01" where database_name="mysql" and table_name="tz"; +update mysql.innodb_table_stats set last_update="2020-01-01" where database_name="mysql" and table_name="tz"; +set global innodb_stats_persistent= @save_innodb_stats_persistent; +alter table mysql.time_zone_name ORDER BY Name; +CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS(Host 'localhost'); +CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB"; +# +# mysqldump of system tables with --system=all +# + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +CREATE USER `mariadb.sys`@`localhost` PASSWORD EXPIRE; +CREATE USER `root`@`localhost`; +CREATE USER `USER`@`%`; +SELECT COALESCE(CURRENT_ROLE(),'NONE') into @current_role; +CREATE ROLE IF NOT EXISTS mariadb_dump_import_role; +GRANT mariadb_dump_import_role TO CURRENT_USER(); +SET ROLE mariadb_dump_import_role; +/*!80001 CREATE ROLE 'role_1' */; +/*M!100005 CREATE ROLE 'role_1' WITH ADMIN mariadb_dump_import_role */; +/*M!100005 GRANT 'role_1' TO 'root'@'localhost' WITH ADMIN OPTION */; +/*!80001 CREATE ROLE 'role_2' */; +/*M!100005 CREATE ROLE 'role_2' WITH ADMIN mariadb_dump_import_role */; +/*M!100005 GRANT 'role_2' TO 'role_1' WITH ADMIN OPTION */; +GRANT USAGE ON *.* TO `mariadb.sys`@`localhost`; +GRANT SELECT, DELETE ON `mysql`.`global_priv` TO `mariadb.sys`@`localhost`; +/*M!100005 SET DEFAULT ROLE NONE FOR 'mariadb.sys'@'localhost' */; +/*!80001 ALTER USER 'mariadb.sys'@'localhost' DEFAULT ROLE NONE */; +GRANT `role_1` TO `root`@`localhost` WITH ADMIN OPTION; +GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION; +GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION; +/*M!100005 SET DEFAULT ROLE NONE FOR 'root'@'localhost' */; +/*!80001 ALTER USER 'root'@'localhost' DEFAULT ROLE NONE */; +GRANT `role_1` TO `USER`@`%`; +GRANT `role_2` TO `USER`@`%`; +GRANT USAGE ON *.* TO `USER`@`%`; +/*M!100005 SET DEFAULT ROLE 'role_2' FOR 'USER'@'%' */; +/*!80001 ALTER USER 'USER'@'%' DEFAULT ROLE 'role_2' */; +GRANT `role_2` TO `role_1` WITH ADMIN OPTION; +GRANT SHOW DATABASES ON *.* TO `role_1`; +GRANT USAGE ON *.* TO `role_2`; +GRANT USAGE ON *.* TO `role_2`; +SET ROLE NONE; +DROP ROLE mariadb_dump_import_role; +/*M!100203 EXECUTE IMMEDIATE CONCAT('SET ROLE ', @current_role) */; +CREATE FUNCTION metaphon RETURNS STRING SONAME 'UDF_EXAMPLE_LIB'; +CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS (Host 'localhost', Port 3306); + +USE mysql; + +LOCK TABLES `column_stats` WRITE; +/*!40000 ALTER TABLE `column_stats` DISABLE KEYS */; +INSERT INTO `column_stats` VALUES ('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,254,'DOUBLE_PREC_HB','\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿'); +/*!40000 ALTER TABLE `column_stats` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `index_stats` WRITE; +/*!40000 ALTER TABLE `index_stats` DISABLE KEYS */; +INSERT INTO `index_stats` VALUES ('mysql','tz','PRIMARY',1,98.2500); +/*!40000 ALTER TABLE `index_stats` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `table_stats` WRITE; +/*!40000 ALTER TABLE `table_stats` DISABLE KEYS */; +INSERT INTO `table_stats` VALUES ('mysql','tz',393); +/*!40000 ALTER TABLE `table_stats` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `innodb_index_stats` WRITE; +/*!40000 ALTER TABLE `innodb_index_stats` DISABLE KEYS */; +INSERT INTO `innodb_index_stats` VALUES ('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index'); +/*!40000 ALTER TABLE `innodb_index_stats` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `innodb_table_stats` WRITE; +/*!40000 ALTER TABLE `innodb_table_stats` DISABLE KEYS */; +INSERT INTO `innodb_table_stats` VALUES ('mysql','tz','2019-12-31 21:00:00',393,1,0); +/*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */; +UNLOCK TABLES; + +USE mysql; + +LOCK TABLES `time_zone` WRITE; +/*!40000 ALTER TABLE `time_zone` DISABLE KEYS */; +INSERT INTO `time_zone` VALUES (1,'N'),(2,'N'),(3,'N'),(4,'Y'),(5,'N'); +/*!40000 ALTER TABLE `time_zone` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `time_zone_name` WRITE; +/*!40000 ALTER TABLE `time_zone_name` DISABLE KEYS */; +INSERT INTO `time_zone_name` VALUES ('Europe/Moscow',3),('Japan',5),('leap/Europe/Moscow',4),('MET',1),('Universal',2),('UTC',2); +/*!40000 ALTER TABLE `time_zone_name` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `time_zone_leap_second` WRITE; +/*!40000 ALTER TABLE `time_zone_leap_second` DISABLE KEYS */; +INSERT INTO `time_zone_leap_second` VALUES (78796800,1),(94694401,2),(126230402,3),(157766403,4),(189302404,5),(220924805,6),(252460806,7),(283996807,8),(315532808,9),(362793609,10),(394329610,11),(425865611,12),(489024012,13),(567993613,14),(631152014,15),(662688015,16),(709948816,17),(741484817,18),(773020818,19),(820454419,20),(867715220,21),(915148821,22); +/*!40000 ALTER TABLE `time_zone_leap_second` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `time_zone_transition` WRITE; +/*!40000 ALTER TABLE `time_zone_transition` DISABLE KEYS */; +INSERT INTO `time_zone_transition` VALUES (1,-1693706400,0),(1,-1680483600,1),(1,-1663455600,2),(1,-1650150000,3),(1,-1632006000,2),(1,-1618700400,3),(1,-938905200,2),(1,-857257200,3),(1,-844556400,2),(1,-828226800,3),(1,-812502000,2),(1,-796777200,3),(1,228877200,2),(1,243997200,3),(1,260326800,2),(1,276051600,3),(1,291776400,2),(1,307501200,3),(1,323830800,2),(1,338950800,3),(1,354675600,2),(1,370400400,3),(1,386125200,2),(1,401850000,3),(1,417574800,2),(1,433299600,3),(1,449024400,2),(1,465354000,3),(1,481078800,2),(1,496803600,3),(1,512528400,2),(1,528253200,3),(1,543978000,2),(1,559702800,3),(1,575427600,2),(1,591152400,3),(1,606877200,2),(1,622602000,3),(1,638326800,2),(1,654656400,3),(1,670381200,2),(1,686106000,3),(1,701830800,2),(1,717555600,3),(1,733280400,2),(1,749005200,3),(1,764730000,2),(1,780454800,3),(1,796179600,2),(1,811904400,3),(1,828234000,2),(1,846378000,3),(1,859683600,2),(1,877827600,3),(1,891133200,2),(1,909277200,3),(1,922582800,2),(1,941331600,3),(1,954032400,2),(1,972781200,3),(1,985482000,2),(1,1004230800,3),(1,1017536400,2),(1,1035680400,3),(1,1048986000,2),(1,1067130000,3),(1,1080435600,2),(1,1099184400,3),(1,1111885200,2),(1,1130634000,3),(1,1143334800,2),(1,1162083600,3),(1,1174784400,2),(1,1193533200,3),(1,1206838800,2),(1,1224982800,3),(1,1238288400,2),(1,1256432400,3),(1,1269738000,2),(1,1288486800,3),(1,1301187600,2),(1,1319936400,3),(1,1332637200,2),(1,1351386000,3),(1,1364691600,2),(1,1382835600,3),(1,1396141200,2),(1,1414285200,3),(1,1427590800,2),(1,1445734800,3),(1,1459040400,2),(1,1477789200,3),(1,1490490000,2),(1,1509238800,3),(1,1521939600,2),(1,1540688400,3),(1,1553994000,2),(1,1572138000,3),(1,1585443600,2),(1,1603587600,3),(1,1616893200,2),(1,1635642000,3),(1,1648342800,2),(1,1667091600,3),(1,1679792400,2),(1,1698541200,3),(1,1711846800,2),(1,1729990800,3),(1,1743296400,2),(1,1761440400,3),(1,1774746000,2),(1,1792890000,3),(1,1806195600,2),(1,1824944400,3),(1,1837645200,2),(1,1856394000,3),(1,1869094800,2),(1,1887843600,3),(1,1901149200,2),(1,1919293200,3),(1,1932598800,2),(1,1950742800,3),(1,1964048400,2),(1,1982797200,3),(1,1995498000,2),(1,2014246800,3),(1,2026947600,2),(1,2045696400,3),(1,2058397200,2),(1,2077146000,3),(1,2090451600,2),(1,2108595600,3),(1,2121901200,2),(1,2140045200,3),(3,-1688265000,2),(3,-1656819048,1),(3,-1641353448,2),(3,-1627965048,3),(3,-1618716648,1),(3,-1596429048,3),(3,-1593829848,5),(3,-1589860800,4),(3,-1542427200,5),(3,-1539493200,6),(3,-1525323600,5),(3,-1522728000,4),(3,-1491188400,7),(3,-1247536800,4),(3,354920400,5),(3,370728000,4),(3,386456400,5),(3,402264000,4),(3,417992400,5),(3,433800000,4),(3,449614800,5),(3,465346800,8),(3,481071600,9),(3,496796400,8),(3,512521200,9),(3,528246000,8),(3,543970800,9),(3,559695600,8),(3,575420400,9),(3,591145200,8),(3,606870000,9),(3,622594800,8),(3,638319600,9),(3,654649200,8),(3,670374000,10),(3,686102400,11),(3,695779200,8),(3,701812800,5),(3,717534000,4),(3,733273200,9),(3,748998000,8),(3,764722800,9),(3,780447600,8),(3,796172400,9),(3,811897200,8),(3,828226800,9),(3,846370800,8),(3,859676400,9),(3,877820400,8),(3,891126000,9),(3,909270000,8),(3,922575600,9),(3,941324400,8),(3,954025200,9),(3,972774000,8),(3,985474800,9),(3,1004223600,8),(3,1017529200,9),(3,1035673200,8),(3,1048978800,9),(3,1067122800,8),(3,1080428400,9),(3,1099177200,8),(3,1111878000,9),(3,1130626800,8),(3,1143327600,9),(3,1162076400,8),(3,1174777200,9),(3,1193526000,8),(3,1206831600,9),(3,1224975600,8),(3,1238281200,9),(3,1256425200,8),(3,1269730800,9),(3,1288479600,8),(3,1301180400,9),(3,1319929200,8),(3,1332630000,9),(3,1351378800,8),(3,1364684400,9),(3,1382828400,8),(3,1396134000,9),(3,1414278000,8),(3,1427583600,9),(3,1445727600,8),(3,1459033200,9),(3,1477782000,8),(3,1490482800,9),(3,1509231600,8),(3,1521932400,9),(3,1540681200,8),(3,1553986800,9),(3,1572130800,8),(3,1585436400,9),(3,1603580400,8),(3,1616886000,9),(3,1635634800,8),(3,1648335600,9),(3,1667084400,8),(3,1679785200,9),(3,1698534000,8),(3,1711839600,9),(3,1729983600,8),(3,1743289200,9),(3,1761433200,8),(3,1774738800,9),(3,1792882800,8),(3,1806188400,9),(3,1824937200,8),(3,1837638000,9),(3,1856386800,8),(3,1869087600,9),(3,1887836400,8),(3,1901142000,9),(3,1919286000,8),(3,1932591600,9),(3,1950735600,8),(3,1964041200,9),(3,1982790000,8),(3,1995490800,9),(3,2014239600,8),(3,2026940400,9),(3,2045689200,8),(3,2058390000,9),(3,2077138800,8),(3,2090444400,9),(3,2108588400,8),(3,2121894000,9),(3,2140038000,8),(4,-1688265000,2),(4,-1656819048,1),(4,-1641353448,2),(4,-1627965048,3),(4,-1618716648,1),(4,-1596429048,3),(4,-1593829848,5),(4,-1589860800,4),(4,-1542427200,5),(4,-1539493200,6),(4,-1525323600,5),(4,-1522728000,4),(4,-1491188400,7),(4,-1247536800,4),(4,354920409,5),(4,370728010,4),(4,386456410,5),(4,402264011,4),(4,417992411,5),(4,433800012,4),(4,449614812,5),(4,465346812,8),(4,481071612,9),(4,496796413,8),(4,512521213,9),(4,528246013,8),(4,543970813,9),(4,559695613,8),(4,575420414,9),(4,591145214,8),(4,606870014,9),(4,622594814,8),(4,638319615,9),(4,654649215,8),(4,670374016,10),(4,686102416,11),(4,695779216,8),(4,701812816,5),(4,717534017,4),(4,733273217,9),(4,748998018,8),(4,764722818,9),(4,780447619,8),(4,796172419,9),(4,811897219,8),(4,828226820,9),(4,846370820,8),(4,859676420,9),(4,877820421,8),(4,891126021,9),(4,909270021,8),(4,922575622,9),(4,941324422,8),(4,954025222,9),(4,972774022,8),(4,985474822,9),(4,1004223622,8),(4,1017529222,9),(4,1035673222,8),(4,1048978822,9),(4,1067122822,8),(4,1080428422,9),(4,1099177222,8),(4,1111878022,9),(4,1130626822,8),(4,1143327622,9),(4,1162076422,8),(4,1174777222,9),(4,1193526022,8),(4,1206831622,9),(4,1224975622,8),(4,1238281222,9),(4,1256425222,8),(4,1269730822,9),(4,1288479622,8),(4,1301180422,9),(4,1319929222,8),(4,1332630022,9),(4,1351378822,8),(4,1364684422,9),(4,1382828422,8),(4,1396134022,9),(4,1414278022,8),(4,1427583622,9),(4,1445727622,8),(4,1459033222,9),(4,1477782022,8),(4,1490482822,9),(4,1509231622,8),(4,1521932422,9),(4,1540681222,8),(4,1553986822,9),(4,1572130822,8),(4,1585436422,9),(4,1603580422,8),(4,1616886022,9),(4,1635634822,8),(4,1648335622,9),(4,1667084422,8),(4,1679785222,9),(4,1698534022,8),(4,1711839622,9),(4,1729983622,8),(4,1743289222,9),(4,1761433222,8),(4,1774738822,9),(4,1792882822,8),(4,1806188422,9),(4,1824937222,8),(4,1837638022,9),(4,1856386822,8),(4,1869087622,9),(4,1887836422,8),(4,1901142022,9),(4,1919286022,8),(4,1932591622,9),(4,1950735622,8),(4,1964041222,9),(4,1982790022,8),(4,1995490822,9),(4,2014239622,8),(4,2026940422,9),(4,2045689222,8),(4,2058390022,9),(4,2077138822,8),(4,2090444422,9),(4,2108588422,8),(4,2121894022,9),(4,2140038022,8),(5,-1009875600,1); +/*!40000 ALTER TABLE `time_zone_transition` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `time_zone_transition_type` WRITE; +/*!40000 ALTER TABLE `time_zone_transition_type` DISABLE KEYS */; +INSERT INTO `time_zone_transition_type` VALUES (1,0,7200,1,'MEST'),(1,1,3600,0,'MET'),(1,2,7200,1,'MEST'),(1,3,3600,0,'MET'),(2,0,0,0,'UTC'),(3,0,9000,0,'MMT'),(3,1,12648,1,'MST'),(3,2,9048,0,'MMT'),(3,3,16248,1,'MDST'),(3,4,10800,0,'MSK'),(3,5,14400,1,'MSD'),(3,6,18000,1,'MSD'),(3,7,7200,0,'EET'),(3,8,10800,0,'MSK'),(3,9,14400,1,'MSD'),(3,10,10800,1,'EEST'),(3,11,7200,0,'EET'),(4,0,9000,0,'MMT'),(4,1,12648,1,'MST'),(4,2,9048,0,'MMT'),(4,3,16248,1,'MDST'),(4,4,10800,0,'MSK'),(4,5,14400,1,'MSD'),(4,6,18000,1,'MSD'),(4,7,7200,0,'EET'),(4,8,10800,0,'MSK'),(4,9,14400,1,'MSD'),(4,10,10800,1,'EEST'),(4,11,7200,0,'EET'),(5,0,32400,0,'CJT'),(5,1,32400,0,'JST'); +/*!40000 ALTER TABLE `time_zone_transition_type` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +# +# mysqldump of system tables with --system=all --replace +# + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DELIMITER | +/*M!100101 IF current_user()="'mariadb.sys'@'localhost'" THEN + SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001, MESSAGE_TEXT="Don't remove current user 'mariadb.sys'@'localhost''"; +END IF */| +DELIMITER ; +/*!50701 DROP USER IF EXISTS 'mariadb.sys'@'localhost' */; +CREATE /*M!100103 OR REPLACE */ USER `mariadb.sys`@`localhost` PASSWORD EXPIRE; +DELIMITER | +/*M!100101 IF current_user()="'root'@'localhost'" THEN + SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001, MESSAGE_TEXT="Don't remove current user 'root'@'localhost''"; +END IF */| +DELIMITER ; +/*!50701 DROP USER IF EXISTS 'root'@'localhost' */; +CREATE /*M!100103 OR REPLACE */ USER `root`@`localhost`; +DELIMITER | +/*M!100101 IF current_user()="'USER'@'%'" THEN + SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001, MESSAGE_TEXT="Don't remove current user 'USER'@'%''"; +END IF */| +DELIMITER ; +/*!50701 DROP USER IF EXISTS 'USER'@'%' */; +CREATE /*M!100103 OR REPLACE */ USER `USER`@`%`; +SELECT COALESCE(CURRENT_ROLE(),'NONE') into @current_role; +CREATE ROLE IF NOT EXISTS mariadb_dump_import_role; +GRANT mariadb_dump_import_role TO CURRENT_USER(); +SET ROLE mariadb_dump_import_role; +/*!80001 DROP ROLE IF EXISTS 'role_1' */; +/*!80001 CREATE ROLE 'role_1' */; +/*M!100103 CREATE OR REPLACE ROLE 'role_1' WITH ADMIN mariadb_dump_import_role */; +/*M!100005 GRANT 'role_1' TO 'root'@'localhost' WITH ADMIN OPTION */; +/*!80001 DROP ROLE IF EXISTS 'role_2' */; +/*!80001 CREATE ROLE 'role_2' */; +/*M!100103 CREATE OR REPLACE ROLE 'role_2' WITH ADMIN mariadb_dump_import_role */; +/*M!100005 GRANT 'role_2' TO 'role_1' WITH ADMIN OPTION */; +GRANT USAGE ON *.* TO `mariadb.sys`@`localhost`; +GRANT SELECT, DELETE ON `mysql`.`global_priv` TO `mariadb.sys`@`localhost`; +/*M!100005 SET DEFAULT ROLE NONE FOR 'mariadb.sys'@'localhost' */; +/*!80001 ALTER USER 'mariadb.sys'@'localhost' DEFAULT ROLE NONE */; +GRANT `role_1` TO `root`@`localhost` WITH ADMIN OPTION; +GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION; +GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION; +/*M!100005 SET DEFAULT ROLE NONE FOR 'root'@'localhost' */; +/*!80001 ALTER USER 'root'@'localhost' DEFAULT ROLE NONE */; +GRANT `role_1` TO `USER`@`%`; +GRANT `role_2` TO `USER`@`%`; +GRANT USAGE ON *.* TO `USER`@`%`; +/*M!100005 SET DEFAULT ROLE 'role_2' FOR 'USER'@'%' */; +/*!80001 ALTER USER 'USER'@'%' DEFAULT ROLE 'role_2' */; +GRANT `role_2` TO `role_1` WITH ADMIN OPTION; +GRANT SHOW DATABASES ON *.* TO `role_1`; +GRANT USAGE ON *.* TO `role_2`; +GRANT USAGE ON *.* TO `role_2`; +SET ROLE NONE; +DROP ROLE mariadb_dump_import_role; +/*M!100203 EXECUTE IMMEDIATE CONCAT('SET ROLE ', @current_role) */; +/*!50701 DROP FUNCTION IF EXISTS metaphon */; +CREATE /*M!100103 OR REPLACE */ FUNCTION metaphon RETURNS STRING SONAME 'UDF_EXAMPLE_LIB'; +CREATE /*M!100103 OR REPLACE */ SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS (Host 'localhost', Port 3306); + +USE mysql; + +LOCK TABLES `column_stats` WRITE; +/*!40000 ALTER TABLE `column_stats` DISABLE KEYS */; +REPLACE INTO `column_stats` VALUES ('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,254,'DOUBLE_PREC_HB','\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿'); +/*!40000 ALTER TABLE `column_stats` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `index_stats` WRITE; +/*!40000 ALTER TABLE `index_stats` DISABLE KEYS */; +REPLACE INTO `index_stats` VALUES ('mysql','tz','PRIMARY',1,98.2500); +/*!40000 ALTER TABLE `index_stats` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `table_stats` WRITE; +/*!40000 ALTER TABLE `table_stats` DISABLE KEYS */; +REPLACE INTO `table_stats` VALUES ('mysql','tz',393); +/*!40000 ALTER TABLE `table_stats` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `innodb_index_stats` WRITE; +/*!40000 ALTER TABLE `innodb_index_stats` DISABLE KEYS */; +REPLACE INTO `innodb_index_stats` VALUES ('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index'); +/*!40000 ALTER TABLE `innodb_index_stats` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `innodb_table_stats` WRITE; +/*!40000 ALTER TABLE `innodb_table_stats` DISABLE KEYS */; +REPLACE INTO `innodb_table_stats` VALUES ('mysql','tz','2019-12-31 21:00:00',393,1,0); +/*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */; +UNLOCK TABLES; + +USE mysql; + +LOCK TABLES `time_zone` WRITE; +/*!40000 ALTER TABLE `time_zone` DISABLE KEYS */; +REPLACE INTO `time_zone` VALUES (1,'N'),(2,'N'),(3,'N'),(4,'Y'),(5,'N'); +/*!40000 ALTER TABLE `time_zone` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `time_zone_name` WRITE; +/*!40000 ALTER TABLE `time_zone_name` DISABLE KEYS */; +REPLACE INTO `time_zone_name` VALUES ('Europe/Moscow',3),('Japan',5),('leap/Europe/Moscow',4),('MET',1),('Universal',2),('UTC',2); +/*!40000 ALTER TABLE `time_zone_name` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `time_zone_leap_second` WRITE; +/*!40000 ALTER TABLE `time_zone_leap_second` DISABLE KEYS */; +REPLACE INTO `time_zone_leap_second` VALUES (78796800,1),(94694401,2),(126230402,3),(157766403,4),(189302404,5),(220924805,6),(252460806,7),(283996807,8),(315532808,9),(362793609,10),(394329610,11),(425865611,12),(489024012,13),(567993613,14),(631152014,15),(662688015,16),(709948816,17),(741484817,18),(773020818,19),(820454419,20),(867715220,21),(915148821,22); +/*!40000 ALTER TABLE `time_zone_leap_second` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `time_zone_transition` WRITE; +/*!40000 ALTER TABLE `time_zone_transition` DISABLE KEYS */; +REPLACE INTO `time_zone_transition` VALUES (1,-1693706400,0),(1,-1680483600,1),(1,-1663455600,2),(1,-1650150000,3),(1,-1632006000,2),(1,-1618700400,3),(1,-938905200,2),(1,-857257200,3),(1,-844556400,2),(1,-828226800,3),(1,-812502000,2),(1,-796777200,3),(1,228877200,2),(1,243997200,3),(1,260326800,2),(1,276051600,3),(1,291776400,2),(1,307501200,3),(1,323830800,2),(1,338950800,3),(1,354675600,2),(1,370400400,3),(1,386125200,2),(1,401850000,3),(1,417574800,2),(1,433299600,3),(1,449024400,2),(1,465354000,3),(1,481078800,2),(1,496803600,3),(1,512528400,2),(1,528253200,3),(1,543978000,2),(1,559702800,3),(1,575427600,2),(1,591152400,3),(1,606877200,2),(1,622602000,3),(1,638326800,2),(1,654656400,3),(1,670381200,2),(1,686106000,3),(1,701830800,2),(1,717555600,3),(1,733280400,2),(1,749005200,3),(1,764730000,2),(1,780454800,3),(1,796179600,2),(1,811904400,3),(1,828234000,2),(1,846378000,3),(1,859683600,2),(1,877827600,3),(1,891133200,2),(1,909277200,3),(1,922582800,2),(1,941331600,3),(1,954032400,2),(1,972781200,3),(1,985482000,2),(1,1004230800,3),(1,1017536400,2),(1,1035680400,3),(1,1048986000,2),(1,1067130000,3),(1,1080435600,2),(1,1099184400,3),(1,1111885200,2),(1,1130634000,3),(1,1143334800,2),(1,1162083600,3),(1,1174784400,2),(1,1193533200,3),(1,1206838800,2),(1,1224982800,3),(1,1238288400,2),(1,1256432400,3),(1,1269738000,2),(1,1288486800,3),(1,1301187600,2),(1,1319936400,3),(1,1332637200,2),(1,1351386000,3),(1,1364691600,2),(1,1382835600,3),(1,1396141200,2),(1,1414285200,3),(1,1427590800,2),(1,1445734800,3),(1,1459040400,2),(1,1477789200,3),(1,1490490000,2),(1,1509238800,3),(1,1521939600,2),(1,1540688400,3),(1,1553994000,2),(1,1572138000,3),(1,1585443600,2),(1,1603587600,3),(1,1616893200,2),(1,1635642000,3),(1,1648342800,2),(1,1667091600,3),(1,1679792400,2),(1,1698541200,3),(1,1711846800,2),(1,1729990800,3),(1,1743296400,2),(1,1761440400,3),(1,1774746000,2),(1,1792890000,3),(1,1806195600,2),(1,1824944400,3),(1,1837645200,2),(1,1856394000,3),(1,1869094800,2),(1,1887843600,3),(1,1901149200,2),(1,1919293200,3),(1,1932598800,2),(1,1950742800,3),(1,1964048400,2),(1,1982797200,3),(1,1995498000,2),(1,2014246800,3),(1,2026947600,2),(1,2045696400,3),(1,2058397200,2),(1,2077146000,3),(1,2090451600,2),(1,2108595600,3),(1,2121901200,2),(1,2140045200,3),(3,-1688265000,2),(3,-1656819048,1),(3,-1641353448,2),(3,-1627965048,3),(3,-1618716648,1),(3,-1596429048,3),(3,-1593829848,5),(3,-1589860800,4),(3,-1542427200,5),(3,-1539493200,6),(3,-1525323600,5),(3,-1522728000,4),(3,-1491188400,7),(3,-1247536800,4),(3,354920400,5),(3,370728000,4),(3,386456400,5),(3,402264000,4),(3,417992400,5),(3,433800000,4),(3,449614800,5),(3,465346800,8),(3,481071600,9),(3,496796400,8),(3,512521200,9),(3,528246000,8),(3,543970800,9),(3,559695600,8),(3,575420400,9),(3,591145200,8),(3,606870000,9),(3,622594800,8),(3,638319600,9),(3,654649200,8),(3,670374000,10),(3,686102400,11),(3,695779200,8),(3,701812800,5),(3,717534000,4),(3,733273200,9),(3,748998000,8),(3,764722800,9),(3,780447600,8),(3,796172400,9),(3,811897200,8),(3,828226800,9),(3,846370800,8),(3,859676400,9),(3,877820400,8),(3,891126000,9),(3,909270000,8),(3,922575600,9),(3,941324400,8),(3,954025200,9),(3,972774000,8),(3,985474800,9),(3,1004223600,8),(3,1017529200,9),(3,1035673200,8),(3,1048978800,9),(3,1067122800,8),(3,1080428400,9),(3,1099177200,8),(3,1111878000,9),(3,1130626800,8),(3,1143327600,9),(3,1162076400,8),(3,1174777200,9),(3,1193526000,8),(3,1206831600,9),(3,1224975600,8),(3,1238281200,9),(3,1256425200,8),(3,1269730800,9),(3,1288479600,8),(3,1301180400,9),(3,1319929200,8),(3,1332630000,9),(3,1351378800,8),(3,1364684400,9),(3,1382828400,8),(3,1396134000,9),(3,1414278000,8),(3,1427583600,9),(3,1445727600,8),(3,1459033200,9),(3,1477782000,8),(3,1490482800,9),(3,1509231600,8),(3,1521932400,9),(3,1540681200,8),(3,1553986800,9),(3,1572130800,8),(3,1585436400,9),(3,1603580400,8),(3,1616886000,9),(3,1635634800,8),(3,1648335600,9),(3,1667084400,8),(3,1679785200,9),(3,1698534000,8),(3,1711839600,9),(3,1729983600,8),(3,1743289200,9),(3,1761433200,8),(3,1774738800,9),(3,1792882800,8),(3,1806188400,9),(3,1824937200,8),(3,1837638000,9),(3,1856386800,8),(3,1869087600,9),(3,1887836400,8),(3,1901142000,9),(3,1919286000,8),(3,1932591600,9),(3,1950735600,8),(3,1964041200,9),(3,1982790000,8),(3,1995490800,9),(3,2014239600,8),(3,2026940400,9),(3,2045689200,8),(3,2058390000,9),(3,2077138800,8),(3,2090444400,9),(3,2108588400,8),(3,2121894000,9),(3,2140038000,8),(4,-1688265000,2),(4,-1656819048,1),(4,-1641353448,2),(4,-1627965048,3),(4,-1618716648,1),(4,-1596429048,3),(4,-1593829848,5),(4,-1589860800,4),(4,-1542427200,5),(4,-1539493200,6),(4,-1525323600,5),(4,-1522728000,4),(4,-1491188400,7),(4,-1247536800,4),(4,354920409,5),(4,370728010,4),(4,386456410,5),(4,402264011,4),(4,417992411,5),(4,433800012,4),(4,449614812,5),(4,465346812,8),(4,481071612,9),(4,496796413,8),(4,512521213,9),(4,528246013,8),(4,543970813,9),(4,559695613,8),(4,575420414,9),(4,591145214,8),(4,606870014,9),(4,622594814,8),(4,638319615,9),(4,654649215,8),(4,670374016,10),(4,686102416,11),(4,695779216,8),(4,701812816,5),(4,717534017,4),(4,733273217,9),(4,748998018,8),(4,764722818,9),(4,780447619,8),(4,796172419,9),(4,811897219,8),(4,828226820,9),(4,846370820,8),(4,859676420,9),(4,877820421,8),(4,891126021,9),(4,909270021,8),(4,922575622,9),(4,941324422,8),(4,954025222,9),(4,972774022,8),(4,985474822,9),(4,1004223622,8),(4,1017529222,9),(4,1035673222,8),(4,1048978822,9),(4,1067122822,8),(4,1080428422,9),(4,1099177222,8),(4,1111878022,9),(4,1130626822,8),(4,1143327622,9),(4,1162076422,8),(4,1174777222,9),(4,1193526022,8),(4,1206831622,9),(4,1224975622,8),(4,1238281222,9),(4,1256425222,8),(4,1269730822,9),(4,1288479622,8),(4,1301180422,9),(4,1319929222,8),(4,1332630022,9),(4,1351378822,8),(4,1364684422,9),(4,1382828422,8),(4,1396134022,9),(4,1414278022,8),(4,1427583622,9),(4,1445727622,8),(4,1459033222,9),(4,1477782022,8),(4,1490482822,9),(4,1509231622,8),(4,1521932422,9),(4,1540681222,8),(4,1553986822,9),(4,1572130822,8),(4,1585436422,9),(4,1603580422,8),(4,1616886022,9),(4,1635634822,8),(4,1648335622,9),(4,1667084422,8),(4,1679785222,9),(4,1698534022,8),(4,1711839622,9),(4,1729983622,8),(4,1743289222,9),(4,1761433222,8),(4,1774738822,9),(4,1792882822,8),(4,1806188422,9),(4,1824937222,8),(4,1837638022,9),(4,1856386822,8),(4,1869087622,9),(4,1887836422,8),(4,1901142022,9),(4,1919286022,8),(4,1932591622,9),(4,1950735622,8),(4,1964041222,9),(4,1982790022,8),(4,1995490822,9),(4,2014239622,8),(4,2026940422,9),(4,2045689222,8),(4,2058390022,9),(4,2077138822,8),(4,2090444422,9),(4,2108588422,8),(4,2121894022,9),(4,2140038022,8),(5,-1009875600,1); +/*!40000 ALTER TABLE `time_zone_transition` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `time_zone_transition_type` WRITE; +/*!40000 ALTER TABLE `time_zone_transition_type` DISABLE KEYS */; +REPLACE INTO `time_zone_transition_type` VALUES (1,0,7200,1,'MEST'),(1,1,3600,0,'MET'),(1,2,7200,1,'MEST'),(1,3,3600,0,'MET'),(2,0,0,0,'UTC'),(3,0,9000,0,'MMT'),(3,1,12648,1,'MST'),(3,2,9048,0,'MMT'),(3,3,16248,1,'MDST'),(3,4,10800,0,'MSK'),(3,5,14400,1,'MSD'),(3,6,18000,1,'MSD'),(3,7,7200,0,'EET'),(3,8,10800,0,'MSK'),(3,9,14400,1,'MSD'),(3,10,10800,1,'EEST'),(3,11,7200,0,'EET'),(4,0,9000,0,'MMT'),(4,1,12648,1,'MST'),(4,2,9048,0,'MMT'),(4,3,16248,1,'MDST'),(4,4,10800,0,'MSK'),(4,5,14400,1,'MSD'),(4,6,18000,1,'MSD'),(4,7,7200,0,'EET'),(4,8,10800,0,'MSK'),(4,9,14400,1,'MSD'),(4,10,10800,1,'EEST'),(4,11,7200,0,'EET'),(5,0,32400,0,'CJT'),(5,1,32400,0,'JST'); +/*!40000 ALTER TABLE `time_zone_transition_type` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +# +# mysqldump of system tables with --system=all --insert-ignore +# + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +CREATE USER IF NOT EXISTS `mariadb.sys`@`localhost` PASSWORD EXPIRE; +CREATE USER IF NOT EXISTS `root`@`localhost`; +CREATE USER IF NOT EXISTS `USER`@`%`; +SELECT COALESCE(CURRENT_ROLE(),'NONE') into @current_role; +CREATE ROLE IF NOT EXISTS mariadb_dump_import_role; +GRANT mariadb_dump_import_role TO CURRENT_USER(); +SET ROLE mariadb_dump_import_role; +/*!80001 CREATE ROLE IF NOT EXISTS 'role_1' */; +/*M!100005 CREATE ROLE IF NOT EXISTS 'role_1' WITH ADMIN mariadb_dump_import_role */; +/*M!100005 GRANT 'role_1' TO 'root'@'localhost' WITH ADMIN OPTION */; +/*!80001 CREATE ROLE IF NOT EXISTS 'role_2' */; +/*M!100005 CREATE ROLE IF NOT EXISTS 'role_2' WITH ADMIN mariadb_dump_import_role */; +/*M!100005 GRANT 'role_2' TO 'role_1' WITH ADMIN OPTION */; +GRANT USAGE ON *.* TO `mariadb.sys`@`localhost`; +GRANT SELECT, DELETE ON `mysql`.`global_priv` TO `mariadb.sys`@`localhost`; +/*M!100005 SET DEFAULT ROLE NONE FOR 'mariadb.sys'@'localhost' */; +/*!80001 ALTER USER 'mariadb.sys'@'localhost' DEFAULT ROLE NONE */; +GRANT `role_1` TO `root`@`localhost` WITH ADMIN OPTION; +GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION; +GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION; +/*M!100005 SET DEFAULT ROLE NONE FOR 'root'@'localhost' */; +/*!80001 ALTER USER 'root'@'localhost' DEFAULT ROLE NONE */; +GRANT `role_1` TO `USER`@`%`; +GRANT `role_2` TO `USER`@`%`; +GRANT USAGE ON *.* TO `USER`@`%`; +/*M!100005 SET DEFAULT ROLE 'role_2' FOR 'USER'@'%' */; +/*!80001 ALTER USER 'USER'@'%' DEFAULT ROLE 'role_2' */; +GRANT `role_2` TO `role_1` WITH ADMIN OPTION; +GRANT SHOW DATABASES ON *.* TO `role_1`; +GRANT USAGE ON *.* TO `role_2`; +GRANT USAGE ON *.* TO `role_2`; +SET ROLE NONE; +DROP ROLE mariadb_dump_import_role; +/*M!100203 EXECUTE IMMEDIATE CONCAT('SET ROLE ', @current_role) */; +CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME 'UDF_EXAMPLE_LIB'; +CREATE SERVER /*M!100103 IF NOT EXISTS */ s1 FOREIGN DATA WRAPPER mysql OPTIONS (Host 'localhost', Port 3306); + +USE mysql; + +LOCK TABLES `column_stats` WRITE; +/*!40000 ALTER TABLE `column_stats` DISABLE KEYS */; +INSERT IGNORE INTO `column_stats` VALUES ('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,254,'DOUBLE_PREC_HB','\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿'); +/*!40000 ALTER TABLE `column_stats` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `index_stats` WRITE; +/*!40000 ALTER TABLE `index_stats` DISABLE KEYS */; +INSERT IGNORE INTO `index_stats` VALUES ('mysql','tz','PRIMARY',1,98.2500); +/*!40000 ALTER TABLE `index_stats` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `table_stats` WRITE; +/*!40000 ALTER TABLE `table_stats` DISABLE KEYS */; +INSERT IGNORE INTO `table_stats` VALUES ('mysql','tz',393); +/*!40000 ALTER TABLE `table_stats` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `innodb_index_stats` WRITE; +/*!40000 ALTER TABLE `innodb_index_stats` DISABLE KEYS */; +INSERT IGNORE INTO `innodb_index_stats` VALUES ('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index'); +/*!40000 ALTER TABLE `innodb_index_stats` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `innodb_table_stats` WRITE; +/*!40000 ALTER TABLE `innodb_table_stats` DISABLE KEYS */; +INSERT IGNORE INTO `innodb_table_stats` VALUES ('mysql','tz','2019-12-31 21:00:00',393,1,0); +/*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */; +UNLOCK TABLES; + +USE mysql; + +LOCK TABLES `time_zone` WRITE; +/*!40000 ALTER TABLE `time_zone` DISABLE KEYS */; +INSERT IGNORE INTO `time_zone` VALUES (1,'N'),(2,'N'),(3,'N'),(4,'Y'),(5,'N'); +/*!40000 ALTER TABLE `time_zone` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `time_zone_name` WRITE; +/*!40000 ALTER TABLE `time_zone_name` DISABLE KEYS */; +INSERT IGNORE INTO `time_zone_name` VALUES ('Europe/Moscow',3),('Japan',5),('leap/Europe/Moscow',4),('MET',1),('Universal',2),('UTC',2); +/*!40000 ALTER TABLE `time_zone_name` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `time_zone_leap_second` WRITE; +/*!40000 ALTER TABLE `time_zone_leap_second` DISABLE KEYS */; +INSERT IGNORE INTO `time_zone_leap_second` VALUES (78796800,1),(94694401,2),(126230402,3),(157766403,4),(189302404,5),(220924805,6),(252460806,7),(283996807,8),(315532808,9),(362793609,10),(394329610,11),(425865611,12),(489024012,13),(567993613,14),(631152014,15),(662688015,16),(709948816,17),(741484817,18),(773020818,19),(820454419,20),(867715220,21),(915148821,22); +/*!40000 ALTER TABLE `time_zone_leap_second` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `time_zone_transition` WRITE; +/*!40000 ALTER TABLE `time_zone_transition` DISABLE KEYS */; +INSERT IGNORE INTO `time_zone_transition` VALUES (1,-1693706400,0),(1,-1680483600,1),(1,-1663455600,2),(1,-1650150000,3),(1,-1632006000,2),(1,-1618700400,3),(1,-938905200,2),(1,-857257200,3),(1,-844556400,2),(1,-828226800,3),(1,-812502000,2),(1,-796777200,3),(1,228877200,2),(1,243997200,3),(1,260326800,2),(1,276051600,3),(1,291776400,2),(1,307501200,3),(1,323830800,2),(1,338950800,3),(1,354675600,2),(1,370400400,3),(1,386125200,2),(1,401850000,3),(1,417574800,2),(1,433299600,3),(1,449024400,2),(1,465354000,3),(1,481078800,2),(1,496803600,3),(1,512528400,2),(1,528253200,3),(1,543978000,2),(1,559702800,3),(1,575427600,2),(1,591152400,3),(1,606877200,2),(1,622602000,3),(1,638326800,2),(1,654656400,3),(1,670381200,2),(1,686106000,3),(1,701830800,2),(1,717555600,3),(1,733280400,2),(1,749005200,3),(1,764730000,2),(1,780454800,3),(1,796179600,2),(1,811904400,3),(1,828234000,2),(1,846378000,3),(1,859683600,2),(1,877827600,3),(1,891133200,2),(1,909277200,3),(1,922582800,2),(1,941331600,3),(1,954032400,2),(1,972781200,3),(1,985482000,2),(1,1004230800,3),(1,1017536400,2),(1,1035680400,3),(1,1048986000,2),(1,1067130000,3),(1,1080435600,2),(1,1099184400,3),(1,1111885200,2),(1,1130634000,3),(1,1143334800,2),(1,1162083600,3),(1,1174784400,2),(1,1193533200,3),(1,1206838800,2),(1,1224982800,3),(1,1238288400,2),(1,1256432400,3),(1,1269738000,2),(1,1288486800,3),(1,1301187600,2),(1,1319936400,3),(1,1332637200,2),(1,1351386000,3),(1,1364691600,2),(1,1382835600,3),(1,1396141200,2),(1,1414285200,3),(1,1427590800,2),(1,1445734800,3),(1,1459040400,2),(1,1477789200,3),(1,1490490000,2),(1,1509238800,3),(1,1521939600,2),(1,1540688400,3),(1,1553994000,2),(1,1572138000,3),(1,1585443600,2),(1,1603587600,3),(1,1616893200,2),(1,1635642000,3),(1,1648342800,2),(1,1667091600,3),(1,1679792400,2),(1,1698541200,3),(1,1711846800,2),(1,1729990800,3),(1,1743296400,2),(1,1761440400,3),(1,1774746000,2),(1,1792890000,3),(1,1806195600,2),(1,1824944400,3),(1,1837645200,2),(1,1856394000,3),(1,1869094800,2),(1,1887843600,3),(1,1901149200,2),(1,1919293200,3),(1,1932598800,2),(1,1950742800,3),(1,1964048400,2),(1,1982797200,3),(1,1995498000,2),(1,2014246800,3),(1,2026947600,2),(1,2045696400,3),(1,2058397200,2),(1,2077146000,3),(1,2090451600,2),(1,2108595600,3),(1,2121901200,2),(1,2140045200,3),(3,-1688265000,2),(3,-1656819048,1),(3,-1641353448,2),(3,-1627965048,3),(3,-1618716648,1),(3,-1596429048,3),(3,-1593829848,5),(3,-1589860800,4),(3,-1542427200,5),(3,-1539493200,6),(3,-1525323600,5),(3,-1522728000,4),(3,-1491188400,7),(3,-1247536800,4),(3,354920400,5),(3,370728000,4),(3,386456400,5),(3,402264000,4),(3,417992400,5),(3,433800000,4),(3,449614800,5),(3,465346800,8),(3,481071600,9),(3,496796400,8),(3,512521200,9),(3,528246000,8),(3,543970800,9),(3,559695600,8),(3,575420400,9),(3,591145200,8),(3,606870000,9),(3,622594800,8),(3,638319600,9),(3,654649200,8),(3,670374000,10),(3,686102400,11),(3,695779200,8),(3,701812800,5),(3,717534000,4),(3,733273200,9),(3,748998000,8),(3,764722800,9),(3,780447600,8),(3,796172400,9),(3,811897200,8),(3,828226800,9),(3,846370800,8),(3,859676400,9),(3,877820400,8),(3,891126000,9),(3,909270000,8),(3,922575600,9),(3,941324400,8),(3,954025200,9),(3,972774000,8),(3,985474800,9),(3,1004223600,8),(3,1017529200,9),(3,1035673200,8),(3,1048978800,9),(3,1067122800,8),(3,1080428400,9),(3,1099177200,8),(3,1111878000,9),(3,1130626800,8),(3,1143327600,9),(3,1162076400,8),(3,1174777200,9),(3,1193526000,8),(3,1206831600,9),(3,1224975600,8),(3,1238281200,9),(3,1256425200,8),(3,1269730800,9),(3,1288479600,8),(3,1301180400,9),(3,1319929200,8),(3,1332630000,9),(3,1351378800,8),(3,1364684400,9),(3,1382828400,8),(3,1396134000,9),(3,1414278000,8),(3,1427583600,9),(3,1445727600,8),(3,1459033200,9),(3,1477782000,8),(3,1490482800,9),(3,1509231600,8),(3,1521932400,9),(3,1540681200,8),(3,1553986800,9),(3,1572130800,8),(3,1585436400,9),(3,1603580400,8),(3,1616886000,9),(3,1635634800,8),(3,1648335600,9),(3,1667084400,8),(3,1679785200,9),(3,1698534000,8),(3,1711839600,9),(3,1729983600,8),(3,1743289200,9),(3,1761433200,8),(3,1774738800,9),(3,1792882800,8),(3,1806188400,9),(3,1824937200,8),(3,1837638000,9),(3,1856386800,8),(3,1869087600,9),(3,1887836400,8),(3,1901142000,9),(3,1919286000,8),(3,1932591600,9),(3,1950735600,8),(3,1964041200,9),(3,1982790000,8),(3,1995490800,9),(3,2014239600,8),(3,2026940400,9),(3,2045689200,8),(3,2058390000,9),(3,2077138800,8),(3,2090444400,9),(3,2108588400,8),(3,2121894000,9),(3,2140038000,8),(4,-1688265000,2),(4,-1656819048,1),(4,-1641353448,2),(4,-1627965048,3),(4,-1618716648,1),(4,-1596429048,3),(4,-1593829848,5),(4,-1589860800,4),(4,-1542427200,5),(4,-1539493200,6),(4,-1525323600,5),(4,-1522728000,4),(4,-1491188400,7),(4,-1247536800,4),(4,354920409,5),(4,370728010,4),(4,386456410,5),(4,402264011,4),(4,417992411,5),(4,433800012,4),(4,449614812,5),(4,465346812,8),(4,481071612,9),(4,496796413,8),(4,512521213,9),(4,528246013,8),(4,543970813,9),(4,559695613,8),(4,575420414,9),(4,591145214,8),(4,606870014,9),(4,622594814,8),(4,638319615,9),(4,654649215,8),(4,670374016,10),(4,686102416,11),(4,695779216,8),(4,701812816,5),(4,717534017,4),(4,733273217,9),(4,748998018,8),(4,764722818,9),(4,780447619,8),(4,796172419,9),(4,811897219,8),(4,828226820,9),(4,846370820,8),(4,859676420,9),(4,877820421,8),(4,891126021,9),(4,909270021,8),(4,922575622,9),(4,941324422,8),(4,954025222,9),(4,972774022,8),(4,985474822,9),(4,1004223622,8),(4,1017529222,9),(4,1035673222,8),(4,1048978822,9),(4,1067122822,8),(4,1080428422,9),(4,1099177222,8),(4,1111878022,9),(4,1130626822,8),(4,1143327622,9),(4,1162076422,8),(4,1174777222,9),(4,1193526022,8),(4,1206831622,9),(4,1224975622,8),(4,1238281222,9),(4,1256425222,8),(4,1269730822,9),(4,1288479622,8),(4,1301180422,9),(4,1319929222,8),(4,1332630022,9),(4,1351378822,8),(4,1364684422,9),(4,1382828422,8),(4,1396134022,9),(4,1414278022,8),(4,1427583622,9),(4,1445727622,8),(4,1459033222,9),(4,1477782022,8),(4,1490482822,9),(4,1509231622,8),(4,1521932422,9),(4,1540681222,8),(4,1553986822,9),(4,1572130822,8),(4,1585436422,9),(4,1603580422,8),(4,1616886022,9),(4,1635634822,8),(4,1648335622,9),(4,1667084422,8),(4,1679785222,9),(4,1698534022,8),(4,1711839622,9),(4,1729983622,8),(4,1743289222,9),(4,1761433222,8),(4,1774738822,9),(4,1792882822,8),(4,1806188422,9),(4,1824937222,8),(4,1837638022,9),(4,1856386822,8),(4,1869087622,9),(4,1887836422,8),(4,1901142022,9),(4,1919286022,8),(4,1932591622,9),(4,1950735622,8),(4,1964041222,9),(4,1982790022,8),(4,1995490822,9),(4,2014239622,8),(4,2026940422,9),(4,2045689222,8),(4,2058390022,9),(4,2077138822,8),(4,2090444422,9),(4,2108588422,8),(4,2121894022,9),(4,2140038022,8),(5,-1009875600,1); +/*!40000 ALTER TABLE `time_zone_transition` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `time_zone_transition_type` WRITE; +/*!40000 ALTER TABLE `time_zone_transition_type` DISABLE KEYS */; +INSERT IGNORE INTO `time_zone_transition_type` VALUES (1,0,7200,1,'MEST'),(1,1,3600,0,'MET'),(1,2,7200,1,'MEST'),(1,3,3600,0,'MET'),(2,0,0,0,'UTC'),(3,0,9000,0,'MMT'),(3,1,12648,1,'MST'),(3,2,9048,0,'MMT'),(3,3,16248,1,'MDST'),(3,4,10800,0,'MSK'),(3,5,14400,1,'MSD'),(3,6,18000,1,'MSD'),(3,7,7200,0,'EET'),(3,8,10800,0,'MSK'),(3,9,14400,1,'MSD'),(3,10,10800,1,'EEST'),(3,11,7200,0,'EET'),(4,0,9000,0,'MMT'),(4,1,12648,1,'MST'),(4,2,9048,0,'MMT'),(4,3,16248,1,'MDST'),(4,4,10800,0,'MSK'),(4,5,14400,1,'MSD'),(4,6,18000,1,'MSD'),(4,7,7200,0,'EET'),(4,8,10800,0,'MSK'),(4,9,14400,1,'MSD'),(4,10,10800,1,'EEST'),(4,11,7200,0,'EET'),(5,0,32400,0,'CJT'),(5,1,32400,0,'JST'); +/*!40000 ALTER TABLE `time_zone_transition_type` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +SELECT * FROM mysql.global_priv ORDER BY User,Host; +Host User Priv +% USER {"access":0,"plugin":"mysql_native_password","authentication_string":"","password_last_changed":NOW,"default_role":"role_2"} +localhost mariadb.sys {"access":0,"plugin":"mysql_native_password","authentication_string":"","account_locked":false,"password_last_changed":NOW} + role_1 {"access":16384,"is_role":true} + role_2 {"access":0,"is_role":true} +localhost root {"access":18446744073709551615} +CHECKSUM TABLE mysql.roles_mapping, mysql.time_zone_transition, mysql.plugin, +mysql.servers, mysql.func, mysql.innodb_table_stats, mysql.table_stats; +Table Checksum +mysql.roles_mapping 3150178430 +mysql.time_zone_transition 3895294076 +mysql.plugin 0 +mysql.servers 2783974349 +mysql.func 3241572444 +mysql.innodb_table_stats 347867921 +mysql.table_stats 664320059 +# Opps.... +CREATE USER mariadb_test_restore IDENTIFIED BY 'getitback'; +GRANT ALL ON *.* TO mariadb_test_restore WITH GRANT OPTION; +GRANT PROXY ON ''@'%' TO mariadb_test_restore WITH GRANT OPTION; +GRANT SUPER, CREATE USER /*M!100502 ,FEDERATED ADMIN */ ON *.* TO mariadb_test_restore WITH GRANT OPTION; +drop user USER; +delete from mysql.table_stats; +delete from mysql.innodb_table_stats; +delete from mysql.time_zone_transition; +delete from mysql.time_zone_transition_type; +delete from mysql.time_zone; +delete from mysql.time_zone_name; +delete from mysql.time_zone_leap_second; +DROP FUNCTION IF EXISTS metaphon; +DROP SERVER s1; +set time_zone= @@global.time_zone; +# Restore from mysqldump +DROP USER mariadb_test_restore; +SELECT * FROM mysql.global_priv ORDER BY User,Host; +Host User Priv +% USER {"access":0,"plugin":"mysql_native_password","authentication_string":"","password_last_changed":NOW,"default_role":"role_2"} +localhost mariadb.sys {"access":0,"plugin":"mysql_native_password","authentication_string":"","password_last_changed":NOW,"password_lifetime":-1,"default_role":""} + role_1 {"access":16384,"is_role":true} + role_2 {"access":0,"is_role":true} +localhost root {"access":1073741823,"plugin":"mysql_native_password","authentication_string":"","password_last_changed":NOW,"default_role":""} +CHECKSUM TABLE mysql.roles_mapping, mysql.time_zone_transition, mysql.plugin, +mysql.servers, mysql.func, mysql.innodb_table_stats, mysql.table_stats; +Table Checksum +mysql.roles_mapping 3150178430 +mysql.time_zone_transition 3895294076 +mysql.plugin 0 +mysql.servers 2783974349 +mysql.func 3241572444 +mysql.innodb_table_stats 347867921 +mysql.table_stats 664320059 +DROP FUNCTION IF EXISTS metaphon; +DROP SERVER s1; +DELETE FROM mysql.column_stats WHERE db_name='mysql' and table_name in ('tz', 'gtid_slave_pos'); +DELETE FROM mysql.index_stats WHERE db_name='mysql' and table_name in ('tz', 'gtid_slave_pos'); +DELETE FROM mysql.table_stats WHERE db_name='mysql' and table_name in ('tz', 'gtid_slave_pos'); +DELETE FROM mysql.innodb_index_stats WHERE database_name='mysql' and table_name in ('tz','gtid_slave_pos'); +DELETE FROM mysql.innodb_table_stats WHERE database_name='mysql' and table_name in ('tz','gtid_slave_pos'); +drop table mysql.tz; +DROP ROLE role_2; +DROP ROLE role_1; +drop user USER; +replace into mysql.global_priv select * from backup_users; +replace into mysql.tables_priv select * from tables_priv; +flush privileges; +drop table backup_users, tables_priv; diff --git a/mysql-test/main/mysqldump-system.test b/mysql-test/main/mysqldump-system.test new file mode 100644 index 00000000000..3232b012acf --- /dev/null +++ b/mysql-test/main/mysqldump-system.test @@ -0,0 +1,155 @@ +--source include/not_embedded.inc +--source include/have_innodb.inc +--source include/have_udf.inc +--source include/platform.inc + +--echo # +--echo # MDEV-23630: mysqldump to logically dump system tables +--echo # +--echo # + +create table backup_users like mysql.global_priv; +create table tables_priv like mysql.tables_priv; +insert into backup_users select * from mysql.global_priv; +insert into tables_priv select * from mysql.tables_priv; +delete from mysql.global_priv where host not in ('localhost'); +flush privileges; + +# mariadb.sys because of MDEV-24098 +alter user 'mariadb.sys'@'localhost' ACCOUNT UNLOCK; +create user USER; + +# time zone data already loaded + +CREATE ROLE role_1; +CREATE ROLE role_2 WITH ADMIN role_1; + +GRANT SHOW DATABASES ON *.* TO role_1; +GRANT role_1 TO USER; +GRANT role_2 TO USER; +SET DEFAULT ROLE role_2 FOR USER; + +ALTER TABLE mysql.roles_mapping ORDER BY Host, User, Role; + +# innodb and EITS tables statistics +# +set @save_innodb_stats_persistent= @@innodb_stats_persistent; +create table mysql.tz like mysql.time_zone_transition; +alter table mysql.tz engine=innodb; +insert into mysql.tz select * from mysql.time_zone_transition; +set global innodb_stats_persistent=1; +ANALYZE TABLE mysql.tz PERSISTENT FOR ALL; +# for predictable output in tests +delete from mysql.index_stats where prefix_arity!=1; +delete from mysql.column_stats where column_name!='Time_zone_id'; +set time_zone="+03:00"; +update mysql.innodb_index_stats set last_update="2020-01-01" where database_name="mysql" and table_name="tz"; +update mysql.innodb_table_stats set last_update="2020-01-01" where database_name="mysql" and table_name="tz"; +set global innodb_stats_persistent= @save_innodb_stats_persistent; +alter table mysql.time_zone_name ORDER BY Name; + +CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS(Host 'localhost'); + +--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB +eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO"; + + +# +# Lets actually do some tests. +# + +--echo # +--echo # mysqldump of system tables with --system=all +--echo # + +--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB +--exec $MYSQL_DUMP --skip-comments --system=all + + +--echo # +--echo # mysqldump of system tables with --system=all --replace +--echo # + +--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB +--exec $MYSQL_DUMP --skip-comments --system=all --replace + + +# save this for restore +--exec $MYSQL_DUMP --system=users,servers,stats,timezones,udfs --replace > $MYSQLTEST_VARDIR/tmp/dump1.sql + +--echo # +--echo # mysqldump of system tables with --system=all --insert-ignore +--echo # + +--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB +--exec $MYSQL_DUMP --skip-comments --system=all --insert-ignore + + +# global_priv checksum not restored because: +# mariadb.sys - different Priv on restore +# password_last_changed date isn't saved/restored +# root user's Priv $.access lower number on restore + +--replace_regex /"password_last_changed":[0-9]+/"password_last_changed":NOW/ +SELECT * FROM mysql.global_priv ORDER BY User,Host; + +CHECKSUM TABLE mysql.roles_mapping, mysql.time_zone_transition, mysql.plugin, + mysql.servers, mysql.func, mysql.innodb_table_stats, mysql.table_stats; + +--echo # Opps.... + +CREATE USER mariadb_test_restore IDENTIFIED BY 'getitback'; +GRANT ALL ON *.* TO mariadb_test_restore WITH GRANT OPTION; +GRANT PROXY ON ''@'%' TO mariadb_test_restore WITH GRANT OPTION; +GRANT SUPER, CREATE USER /*M!100502 ,FEDERATED ADMIN */ ON *.* TO mariadb_test_restore WITH GRANT OPTION; + +drop user USER; +delete from mysql.table_stats; +delete from mysql.innodb_table_stats; +delete from mysql.time_zone_transition; +delete from mysql.time_zone_transition_type; +delete from mysql.time_zone; +delete from mysql.time_zone_name; +delete from mysql.time_zone_leap_second; +DROP FUNCTION IF EXISTS metaphon; +DROP SERVER s1; +set time_zone= @@global.time_zone; + +--echo # Restore from mysqldump +--exec $MYSQL --user mariadb_test_restore --password=getitback --show-warnings < $MYSQLTEST_VARDIR/tmp/dump1.sql + +DROP USER mariadb_test_restore; + +# successful restore? + +--replace_regex /"password_last_changed":[0-9]+/"password_last_changed":NOW/ +SELECT * FROM mysql.global_priv ORDER BY User,Host; + +CHECKSUM TABLE mysql.roles_mapping, mysql.time_zone_transition, mysql.plugin, + mysql.servers, mysql.func, mysql.innodb_table_stats, mysql.table_stats; + +# +# Cleanup +# + +DROP FUNCTION IF EXISTS metaphon; + +DROP SERVER s1; + +# EITS && innodb stats +DELETE FROM mysql.column_stats WHERE db_name='mysql' and table_name in ('tz', 'gtid_slave_pos'); +DELETE FROM mysql.index_stats WHERE db_name='mysql' and table_name in ('tz', 'gtid_slave_pos'); +DELETE FROM mysql.table_stats WHERE db_name='mysql' and table_name in ('tz', 'gtid_slave_pos'); +DELETE FROM mysql.innodb_index_stats WHERE database_name='mysql' and table_name in ('tz','gtid_slave_pos'); +DELETE FROM mysql.innodb_table_stats WHERE database_name='mysql' and table_name in ('tz','gtid_slave_pos'); +drop table mysql.tz; + +DROP ROLE role_2; +DROP ROLE role_1; + +drop user USER; + +replace into mysql.global_priv select * from backup_users; +replace into mysql.tables_priv select * from tables_priv; +flush privileges; +drop table backup_users, tables_priv; diff --git a/mysql-test/main/mysqldump.result b/mysql-test/main/mysqldump.result index b8dad5daae3..19ffca17b1e 100644 --- a/mysql-test/main/mysqldump.result +++ b/mysql-test/main/mysqldump.result @@ -5422,8 +5422,9 @@ proc one DROP DATABASE bug25717383; Usage: mysqldump [OPTIONS] database [tables] -OR mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...] -OR mysqldump [OPTIONS] --all-databases [OPTIONS] +OR mysqldump [OPTIONS] --databases DB1 [DB2 DB3...] +OR mysqldump [OPTIONS] --all-databases +OR mysqldump [OPTIONS] --system=[SYSTEMOPTIONS]] For more options, use mysqldump --help # # MDEV-9001 - [PATCH] Fix DB name quoting in mysqldump --routine diff --git a/mysql-test/main/order_by.result b/mysql-test/main/order_by.result index c2bdbfa2f99..22dfcbaa23e 100644 --- a/mysql-test/main/order_by.result +++ b/mysql-test/main/order_by.result @@ -3508,6 +3508,26 @@ NULLIF(GROUP_CONCAT(v1), null) C B DROP TABLE t1; +# +# MDEV-24033: SIGSEGV in __memcmp_avx2_movbe from queue_insert | SIGSEGV in __memcmp_avx2_movbe from native_compare +# +SET @save_max_length_for_sort_data=@@max_length_for_sort_data; +SET @save_max_sort_length= @@max_sort_length; +SET @save_sql_select_limit= @@sql_select_limit; +CREATE TABLE t1 (a DECIMAL(64,0), b INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +SET max_length_for_sort_data= 30; +SET sql_select_limit = 3; +SET max_sort_length=8; +SELECT * FROM t1 ORDER BY a+1; +a b +1 1 +2 2 +3 3 +SET max_length_for_sort_data=@save_max_length_for_sort_data; +SET max_sort_length= @save_max_sort_length; +SET sql_select_limit= @save_sql_select_limit; +DROP TABLE t1; # End of 10.2 tests # # MDEV-16214: Incorrect plan taken by the optimizer , uses INDEX instead of ref access with ORDER BY diff --git a/mysql-test/main/order_by.test b/mysql-test/main/order_by.test index 1408641d79d..1269800e79e 100644 --- a/mysql-test/main/order_by.test +++ b/mysql-test/main/order_by.test @@ -2273,6 +2273,27 @@ ORDER BY id+1 DESC; DROP TABLE t1; +--echo # +--echo # MDEV-24033: SIGSEGV in __memcmp_avx2_movbe from queue_insert | SIGSEGV in __memcmp_avx2_movbe from native_compare +--echo # + +SET @save_max_length_for_sort_data=@@max_length_for_sort_data; +SET @save_max_sort_length= @@max_sort_length; +SET @save_sql_select_limit= @@sql_select_limit; + +CREATE TABLE t1 (a DECIMAL(64,0), b INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); + +SET max_length_for_sort_data= 30; +SET sql_select_limit = 3; +SET max_sort_length=8; +SELECT * FROM t1 ORDER BY a+1; + +SET max_length_for_sort_data=@save_max_length_for_sort_data; +SET max_sort_length= @save_max_sort_length; +SET sql_select_limit= @save_sql_select_limit; +DROP TABLE t1; + --echo # End of 10.2 tests --echo # diff --git a/mysql-test/main/plugin_innodb.test b/mysql-test/main/plugin_innodb.test index 5700486b218..a9c7f04bd4a 100644 --- a/mysql-test/main/plugin_innodb.test +++ b/mysql-test/main/plugin_innodb.test @@ -1,13 +1,6 @@ --source include/not_embedded.inc --source include/have_example_plugin.inc ---source include/have_innodb.inc - -if (!`select count(*) from information_schema.plugins - where plugin_name = 'innodb' and plugin_status = 'active' and - plugin_library is null`) { - skip Need compiled-in InnoDB; -} - +--source include/have_static_innodb.inc --replace_regex /\.dll/.so/ eval install plugin example soname '$HA_EXAMPLE_SO'; diff --git a/mysql-test/main/pool_of_threads.result b/mysql-test/main/pool_of_threads.result index 5f501eb1b68..3f5ce1a37e5 100644 --- a/mysql-test/main/pool_of_threads.result +++ b/mysql-test/main/pool_of_threads.result @@ -2180,11 +2180,9 @@ connection extracon2; KILL QUERY <default_connection_ID>; KILL QUERY <con2_connection_ID>; connection default; -sleep(50) -1 +ERROR 70100: Query execution was interrupted connection con2; -sleep(50) -1 +ERROR 70100: Query execution was interrupted connection extracon; sleep(5.5) 0 diff --git a/mysql-test/main/pool_of_threads.test b/mysql-test/main/pool_of_threads.test index 95b320e6dad..3d581d4605d 100644 --- a/mysql-test/main/pool_of_threads.test +++ b/mysql-test/main/pool_of_threads.test @@ -86,8 +86,10 @@ eval KILL QUERY $con1_id; eval KILL QUERY $con2_id; connection default; +--error ER_QUERY_INTERRUPTED --reap connection con2; +--error ER_QUERY_INTERRUPTED --reap connection extracon; diff --git a/mysql-test/main/precedence.result b/mysql-test/main/precedence.result index f56f945c3fc..d5d4e662a8e 100644 --- a/mysql-test/main/precedence.result +++ b/mysql-test/main/precedence.result @@ -5919,14 +5919,14 @@ view_definition select 2 / 3 * 3 AS `2 / 3 * 3`,2 / (3 * 3) AS `2 / (3 * 3)`,2 / 3 * 3 AS `(2 / 3) * 3` select 2 / 3 * 3, 2 / (3 * 3), (2 / 3) * 3 union select * from v1; 2 / 3 * 3 2 / (3 * 3) (2 / 3) * 3 -2.0001 0.2222 2.0001 +2.0000 0.2222 2.0000 create or replace view v1 as select 2 / 3 / 3, 2 / (3 / 3), (2 / 3) / 3; Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; view_definition select 2 / 3 / 3 AS `2 / 3 / 3`,2 / (3 / 3) AS `2 / (3 / 3)`,2 / 3 / 3 AS `(2 / 3) / 3` select 2 / 3 / 3, 2 / (3 / 3), (2 / 3) / 3 union select * from v1; 2 / 3 / 3 2 / (3 / 3) (2 / 3) / 3 -0.22223333 2.0000 0.22223333 +0.22222222 2.0000 0.22222222 create or replace view v1 as select 2 / 3 DIV 3, 2 / (3 DIV 3), (2 / 3) DIV 3; Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; view_definition diff --git a/mysql-test/main/processlist_notembedded.result b/mysql-test/main/processlist_notembedded.result index b622fdf32b9..3c2671ff5e3 100644 --- a/mysql-test/main/processlist_notembedded.result +++ b/mysql-test/main/processlist_notembedded.result @@ -14,3 +14,16 @@ disconnect con1; connection default; SET DEBUG_SYNC = 'RESET'; End of 5.5 tests +# +# MDEV-23752: SHOW EXPLAIN FOR thd waits for sleep +# +connect con1,localhost,root,,; +select sleep(100000);; +connection default; +SHOW EXPLAIN FOR con_id; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select sleep(100000) +KILL QUERY con_id; +# End of 10.2 tests diff --git a/mysql-test/main/processlist_notembedded.test b/mysql-test/main/processlist_notembedded.test index 6f269a816fc..26021040c39 100644 --- a/mysql-test/main/processlist_notembedded.test +++ b/mysql-test/main/processlist_notembedded.test @@ -40,3 +40,21 @@ SET DEBUG_SYNC = 'RESET'; source include/wait_until_count_sessions.inc; --echo End of 5.5 tests + +--echo # +--echo # MDEV-23752: SHOW EXPLAIN FOR thd waits for sleep +--echo # + +--connect (con1,localhost,root,,) +--let $con_id = `SELECT CONNECTION_ID()` +--send select sleep(100000); + +--connection default + +--replace_result $con_id con_id +eval SHOW EXPLAIN FOR $con_id; + +--replace_result $con_id con_id +eval KILL QUERY $con_id; + +--echo # End of 10.2 tests diff --git a/mysql-test/main/set_statement_notembedded.result b/mysql-test/main/set_statement_notembedded.result index 17cf2f63da9..67d2d8bc505 100644 --- a/mysql-test/main/set_statement_notembedded.result +++ b/mysql-test/main/set_statement_notembedded.result @@ -7,9 +7,8 @@ SLEEP(1) SHOW STATUS LIKE "max_statement_time_exceeded"; Variable_name Value Max_statement_time_exceeded 0 -SET STATEMENT MAX_STATEMENT_TIME=1 FOR SELECT SLEEP(3); -SLEEP(3) -1 +SET STATEMENT MAX_STATEMENT_TIME=1 FOR SELECT SLEEP(10); +ERROR 70100: Query execution was interrupted (max_statement_time exceeded) SHOW STATUS LIKE "max_statement_time_exceeded"; Variable_name Value Max_statement_time_exceeded 1 diff --git a/mysql-test/main/set_statement_notembedded.test b/mysql-test/main/set_statement_notembedded.test index 16488846fba..95d3efd40ca 100644 --- a/mysql-test/main/set_statement_notembedded.test +++ b/mysql-test/main/set_statement_notembedded.test @@ -6,7 +6,8 @@ SELECT @@MAX_STATEMENT_TIME; SET STATEMENT MAX_STATEMENT_TIME=3 FOR SELECT SLEEP(1); SHOW STATUS LIKE "max_statement_time_exceeded"; -SET STATEMENT MAX_STATEMENT_TIME=1 FOR SELECT SLEEP(3); +--error ER_STATEMENT_TIMEOUT +SET STATEMENT MAX_STATEMENT_TIME=1 FOR SELECT SLEEP(10); SHOW STATUS LIKE "max_statement_time_exceeded"; SELECT @@MAX_STATEMENT_TIME; diff --git a/mysql-test/main/subselect4.result b/mysql-test/main/subselect4.result index 1ec1154b16b..252967c09a7 100644 --- a/mysql-test/main/subselect4.result +++ b/mysql-test/main/subselect4.result @@ -2596,7 +2596,7 @@ SELECT population, area, population/area, cast(population/area as DECIMAL(20,9)) FROM t1 LIMIT 1; population area population/area cast(population/area as DECIMAL(20,9)) -11797 91 129.6374 129.637400000 +11797 91 129.6374 129.637362637 SELECT * FROM t1 A WHERE population/area = (SELECT MAX(population/area) from t1 B where A.region = B.region); region area population diff --git a/mysql-test/main/type_newdecimal.result b/mysql-test/main/type_newdecimal.result index eac263296e2..13974c84e15 100644 --- a/mysql-test/main/type_newdecimal.result +++ b/mysql-test/main/type_newdecimal.result @@ -1532,8 +1532,11 @@ select (1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 * 1.01500000 * 1.01500000 * 0.99500000) 0.81298807395367312459230693948000000000 create table t1 as select 5.05 / 0.014; +Warnings: +Note 1265 Data truncated for column '5.05 / 0.014' at row 1 show warnings; Level Code Message +Note 1265 Data truncated for column '5.05 / 0.014' at row 1 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -1648,6 +1651,8 @@ my_col 0.12345678912345678912345678912345678912 DROP TABLE t1; CREATE TABLE t1 SELECT 1 / .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS my_col; +Warnings: +Note 1265 Data truncated for column 'my_col' at row 1 DESCRIBE t1; Field Type Null Key Default Extra my_col decimal(65,4) YES NULL diff --git a/mysql-test/main/type_ranges.result b/mysql-test/main/type_ranges.result index 199c8a45c97..784a394d8b5 100644 --- a/mysql-test/main/type_ranges.result +++ b/mysql-test/main/type_ranges.result @@ -91,6 +91,8 @@ DROP INDEX test ON t1; insert into t1 values (10, 1,1,1,1,1,1,1,1,1,1,1,1,1,NULL,0,0,0,1,1,1,1,'one','one'); insert into t1 values (NULL,2,2,2,2,2,2,2,2,2,2,2,2,2,NULL,NULL,NULL,NULL,NULL,NULL,2,2,'two','two,one'); insert ignore into t1 values (0,1/3,3,3,3,3,3,3,3,3,3,3,3,3,NULL,'19970303','10:10:10','19970303101010','','','','3',3,3); +Warnings: +Warning 1265 Data truncated for column 'string' at row 1 insert ignore into t1 values (0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,NULL,19970807,080706,19970403090807,-1,-1,-1,'-1',-1,-1); Warnings: Warning 1264 Out of range value for column 'utiny' at row 1 @@ -128,7 +130,7 @@ select auto,string,tiny,short,medium,long_int,longlong,real_float,real_double,ut auto string tiny short medium long_int longlong real_float real_double utiny ushort umedium ulong ulonglong mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000) date_field time_field date_time blob_col tinyblob_col mediumblob_col longblob_col 10 1 1 1 1 1 1 1.0 1.0000 1 00001 1 1 1 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 1 1 1 11 2 2 2 2 2 2 2.0 2.0000 2 00002 2 2 2 0 NULL NULL NULL NULL NULL 2 2 -12 0.3333 3 3 3 3 3 3.0 3.0000 3 00003 3 3 3 0 1997-03-03 10:10:10 1997-03-03 10:10:10 3 +12 0.33333333 3 3 3 3 3 3.0 3.0000 3 00003 3 3 3 0 1997-03-03 10:10:10 1997-03-03 10:10:10 3 13 -1 -1 -1 -1 -1 -1 -1.0 -1.0000 0 00000 0 0 0 0 1997-08-07 08:07:06 1997-04-03 09:08:07 -1 -1 -1 -1 14 -429496729 -128 -32768 -8388608 -2147483648 -4294967295 -4294967296.0 -4294967295.0000 0 00000 0 0 0 0 0000-00-00 00:00:00 0000-00-00 00:00:00 -4294967295 -4294967295 -4294967295 -4294967295 15 4294967295 127 32767 8388607 2147483647 4294967295 4294967296.0 4294967295.0000 255 65535 16777215 4294967295 4294967295 0 0000-00-00 00:00:00 0000-00-00 00:00:00 4294967295 4294967295 4294967295 4294967295 @@ -180,7 +182,7 @@ Warning 1265 Data truncated for column 'new_field' at row 7 select * from t2; auto string mediumblob_col new_field 1 2 2 ne -2 0.3333 ne +2 0.33333333 ne 3 -1 -1 ne 4 -429496729 -4294967295 ne 5 4294967295 4294967295 ne diff --git a/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result b/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result index 8211fb8501e..2acfe56bede 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result +++ b/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result @@ -9,10 +9,16 @@ UPDATE t1 SET f1 = f1 + 10;; connection node_2; UPDATE t1 SET f1 = f1 + 100;; connection node_1; +SELECT COUNT(*) FROM t1; +COUNT(*) +1 connection node_2; +SELECT COUNT(*) FROM t1; +COUNT(*) +1 connection node_3; -SELECT f1 = 111 FROM t1; -f1 = 111 +SELECT COUNT(*) FROM t1; +COUNT(*) 1 SELECT COUNT(*) IN (1, 2) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%committed%'; COUNT(*) IN (1, 2) diff --git a/mysql-test/suite/galera_3nodes/t/galera_parallel_apply_3nodes.test b/mysql-test/suite/galera_3nodes/t/galera_parallel_apply_3nodes.test index 659df2b3c93..f1168e59193 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_parallel_apply_3nodes.test +++ b/mysql-test/suite/galera_3nodes/t/galera_parallel_apply_3nodes.test @@ -24,13 +24,25 @@ SET GLOBAL wsrep_slave_threads = 2; --send UPDATE t1 SET f1 = f1 + 100; --connection node_1 +# +# Note that test is not deterministic. We have following cases possible +# (1) Both updates are certified locally and then executed by the applier +# (2) Certification of update in node_1 fails because applier has started +# update from node_2 +# (3) Certification of update in node_2 fails because applier has started +# update from node_1 +# +--error 0,ER_LOCK_DEADLOCK --reap +SELECT COUNT(*) FROM t1; --connection node_2 +--error 0,ER_LOCK_DEADLOCK --reap +SELECT COUNT(*) FROM t1; --connection node_3 -SELECT f1 = 111 FROM t1; +SELECT COUNT(*) FROM t1; SELECT COUNT(*) IN (1, 2) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%committed%'; --eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig; diff --git a/mysql-test/suite/maria/create.result b/mysql-test/suite/maria/create.result index 82c6b8c9871..f1da0d7105b 100644 --- a/mysql-test/suite/maria/create.result +++ b/mysql-test/suite/maria/create.result @@ -31,3 +31,47 @@ select * from t2; f1 f2 3 qux DROP TABLE t1, t2; +# +# MDEV-23159 Assertion `table_share->tmp_table != NO_TMP_TABLE || +# m_lock_type != 2' + SIGSEGV in trnman_can_read_from +# (on optimized builds) +# +SET @org_sql_mode=@@SQL_MODE; +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=Aria ROW_FORMAT=COMPRESSED; +INSERT INTO t1 VALUES(1); +CREATE TEMPORARY TABLE t2(b INT); +EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT MAX(a) FROM t2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 1 Using index +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +DROP TABLE t1,t2; +SET SQL_MODE=''; +CREATE TABLE t1 (c INT PRIMARY KEY) ENGINE=Aria; +CREATE TABLE t2 (d INT); +INSERT INTO t1 VALUES (1); +SELECT c FROM t1 WHERE (c) IN (SELECT MIN(c) FROM t2); +c +DROP TABLE t1,t2; +USE test; +SET SQL_MODE='ONLY_FULL_GROUP_BY'; +CREATE TABLE t3 (c1 DECIMAL(1,1) PRIMARY KEY,c2 DATE,c3 NUMERIC(10) UNSIGNED) ENGINE=Aria; +CREATE TABLE t2 (f1 INTEGER ) ENGINE=Aria; +INSERT INTO t3 VALUES (0,0,0); +SELECT c1 FROM t3 WHERE (c1) IN (SELECT MIN(DISTINCT c1) FROM t2); +c1 +DROP TABLE t2,t3; +SET @@SQL_MODE=@org_sql_mode; +# +# MDEV-23222 SIGSEGV in maria_status | Assertion `(longlong) +# thd->status_var.local_memory_used >= 0 +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +CREATE TABLE MDEV_23222 (i INT) DATA DIRECTORY = 'MYSQL_TMP_DIR', ENGINE=Aria TRANSACTIONAL=1;; +flush tables; +CREATE TABLE MDEV_23222 (i INT) DATA DIRECTORY = 'MYSQL_TMP_DIR', ENGINE=Aria TRANSACTIONAL=1;; +Got one of the listed errors +DROP TABLE t1; +# +# End of 10.3 tests +# diff --git a/mysql-test/suite/maria/create.test b/mysql-test/suite/maria/create.test index 8f2ffd7492f..cac1f8bd7e1 100644 --- a/mysql-test/suite/maria/create.test +++ b/mysql-test/suite/maria/create.test @@ -40,3 +40,58 @@ INSERT IGNORE INTO t1 VALUES (1),(2); CREATE OR REPLACE TABLE t2 ENGINE=Aria AS SELECT SUM(a) AS f1, IFNULL( 'qux', ExtractValue( 'foo', 'bar' ) ) AS f2 FROM t1; select * from t2; DROP TABLE t1, t2; + +--echo # +--echo # MDEV-23159 Assertion `table_share->tmp_table != NO_TMP_TABLE || +--echo # m_lock_type != 2' + SIGSEGV in trnman_can_read_from +--echo # (on optimized builds) +--echo # + +SET @org_sql_mode=@@SQL_MODE; +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=Aria ROW_FORMAT=COMPRESSED; +INSERT INTO t1 VALUES(1); +CREATE TEMPORARY TABLE t2(b INT); +EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT MAX(a) FROM t2); +DROP TABLE t1,t2; + +SET SQL_MODE=''; +CREATE TABLE t1 (c INT PRIMARY KEY) ENGINE=Aria; +CREATE TABLE t2 (d INT); +INSERT INTO t1 VALUES (1); +SELECT c FROM t1 WHERE (c) IN (SELECT MIN(c) FROM t2); +DROP TABLE t1,t2; + +USE test; +SET SQL_MODE='ONLY_FULL_GROUP_BY'; +CREATE TABLE t3 (c1 DECIMAL(1,1) PRIMARY KEY,c2 DATE,c3 NUMERIC(10) UNSIGNED) ENGINE=Aria; +CREATE TABLE t2 (f1 INTEGER ) ENGINE=Aria; +INSERT INTO t3 VALUES (0,0,0); +SELECT c1 FROM t3 WHERE (c1) IN (SELECT MIN(DISTINCT c1) FROM t2); +DROP TABLE t2,t3; +SET @@SQL_MODE=@org_sql_mode; + +--echo # +--echo # MDEV-23222 SIGSEGV in maria_status | Assertion `(longlong) +--echo # thd->status_var.local_memory_used >= 0 +--echo # + +let $mysqld_datadir= `select @@datadir`; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +--eval CREATE TABLE MDEV_23222 (i INT) DATA DIRECTORY = '$MYSQL_TMP_DIR', ENGINE=Aria TRANSACTIONAL=1; +flush tables; +--remove_file $mysqld_datadir/test/MDEV_23222.frm +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +--error 1,ER_TABLE_EXISTS_ERROR +--eval CREATE TABLE MDEV_23222 (i INT) DATA DIRECTORY = '$MYSQL_TMP_DIR', ENGINE=Aria TRANSACTIONAL=1; +DROP TABLE t1; +--disable_warnings +--remove_file $mysqld_datadir/test/MDEV_23222.MAD +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +--remove_file $MYSQL_TMP_DIR/MDEV_23222.MAD +--enable_warnings + +--echo # +--echo # End of 10.3 tests +--echo # diff --git a/mysql-test/suite/mariabackup/incremental_ddl_during_backup.result b/mysql-test/suite/mariabackup/incremental_ddl_during_backup.result index 505e834b4d1..33a3b0001a1 100644 --- a/mysql-test/suite/mariabackup/incremental_ddl_during_backup.result +++ b/mysql-test/suite/mariabackup/incremental_ddl_during_backup.result @@ -2,6 +2,7 @@ call mtr.add_suppression("InnoDB: New log files created"); CREATE TABLE t1(i INT PRIMARY KEY) ENGINE INNODB; CREATE TABLE t2(i INT PRIMARY KEY) ENGINE INNODB; CREATE TABLE t3(i INT) ENGINE INNODB; +CREATE TABLE t10(i INT PRIMARY KEY) ENGINE INNODB; # Create full backup , modify table, then create incremental/differential backup INSERT into t1 values(1); # Prepare full backup, apply incremental one diff --git a/mysql-test/suite/mariabackup/incremental_ddl_during_backup.test b/mysql-test/suite/mariabackup/incremental_ddl_during_backup.test index fdae90132cc..b1ab17a6d8f 100644 --- a/mysql-test/suite/mariabackup/incremental_ddl_during_backup.test +++ b/mysql-test/suite/mariabackup/incremental_ddl_during_backup.test @@ -8,6 +8,7 @@ let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1; CREATE TABLE t1(i INT PRIMARY KEY) ENGINE INNODB; CREATE TABLE t2(i INT PRIMARY KEY) ENGINE INNODB; CREATE TABLE t3(i INT) ENGINE INNODB; +CREATE TABLE t10(i INT PRIMARY KEY) ENGINE INNODB; echo # Create full backup , modify table, then create incremental/differential backup; --disable_result_log @@ -20,8 +21,11 @@ INSERT into t1 values(1); --let after_copy_test_t1=RENAME TABLE test.t1 TO test.t1_renamed --let after_copy_test_t2=DROP TABLE test.t2 --let after_copy_test_t3=CREATE INDEX a_i ON test.t3(i); +--let before_copy_test_t10=DROP TABLE test.t10 +--let wait_innodb_redo_before_copy=test/t10 -exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir --dbug=+d,mariabackup_events; +# mariabackup should crash with assertion if MDEV-24026 is not fixed +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir --dbug=+d,mariabackup_events,mariabackup_inject_code; --let after_load_tablespaces= --disable_result_log echo # Prepare full backup, apply incremental one; diff --git a/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test index 9fc8f1320f7..5b08b2cd463 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test +++ b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test @@ -102,8 +102,7 @@ ALTER TABLE t1 ADD PRIMARY KEY (a); ALTER TABLE t2 ADD PRIMARY KEY (a); ALTER TABLE t3 ADD PRIMARY KEY (a); -#--sync_slave_with_master ---connection slave +--sync_slave_with_master RENAME TABLE t3 TO t3_bak; --connection master diff --git a/mysql-test/suite/sys_vars/r/div_precision_increment_func.result b/mysql-test/suite/sys_vars/r/div_precision_increment_func.result index e16ce76fed9..c839dd6b289 100644 --- a/mysql-test/suite/sys_vars/r/div_precision_increment_func.result +++ b/mysql-test/suite/sys_vars/r/div_precision_increment_func.result @@ -51,9 +51,9 @@ INSERT into t1(name, salary, income_tax) values('Record_2', 501, 501*2.5/1000); INSERT into t1(name, salary, income_tax) values('Record_3', 210, 210*2.5/1000); SELECT * from t1; id name salary income_tax -1 Record_1 100011 250.03 -2 Record_2 501 1.25 -3 Record_3 210 0.53 +1 Record_1 100011 250.027 +2 Record_2 501 1.2525 +3 Record_3 210 0.525 connect test_con2, localhost, root,,; connection test_con2; ## Verifying session & global value of variable ## @@ -69,11 +69,11 @@ INSERT into t1(name, salary, income_tax) values('Record_5', 501, 501*2.5/1000); INSERT into t1(name, salary, income_tax) values('Record_6', 210, 210*2.5/1000); SELECT * from t1; id name salary income_tax -1 Record_1 100011 250.03 -2 Record_2 501 1.25 -3 Record_3 210 0.53 -4 Record_4 100011 250.028 -5 Record_5 501 1.253 +1 Record_1 100011 250.027 +2 Record_2 501 1.2525 +3 Record_3 210 0.525 +4 Record_4 100011 250.027 +5 Record_5 501 1.2525 6 Record_6 210 0.525 ## Dropping table t1 ## drop table t1; diff --git a/mysql-test/suite/sys_vars/r/replicate_do_db_basic.result b/mysql-test/suite/sys_vars/r/replicate_do_db_basic.result index a05b85a9bfd..54adf835962 100644 --- a/mysql-test/suite/sys_vars/r/replicate_do_db_basic.result +++ b/mysql-test/suite/sys_vars/r/replicate_do_db_basic.result @@ -37,5 +37,9 @@ SET @@GLOBAL.replicate_do_db=null; SELECT @@GLOBAL.replicate_do_db; @@GLOBAL.replicate_do_db +SET @@GLOBAL.replicate_do_db=DEFAULT; +SELECT @@GLOBAL.replicate_do_db; +@@GLOBAL.replicate_do_db + # Cleanup. SET @@GLOBAL.replicate_do_db = @save_replicate_do_db; diff --git a/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result b/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result index ec3b39124fe..249d745482a 100644 --- a/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result +++ b/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result @@ -1,6 +1,6 @@ include/master-slave.inc [connection master] -connection slave; +include/sync_slave_sql_with_master.inc SET @start_max_connections= @@global.max_connections; SET @start_init_slave= @@global.init_slave; SET NAMES utf8; @@ -19,18 +19,12 @@ SELECT @@global.init_slave = 'SET @@global.max_connections = @@global.max_connec 1 Expect 1 include/assert.inc [@@global.max_connections = @start_max_connections] -STOP SLAVE; -RESET MASTER; -RESET SLAVE; -START SLAVE; -include/wait_for_slave_to_start.inc +include/restart_slave.inc +connection master; +include/sync_slave_sql_with_master.inc include/assert.inc [@@global.max_connections = @start_max_connections + 1] SET @@global.init_slave = "SET @a=5"; -STOP SLAVE; -RESET MASTER; -RESET SLAVE; -START SLAVE; -include/wait_for_slave_to_start.inc +include/restart_slave.inc SHOW VARIABLES LIKE 'init_slave'; Variable_name Value init_slave SET @a=5 diff --git a/mysql-test/suite/sys_vars/t/replicate_do_db_basic.test b/mysql-test/suite/sys_vars/t/replicate_do_db_basic.test index 59d0176add2..b7004d1938b 100644 --- a/mysql-test/suite/sys_vars/t/replicate_do_db_basic.test +++ b/mysql-test/suite/sys_vars/t/replicate_do_db_basic.test @@ -38,5 +38,8 @@ SELECT @@GLOBAL.replicate_do_db; SET @@GLOBAL.replicate_do_db=null; SELECT @@GLOBAL.replicate_do_db; +SET @@GLOBAL.replicate_do_db=DEFAULT; +SELECT @@GLOBAL.replicate_do_db; + --echo # Cleanup. SET @@GLOBAL.replicate_do_db = @save_replicate_do_db; diff --git a/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test index f8cbc54fc70..0e5ff7a3f39 100644 --- a/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test +++ b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test @@ -29,7 +29,13 @@ ############################################################################### source include/master-slave.inc; -connection slave; + +# Since a part of slave SQL thread initialisation happens after Slave_SQL_Running +# has been set to Yes, there is a race condition between initialisation above and +# init_slave setting given below. Synchronise slave applier with master to ensure +# init_slave is complete and applier had processed few events like FD. +--source include/sync_slave_sql_with_master.inc + --disable_query_log call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); --enable_query_log @@ -66,14 +72,15 @@ let $wait_condition= SELECT @@global.max_connections = @start_max_connections; --let $assert_text= @@global.max_connections = @start_max_connections --let $assert_cond= @@global.max_connections = @start_max_connections --source include/assert.inc -# -# reset of the server -STOP SLAVE; ---wait_for_slave_to_stop -RESET MASTER; -RESET SLAVE; -START SLAVE; -source include/wait_for_slave_to_start.inc; + +--source include/restart_slave_sql.inc + +# Upon slave start, sync the applier with master, to ensure slave has +# completed init_slave command execution and processed FD event from the +# master. +--connection master +--source include/sync_slave_sql_with_master.inc + # # wait for the slave threads have set the global variable. let $wait_timeout= 90; @@ -87,12 +94,7 @@ let $wait_condition= SELECT @@global.max_connections = @start_max_connections + # Setting a variable(which is local to a session) and must not be visible SET @@global.init_slave = "SET @a=5"; # -STOP SLAVE; ---wait_for_slave_to_stop -RESET MASTER; -RESET SLAVE; -START SLAVE; -source include/wait_for_slave_to_start.inc; +--source include/restart_slave_sql.inc # SHOW VARIABLES LIKE 'init_slave'; # expect NULL diff --git a/mysql-test/suite/vcol/r/not_supported.result b/mysql-test/suite/vcol/r/not_supported.result index c524234e7e5..c804cf220d2 100644 --- a/mysql-test/suite/vcol/r/not_supported.result +++ b/mysql-test/suite/vcol/r/not_supported.result @@ -29,7 +29,7 @@ set time_zone='+1:00'; flush tables; select * from t1; a b v -1 2 0.3333000000000000000 +1 2 0.3333333330000000000 select * from t8; a b v 1234567890 2 2009-02-14 00:31:30 diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests index 1ddbc8d5278..30171bfe084 100644 --- a/mysql-test/unstable-tests +++ b/mysql-test/unstable-tests @@ -23,228 +23,182 @@ # ############################################################################## # -# Based on bb-10.4-release 9a156e1a23046ba3e37bdb1e4e1ad887d3f5829b -# Tue Aug 4 11:49:52 2020 +0300 : MDEV-23345 Assertion not_redundant ... - -main.alter_table : Modified in 10.4.14 -main.alter_table_trans : MDEV-12084 - timeout -main.alter_user : Modified in 10.4.13 -main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result -main.auth_named_pipe : MDEV-14724 - System error 2 -main.backup_interaction : Modified in 10.4.13 -main.backup_stages : MDEV-23401 - Bad file descriptor; modified in 10.4.14 -main.binary_to_hex : MDEV-20211 - Wrong result -main.column_compression : Modified in 10.4.13 -main.comment_table : Modified in 10.4.14 -main.connect : MDEV-17282 - Wrong result -main.connect-abstract : MDEV-20162 - Could not execute 'check-testcase' -main.connect2 : MDEV-13885 - Server crash -main.count_distinct2 : MDEV-11768 - timeout -main.create : Modified in 10.4.14 -main.create_delayed : MDEV-10605 - failed with timeout -main.create_drop_event : MDEV-16271 - Wrong result -main.create_drop_function : Modified in 10.4.14 -main.cte_nonrecursive : Modified in 10.4.13 -main.cte_recursive : Modified in 10.4.14 -main.ctype_binary : Modified in 10.4.14 -main.ctype_cp932_binlog_stm : MDEV-20534 - Wrong result -main.ctype_ucs : MDEV-17681 - Data too long for column -main.ctype_upgrade : MDEV-16945 - Error upon mysql_upgrade -main.ctype_utf16 : MDEV-10675: timeout or extra warnings; modified in 10.4.14 -main.ctype_utf16_uca : Modified in 10.4.14 -main.ctype_utf16le : MDEV-10675: timeout or extra warnings; modified in 10.4.14 -main.ctype_utf32 : Modified in 10.4.14 -main.ctype_utf32_uca : Modified in 10.4.14 -main.ctype_utf8 : Modified in 10.4.14 -main.ctype_utf8mb4 : Modified in 10.4.14 -main.ctype_utf8mb4_heap : Include file modified in 10.4.14 -main.ctype_utf8mb4_innodb : MDEV-17744 - Timeout; MDEV-18567 - ASAN use-after-poison; include file modified in 10.4.14 -main.ctype_utf8mb4_myisam : Include file modified in 10.4.14 -main.custom_aggregate_functions : Modified in 10.4.14 -main.debug_sync : MDEV-10607 - internal error -main.default_storage_engine : Modified in 10.4.13 -main.delayed : MDEV-20961 - Assertion failure -main.derived_cond_pushdown : MDEV-20532 - Floating point differences; modified in 10.4.13 -main.derived_opt : MDEV-11768 - timeout -main.dirty_close : MDEV-19368 - mysqltest failed but provided no output -main.distinct : MDEV-14194 - Crash -main.drop_bad_db_type : MDEV-15676 - Wrong result -main.dyncol : MDEV-19455 - Extra warning -main.errors : Modified in 10.4.13 -main.events_2 : MDEV-13277 - Crash -main.events_bugs : MDEV-12892 - Crash -main.events_restart : MDEV-12236 - Server shutdown problem; modified in 10.4.13 -main.events_slowlog : MDEV-12821 - Wrong result -main.failed_auth_3909 : Modified in 10.4.13 -main.failed_auth_unixsocket : Modified in 10.4.13 -main.flush : MDEV-19368 - mysqltest failed but provided no output -main.flush_ssl : MDEV-21276 - Aria recovery failure -main.fulltext : Modified in 10.4.13 -main.func_gconcat : MDEV-21379 - Valgrind warnings; modified in 10.4.14 -main.func_json : Modified in 10.4.14 -main.func_math : MDEV-20966 - Wrong error code; modified in 10.4.14 -main.func_str : Modified in 10.4.13 -main.gis : MDEV-13411 - wrong result on P8; modified in 10.4.13 -main.gis-rtree : Modified in 10.4.13 -main.gis_notembedded : MDEV-21264 - Wrong result with non-default charset -main.grant : Modified in 10.4.14 -main.grant2 : Modified in 10.4.13 -main.grant5 : Modified in 10.4.14 -main.grant_repair : Added in 10.4.13 -main.group_by : Modified in 10.4.13 -main.host_cache_size_functionality : MDEV-10606 - sporadic failure on shutdown -main.index_intersect_innodb : MDEV-10643 - failed with timeout -main.index_merge_innodb : MDEV-7142 - Plan mismatch; modified in 10.4.14 -main.index_merge_myisam : Modified in 10.4.13 -main.information_schema : Modified in 10.4.14 -main.innodb_icp : MDEV-20168 - Wrong execution plans; include file modified in 10.4.13 -main.innodb_mrr_cpk : MDEV-23370 - Server crash -main.innodb_mysql_lock : Modified in 10.4.13 -main.invisible_field_grant_completely : MDEV-22254 - Syscall param write points to uninitialised bytes -main.ipv4_and_ipv6 : MDEV-20964 - Wrong result -main.ipv6 : MDEV-20964 - Wrong result -main.join_cache : MDEV-17743 - Bad address from storage engine MyISAM; modified in 10.4.13 -main.join_outer : Modified in 10.4.14 -main.key : Modified in 10.4.13 -main.kill-2 : MDEV-13257 - Wrong result -main.kill_processlist-6619 : MDEV-10793 - Wrong result -main.loaddata : MDEV-19368 - mysqltest failed but provided no output -main.locale : MDEV-20521 - Missing warning; configuration added in 10.4.13 -main.lock : Modified in 10.4.14 -main.lock_user : Modified in 10.4.13 -main.log_slow : MDEV-13263 - Wrong result -main.log_tables : Modified in 10.4.14 -main.log_tables-big : MDEV-13408 - wrong result -main.log_tables_upgrade : MDEV-20962 - Wrong result -main.long_unique_bugs : Modified in 10.4.14 -main.lowercase_fs_off : Modified in 10.4.14 -main.mdev-21101 : Added in 10.4.14 -main.mdev-504 : MDEV-15171 - warning -main.mdev375 : MDEV-10607 - sporadic "can't connect"; modified in 10.4.13 -main.mdev_22370 : Added in 10.4.14 -main.merge : MDEV-10607 - sporadic "can't connect" -main.multi_update : Modified in 10.4.13 -main.multi_update_debug : Modified in 10.4.13 -main.myisam_icp : Include file modified in 10.4.13 -main.mysql : MDEV-20156 - Wrong result -main.mysql_client_test : MDEV-19369 - error: 5888, status: 23, errno: 2; MDEV-19511 - Big endian issue; modified in 10.4.13 -main.mysql_client_test_comp : MDEV-16641 - Error in exec -main.mysql_client_test_nonblock : CONC-208 - Error on Power; MDEV-15096 - exec failed -main.mysql_cp932 : MDEV-21275 - Wrong result -main.mysql_install_db_win : Modified in 10.4.14 -main.mysql_upgrade : MDEV-20161 - Wrong result; MDEV-20166 - FATAL ERROR: Upgrade failed; modified in 10.4.14 -main.mysql_upgrade-6984 : MDEV-22514 - Wrong result; modified in 10.4.13 -main.mysql_upgrade_no_innodb : MDEV-20537 - Wrong result -main.mysql_upgrade_noengine : MDEV-14355 - Wrong result -main.mysql_upgrade_view : MDEV-20161 - Wrong result; MDEV-23392 - Wrong result -main.mysqladmin : MDEV-20535 - Wrong result -main.mysqlcheck : MDEV-20164 - Wrong result -main.mysqld--defaults-file : Modified in 10.4.13 -main.mysqld_option_err : MDEV-21236 - Wrong error; MDEV-21571 - Crash on bootstrap -main.mysqldump : MDEV-14800 - Stack smashing detected; modified in 10.4.13 -main.mysqldump-max : MDEV-21272 - Wrong result -main.mysqlhotcopy_myisam : MDEV-10995 - Hang on debug -main.mysqlshow : MDEV-20965 - Wrong result -main.mysqlslap : MDEV-11801 - timeout -main.mysqltest : MDEV-13887 - Wrong result -main.mysqltest_tracking_info : Modified in 10.4.14 -main.nested_profiling : Added in 10.4.14 -main.old-mode : MDEV-19373 - Wrong result -main.openssl_6975 : MDEV-17184 - Failures with OpenSSL 1.1.1 -main.opt_trace : Modified in 10.4.14 -main.order_by : Modified in 10.4.14 -main.order_by_optimizer_innodb : MDEV-10683 - Wrong result -main.parser : Modified in 10.4.14 -main.partition : Modified in 10.4.14 -main.partition_alter : Modified in 10.4.14 -main.partition_debug_sync : MDEV-15669 - Deadlock found when trying to get lock -main.partition_explicit_prune : Modified in 10.4.14 -main.partition_innodb : MDEV-20169 - Wrong result; modified in 10.4.13 -main.partition_innodb_plugin : MDEV-12901 - Valgrind warnings -main.partition_innodb_semi_consistent : MDEV-19411 - Failed to start mysqld.1 -main.partition_mrr_aria : Include file modified in 10.4.13 -main.partition_mrr_innodb : Include file modified in 10.4.13 -main.partition_mrr_myisam : Modified in 10.4.13 -main.partition_range : Modified in 10.4.13 -main.plugin : Modified in 10.4.14 -main.plugin_auth : MDEV-20957 - Upgrade file was not properly created -main.plugin_auth_qa_2 : MDEV-20165 - Wrong result -main.pool_of_threads : MDEV-18135 - SSL error: key too small -main.processlist_notembedded : Modified in 10.4.14 -main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count; modified in 10.4.14 -main.ps_grant : Modified in 10.4.13 -main.query_cache : MDEV-16180 - Wrong result; modified in 10.4.14 -main.query_cache_debug : MDEV-15281 - Query cache is disabled -main.range : Modified in 10.4.13 -main.range_innodb : MDEV-23371 - Server crash; modified in 10.4.13 -main.range_vs_index_merge : Modified in 10.4.13 -main.range_vs_index_merge_innodb : MDEV-15283 - Server has gone away -main.repair : Modified in 10.4.14 -main.rowid_filter : Modified in 10.4.13 -main.rowid_filter_innodb : MDEV-20538 - Wrong result; modified in 10.4.13 -main.rowid_filter_myisam : Added in 10.4.14 -main.rpl_mysql_upgrade_slave_repo_check : Added in 10.4.13 -main.rowid_filter_innodb_debug : MDEV-22761 - Added in 10.4.15 -main.select : MDEV-20532 - Floating point differences -main.select_jcl6 : MDEV-20532 - Floating point differences -main.select_pkeycache : MDEV-20532 - Floating point differences -main.selectivity : Modified in 10.4.14 -main.set_statement : MDEV-13183 - Wrong result -main.set_statement_notembedded : MDEV-19414 - Wrong result -main.shm : MDEV-12727 - Mismatch, ERROR 2013 -main.show_explain : MDEV-10674 - Wrong result code -main.signal : Modified in 10.4.14 -main.sp : MDEV-7866 - Mismatch; modified in 10.4.14 -main.sp-big : Modified in 10.4.14 -main.sp-error : Modified in 10.4.14 -main.sp-security : MDEV-10607 - sporadic "can't connect" -main.sp2 : Added in 10.4.14 -main.sp_notembedded : MDEV-10607 - internal error -main.ssl : MDEV-17184 - Failures with OpenSSL 1.1.1 -main.ssl_7937 : MDEV-20958 - Wrong result -main.ssl_ca : MDEV-10895 - SSL connection error on Power -main.ssl_cipher : MDEV-17184 - Failures with OpenSSL 1.1.1 -main.ssl_timeout : MDEV-11244 - Crash -main.stat_tables_innodb : Modified in 10.4.14 -main.stat_tables_par_innodb : MDEV-14155 - Wrong rounding -main.stat_tables_partition : Modified in 10.4.14 -main.status : MDEV-13255 - Wrong result -main.subselect : MDEV-20551 - Valgrind failure -main.subselect4 : Modified in 10.4.14 -main.subselect_exists2in : Modified in 10.4.14 -main.subselect_innodb : MDEV-10614 - Wrong result -main.subselect_sj2_mat : Modified in 10.4.13 -main.table_value_constr : Modified in 10.4.14 -main.tc_heuristic_recover : MDEV-14189 - Wrong result -main.temp_table : Modified in 10.4.14 -main.type_bit : Modified in 10.4.14 -main.type_blob : MDEV-15195 - Wrong result; modified in 10.4.13 -main.type_date : Modified in 10.4.14 -main.type_datetime : Modified in 10.4.14 -main.type_datetime_hires : MDEV-10687 - Timeout; modified in 10.4.14 -main.type_enum : Modified in 10.4.14 -main.type_float : MDEV-20532 - Floating point differences; modified in 10.4.14 -main.type_hex_hybrid : Modified in 10.4.14 -main.type_int : Modified in 10.4.14 -main.type_newdecimal : MDEV-20532 - Floating point differences -main.type_ranges : MDEV-20532 - Floating point differences -main.type_set : Modified in 10.4.14 -main.type_temporal_innodb : Modified in 10.4.14 -main.type_time : Modified in 10.4.14 -main.type_time_hires : Modified in 10.4.14 -main.type_timestamp : Modified in 10.4.14 -main.type_timestamp_hires : Modified in 10.4.14 -main.type_year : Modified in 10.4.14 -main.udf : Modified in 10.4.14 -main.union : Modified in 10.4.14 -main.upgrade_MDEV-19650 : Modified in 10.4.14 -main.upgrade_MDEV-23102-1 : Added in 10.4.14 -main.upgrade_MDEV-23102-2 : Added in 10.4.14 -main.userstat : MDEV-12904 - SSL errors -main.wait_timeout : MDEV-19023 - Lost connection to MySQL server during query -main.win : Modified in 10.4.14 -main.win_ntile : Modified in 10.4.14 -main.xa : MDEV-11769 - lock wait timeout; modified in 10.4.14 +# Based on bb-10.4-release 80c951ce2875aac521b82323b5b6ebf638593445 +# Sat Oct 31 21:06:49 2020 +0100 : Merge branch '10.3' into 10.4 + +main.alter_table : Modified in 10.4.16 +main.alter_table_trans : MDEV-12084 - timeout +main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result +main.aria_icp_debug : Added in 10.4.16 +main.auth_named_pipe : MDEV-14724 - System error 2 +main.backup_locks : Modified in 10.4.16 +main.backup_stages : MDEV-23401 - Bad file descriptor +main.binary_to_hex : MDEV-20211 - Wrong result +main.blackhole : Modified in 10.4.16 +main.bootstrap_innodb : Added in 10.4.16 +main.connect : MDEV-17282 - Wrong result +main.connect-abstract : MDEV-20162 - Could not execute 'check-testcase' +main.connect2 : MDEV-13885 - Server crash +main.count_distinct2 : MDEV-11768 - timeout +main.create_delayed : MDEV-10605 - failed with timeout +main.create_drop_event : MDEV-16271 - Wrong result +main.ctype_binary : MDEV-24080 - Data too long for column; include file modified in 10.4.16 +main.ctype_cp1251 : Include file modified in 10.4.16 +main.ctype_cp932_binlog_stm : MDEV-20534 - Wrong result +main.ctype_filename : Modified in 10.4.16 +main.ctype_latin1 : Include file modified in 10.4.16 +main.ctype_ucs : MDEV-17681 - Data too long for column; include file modified in 10.4.16 +main.ctype_upgrade : MDEV-16945 - Error upon mysql_upgrade +main.ctype_utf16 : MDEV-10675: timeout or extra warnings +main.ctype_utf16le : MDEV-10675: timeout or extra warnings +main.ctype_utf8 : Modified in 10.4.16 +main.ctype_utf8mb4_innodb : MDEV-17744 - Timeout; MDEV-18567 - ASAN use-after-poison +main.debug_sync : MDEV-10607 - internal error +main.delayed : MDEV-20961 - Assertion failure +main.derived_cond_pushdown : MDEV-20532 - Floating point differences +main.derived_opt : MDEV-11768 - timeout +main.dirty_close : MDEV-19368 - mysqltest failed but provided no output +main.distinct : MDEV-14194 - Crash +main.drop_bad_db_type : MDEV-15676 - Wrong result +main.dyncol : MDEV-19455 - Extra warning +main.empty_server_name-8224 : Modified in 10.4.16 +main.errors : Modified in 10.4.16 +main.events_2 : MDEV-13277 - Crash +main.events_bugs : MDEV-12892 - Crash +main.events_restart : MDEV-12236 - Server shutdown problem +main.events_slowlog : MDEV-12821 - Wrong result +main.fast_prefix_index_fetch_innodb : Modified in 10.4.16 +main.flush : MDEV-19368 - mysqltest failed but provided no output +main.flush_ssl : MDEV-21276 - Aria recovery failure +main.func_gconcat : MDEV-21379 - Valgrind warnings +main.func_json : Modified in 10.4.16 +main.func_math : MDEV-20966 - Wrong error code; modified in 10.4.16 +main.func_test : Modified in 10.4.16 +main.gis : MDEV-13411 - wrong result on P8 +main.gis_notembedded : MDEV-21264 - Wrong result with non-default charset +main.grant : Modified in 10.4.16 +main.grant5 : Modified in 10.4.16 +main.host_cache_size_functionality : MDEV-10606 - sporadic failure on shutdown +main.implicit_commit : Modified in 10.4.16 +main.index_intersect_innodb : MDEV-10643 - failed with timeout +main.index_merge_innodb : MDEV-7142 - Plan mismatch +main.information_schema : Modified in 10.4.16 +main.innodb_ext_key : Modified in 10.4.16 +main.innodb_icp : MDEV-20168 - Wrong execution plans +main.innodb_icp_debug : Added in 10.4.16 +main.invisible_field : Modified in 10.4.16 +main.invisible_field_grant_completely : MDEV-22254 - Syscall param write points to uninitialised bytes +main.ipv4_and_ipv6 : MDEV-20964 - Wrong result +main.ipv6 : MDEV-20964 - Wrong result +main.join_cache : MDEV-17743 - Bad address from storage engine MyISAM +main.kill : Modified in 10.4.16 +main.kill-2 : MDEV-13257 - Wrong result +main.kill_processlist-6619 : MDEV-10793 - Wrong result +main.limit_rows_examined : Modified in 10.4.16 +main.loaddata : MDEV-19368 - mysqltest failed but provided no output +main.locale : MDEV-20521 - Missing warning +main.lock_view : Added in 10.4.16 +main.log_slow : MDEV-13263 - Wrong result +main.log_tables : Modified in 10.4.16 +main.log_tables-big : MDEV-13408 - wrong result +main.log_tables_upgrade : MDEV-20962 - Wrong result +main.mdev-504 : MDEV-15171 - warning +main.mdev375 : MDEV-10607 - sporadic "can't connect" +main.merge : MDEV-10607 - sporadic "can't connect" +main.multi_update_big : Modified in 10.4.16 +main.myisam_icp_debug : Added in 10.4.16 +main.myisam_repair : Added in 10.4.16 +main.mysql : MDEV-20156 - Wrong result +main.mysql_client_test : MDEV-19369 - error: 5888, status: 23, errno: 2; MDEV-19511 - Big endian issue +main.mysql_client_test_comp : MDEV-16641 - Error in exec +main.mysql_client_test_nonblock : CONC-208 - Error on Power; MDEV-15096 - exec failed +main.mysql_cp932 : MDEV-21275 - Wrong result +main.mysql_upgrade : MDEV-20161 - Wrong result; MDEV-20166 - FATAL ERROR: Upgrade failed; modified in 10.4.16 +main.mysql_upgrade-6984 : MDEV-22514 - Wrong result +main.mysql_upgrade_no_innodb : MDEV-20537 - Wrong result +main.mysql_upgrade_noengine : MDEV-14355 - Wrong result +main.mysql_upgrade_view : MDEV-20161 - Wrong result; MDEV-23392 - Wrong result +main.mysqladmin : MDEV-20535 - Wrong result +main.mysqlbinlog_row_minimal : Modified in 10.4.16 +main.mysqlcheck : MDEV-20164 - Wrong result +main.mysqld--help : Modified in 10.4.16 +main.mysqld_option_err : MDEV-21236 - Wrong error; MDEV-21571 - Crash on bootstrap +main.mysqldump : MDEV-14800 - Stack smashing detected; modified in 10.4.16 +main.mysqldump-max : MDEV-21272 - Wrong result +main.mysqlhotcopy_myisam : MDEV-10995 - Hang on debug +main.mysqlshow : MDEV-20965 - Wrong result +main.mysqlslap : MDEV-11801 - timeout +main.mysqltest : MDEV-13887 - Wrong result +main.named_pipe : Modified in 10.4.16 +main.old-mode : MDEV-19373 - Wrong result +main.openssl_6975 : MDEV-17184 - Failures with OpenSSL 1.1.1 +main.order_by : Modified in 10.4.16 +main.order_by_optimizer_innodb : MDEV-10683 - Wrong result +main.parser : Modified in 10.4.16 +main.partition : Modified in 10.4.16 +main.partition_debug_sync : MDEV-15669 - Deadlock found when trying to get lock +main.partition_innodb : MDEV-20169 - Wrong result; MDEV-23427 - Server crash +main.partition_innodb_plugin : MDEV-12901 - Valgrind warnings +main.partition_innodb_semi_consistent : MDEV-19411 - Failed to start mysqld.1 +main.plugin_auth : MDEV-20957 - Upgrade file was not properly created +main.plugin_auth_qa_2 : MDEV-20165 - Wrong result +main.plugin_innodb : Modified in 10.4.16 +main.pool_of_threads : MDEV-18135 - SSL error: key too small; modified in 10.4.16 +main.precedence : Added in 10.4.16 +main.precedence_bugs : Added in 10.4.16 +main.processlist_notembedded : Modified in 10.4.16 +main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count +main.ps_error : MDEV-24079 - Memory not freed +main.query_cache : MDEV-16180 - Wrong result +main.query_cache_debug : MDEV-15281 - Query cache is disabled +main.range : Modified in 10.4.16 +main.range_innodb : MDEV-23371 - Server crash +main.range_vs_index_merge_innodb : MDEV-15283 - Server has gone away +main.rowid_filter : Modified in 10.4.16 +main.rowid_filter_innodb : MDEV-20538 - Wrong result +main.rowid_filter_innodb_debug : Added in 10.4.16 +main.rowid_filter_myisam_debug : Added in 10.4.16 +main.select : MDEV-20532 - Floating point differences +main.select_jcl6 : MDEV-20532 - Floating point differences +main.select_pkeycache : MDEV-20532 - Floating point differences +main.set_statement : MDEV-13183 - Wrong result +main.set_statement_notembedded : MDEV-19414 - Wrong result; modified in 10.4.16 +main.shm : MDEV-12727 - Mismatch, ERROR 2013 +main.show_explain : MDEV-10674 - Wrong result code +main.sp : MDEV-7866 - Mismatch; modified in 10.4.16 +main.sp-destruct : Modified in 10.4.16 +main.sp-security : MDEV-10607 - sporadic "can't connect" +main.sp_notembedded : MDEV-10607 - internal error +main.ssl : MDEV-17184 - Failures with OpenSSL 1.1.1 +main.ssl_7937 : MDEV-20958 - Wrong result +main.ssl_ca : MDEV-10895 - SSL connection error on Power +main.ssl_cipher : MDEV-17184 - Failures with OpenSSL 1.1.1 +main.ssl_timeout : MDEV-11244 - Crash +main.stat_tables_par_innodb : MDEV-14155 - Wrong rounding +main.status : MDEV-13255 - Wrong result +main.subselect : MDEV-20551 - Valgrind failure +main.subselect4 : Modified in 10.4.16 +main.subselect_innodb : MDEV-10614 - Wrong result; modified in 10.4.16 +main.sum_distinct-big : Modified in 10.4.16 +main.tc_heuristic_recover : MDEV-14189 - Wrong result +main.temp_table_symlink : MDEV-24058 - Wrong error code; added in 10.4.16 +main.type_blob : MDEV-15195 - Wrong result; modified in 10.4.16 +main.type_date : Modified in 10.4.16 +main.type_datetime : Modified in 10.4.16 +main.type_datetime_hires : MDEV-10687 - Timeout +main.type_float : MDEV-20532 - Floating point differences; modified in 10.4.16 +main.type_newdecimal : MDEV-20532 - Floating point differences; modified in 10.4.16 +main.type_ranges : MDEV-20532 - Floating point differences +main.type_temporal_innodb : MDEV-24025 - Wrong result +main.type_time : Modified in 10.4.16 +main.udf : Modified in 10.4.16 +main.upgrade_MDEV-19650 : Re-enabled in 10.4.16 +main.userstat : MDEV-12904 - SSL errors +main.view : Modified in 10.4.16 +main.wait_timeout : MDEV-19023 - Lost connection to MySQL server during query +main.win : Modified in 10.4.16 +main.windows_debug : Added in 10.4.16 +main.xa : MDEV-11769 - lock wait timeout #----------------------------------------------------------------------- @@ -260,37 +214,37 @@ archive-test_sql_discovery.discover : MDEV-16817 - Table marked as crashed #----------------------------------------------------------------------- -binlog.binlog_commit_wait : MDEV-10150 - Mismatch -binlog.binlog_innodb : MDEV-22516 - Wrong result -binlog.binlog_invalid_read_in_rotate : MDEV-22455 - Server crash -binlog.binlog_ioerr : MDEV-20159 - Assertion failure -binlog.binlog_killed : MDEV-12925 - Wrong result -binlog.binlog_max_extension : MDEV-19762 - Crash on shutdown -binlog.binlog_mysqlbinlog_row_frag : Modified in 10.4.14 -binlog.binlog_mysqlbinlog_row_innodb : MDEV-20530 - Binary files differ -binlog.binlog_mysqlbinlog_row_myisam : MDEV-20530 - Binary files differ -binlog.binlog_no_uniqfile_crash : Added in 10.4.14 -binlog.binlog_parallel_replication_marks_row : Include file modified in 10.4.14 -binlog.binlog_parallel_replication_marks_stm_mix : Include file modified in 10.4.14 -binlog.binlog_row_binlog : MDEV-23402 - Wrong result -binlog.binlog_show_binlog_event_random_pos : MDEV-22473 - Server crash -binlog.binlog_stm_binlog : MDEV-20412 - Wrong result -binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint -binlog.flashback-largebinlog : MDEV-19764 - Out of memory -binlog.load_data_stm_view : MDEV-16948 - Wrong result -binlog.show_concurrent_rotate : MDEV-20215 - Wrong result +binlog.binlog_commit_wait : MDEV-10150 - Mismatch +binlog.binlog_innodb : MDEV-22516 - Wrong result +binlog.binlog_ioerr : MDEV-20159 - Assertion failure +binlog.binlog_killed : MDEV-12925 - Wrong result +binlog.binlog_max_extension : MDEV-19762 - Crash on shutdown +binlog.binlog_mysqlbinlog_row : Modified in 10.4.16 +binlog.binlog_mysqlbinlog_row_frag : Modified in 10.4.16 +binlog.binlog_mysqlbinlog_row_innodb : MDEV-20530 - Binary files differ +binlog.binlog_mysqlbinlog_row_myisam : MDEV-20530 - Binary files differ +binlog.binlog_no_uniqfile_crash : MDEV-24078 - Server crash upon shutdown +binlog.binlog_recover_checksum_error : Added in 10.4.16 +binlog.binlog_row_binlog : MDEV-23402 - Wrong result +binlog.binlog_show_binlog_event_random_pos : Modified in 10.4.16 +binlog.binlog_stm_binlog : MDEV-20412 - Wrong result +binlog.binlog_stm_mix_innodb_myisam : MDEV-24057 - Wrong result +binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint +binlog.flashback-largebinlog : MDEV-19764 - Out of memory +binlog.load_data_stm_view : MDEV-16948 - Wrong result +binlog.show_concurrent_rotate : MDEV-20215 - Wrong result #----------------------------------------------------------------------- binlog_encryption.binlog_xa_recover : MDEV-12908 - Extra checkpoint -binlog_encryption.encrypted_master : MDEV-14201 - Extra warnings +binlog_encryption.encrypted_master : MDEV-23637 - Assertion failure; MDEV-14201 - Extra warnings binlog_encryption.encrypted_master_switch_to_unencrypted : MDEV-14190 - Can't init tc log binlog_encryption.encrypted_slave : MDEV-18135 - SSL error: key too small binlog_encryption.encryption_combo : MDEV-14199 - Table is marked as crashed binlog_encryption.multisource : MDEV-21289 - Wrong error code -binlog_encryption.rpl_binlog_errors : MDEV-12742 - Crash; include file modified in 10.4.14 +binlog_encryption.rpl_binlog_errors : MDEV-12742 - Crash binlog_encryption.rpl_checksum : MDEV-16951 - Wrong result -binlog_encryption.rpl_corruption : MDEV-20159 - Assertion failure; MDEV-20953 - Wrong error code; include file modified in 10.4.13 +binlog_encryption.rpl_corruption : MDEV-20159 - Assertion failure; MDEV-20953 - Wrong error code binlog_encryption.rpl_gtid_basic : MDEV-16947 - Server failed to start binlog_encryption.rpl_incident : MDEV-21569 - mutex: LOCK_global_system_variables unlocking binlog_encryption.rpl_loadfile : MDEV-16645 - Timeout in include @@ -308,44 +262,31 @@ binlog_encryption.rpl_typeconv : MDEV-14362 - Lost c #----------------------------------------------------------------------- -compat/maxdb.* : Added to the main set in 10.4.14 -compat/maxdb.rpl_mariadb_timestamp : Added in 10.4.14 -compat/maxdb.type_timestamp : Added in 10.4.14 - -#----------------------------------------------------------------------- - -compat/oracle.binlog_ptr_mysqlbinlog : Added in 10.4.14 -compat/oracle.parser : Modified in 10.4.14 -compat/oracle.rpl_mariadb_date : Added in 10.4.14 -compat/oracle.sp : Modified in 10.4.14 -compat/oracle.sp-cursor-rowtype : Modified in 10.4.14 -compat/oracle.type_date : Modified in 10.4.14 +compat/oracle.parser : Modified in 10.4.16 +compat/oracle.sp-package : Modified in 10.4.16 #----------------------------------------------------------------------- connect.alter : MDEV-18135 - SSL error: key too small connect.drop-open-error : MDEV-18135 - SSL error: key too small connect.json : MDEV-18135 - SSL error: key too small -connect.mysql_index : Modified in 10.4.13 connect.part_file : MDEV-18135 - SSL error: key too small connect.part_table : MDEV-18135 - SSL error: key too small connect.pivot : MDEV-14803 - Failed to discover table connect.secure_file_priv : MDEV-18135 - SSL error: key too small +connect.updelx : Modified in 10.4.16 connect.vcol : MDEV-12374 - Fails on Windows connect.zip : MDEV-13884 - Wrong result #----------------------------------------------------------------------- -csv.read_only : Modified in 10.4.14 - -#----------------------------------------------------------------------- - disks.disks_notembedded : MDEV-21587 - Wrong result #----------------------------------------------------------------------- encryption.corrupted_during_recovery : MDEV-20159 - Assertion failure -encryption.create_or_replace : MDEV-16115 - Trying to access tablespace +encryption.create_or_replace : MDEV-24081 - Lock wait timeout exceeded; modified in 10.4.16 +encryption.create_or_replace_big : Added in 10.4.16 encryption.debug_key_management : MDEV-13841 - Timeout encryption.encrypt_and_grep : MDEV-13765 - Wrong result encryption.innochecksum : MDEV-13644 - Assertion failure @@ -357,7 +298,8 @@ encryption.innodb-first-page-read : MDEV-14356 - Timeout in wait encryption.innodb-force-corrupt : MDEV-17286 - SSL error encryption.innodb-missing-key : MDEV-14728 - SSL error encryption.innodb-page_encryption : MDEV-10641 - mutex problem -encryption.innodb-page_encryption_log_encryption : MDEV-17339 - Crash on restart +encryption.innodb-page_encryption_compression : Modified in 10.4.16 +encryption.innodb-page_encryption_log_encryption : MDEV-17339 - Crash on restart; modified in 10.4.16 encryption.innodb-read-only : MDEV-16563 - Crash on startup encryption.innodb-redo-badkey : MDEV-12898 - Server hang on startup encryption.innodb-redo-nokeys : MDEV-20159 - Assertion failure @@ -366,20 +308,20 @@ encryption.innodb-spatial-index : MDEV-13746 - Wrong result encryption.innodb_encrypt_key_rotation_age : MDEV-19763 - Timeout encryption.innodb_encrypt_log : MDEV-13725 - Wrong result encryption.innodb_encrypt_log_corruption : MDEV-14379 - Server crash -encryption.innodb_encrypt_temporary_tables : MDEV-20142 - Wrong result; modified in 10.4.14 +encryption.innodb_encrypt_temporary_tables : MDEV-20142 - Wrong result encryption.innodb_encryption : MDEV-14728 - Unable to get certificate; MDEV-15675 - Timeout encryption.innodb_encryption-page-compression : MDEV-12630 - crash or assertion failure encryption.innodb_encryption_discard_import : MDEV-16116 - Wrong result encryption.innodb_encryption_filekeys : MDEV-15673 - Timeout encryption.innodb_encryption_is : MDEV-12898 - Server hang on startup encryption.innodb_encryption_row_compressed : MDEV-16113 - Crash -encryption.innodb_encryption_tables : MDEV-17339 - Crash on restart; modified in 10.4.14 +encryption.innodb_encryption_tables : MDEV-17339 - Crash on restart encryption.innodb_first_page : MDEV-10689 - Crash encryption.innodb_onlinealter_encryption : MDEV-17287 - SIGABRT on server restart encryption.innodb_scrub : MDEV-8139 - scrubbing tests need fixing (fixed in 10.5+) encryption.innodb_scrub_background : MDEV-8139 - scrubbing tests need fixing (fixed in 10.5+) encryption.innodb_scrub_compressed : MDEV-8139 - scrubbing tests need fixing (fixed in 10.5+) -encryption.tempfiles_encrypted : Added in 10.4.14 +encryption.tempfiles_encrypted : Modified in 10.4.16 #----------------------------------------------------------------------- @@ -402,8 +344,7 @@ federated.federated_innodb : MDEV-10617 - Wrong checksum federated.federated_partition : MDEV-10417 - Fails on Mips federated.federated_transactions : MDEV-10617 - Wrong checksum federated.federatedx : MDEV-10617 - Wrong checksum -federated.federatedx_create_handlers : Modified in 10.4.14 -federated.federatedx_versioning : Modified in 10.4.14 +federated.federatedx_create_handlers : Modified in 10.4.16 #----------------------------------------------------------------------- @@ -430,49 +371,50 @@ galera_3nodes.* : Suite is not stable yet #----------------------------------------------------------------------- -gcol.gcol_bugfixes : Modified in 10.4.14 +gcol.gcol_keys_innodb : Include file modified in 10.4.16 +gcol.gcol_keys_myisam : Include file modified in 10.4.16 +gcol.gcol_partition_innodb : Include file modified in 10.4.16 +gcol.gcol_update : Include file modified in 10.4.16 gcol.innodb_virtual_basic : MDEV-16950 - Failing assertion gcol.innodb_virtual_debug : MDEV-23404 - Server crash -gcol.innodb_virtual_debug_purge : MDEV-16952 - Wrong result; modified in 10.4.14 +gcol.innodb_virtual_debug_purge : Include file modified in 10.4.16 +gcol.innodb_virtual_fk : MDEV-20640 - Assertion failure; modified in 10.4.16 gcol.innodb_virtual_fk_restart : MDEV-17466 - Assertion failure -gcol.innodb_virtual_purge : MDEV-22952 - Lock wait timeout +gcol.innodb_virtual_index : Modified in 10.4.16 +gcol.innodb_virtual_purge : MDEV-22952 - Lock wait timeout; include file modified in 10.4.16 gcol.main_alter_table : MDEV-23403 - Wrong result #----------------------------------------------------------------------- innodb.101_compatibility : MDEV-13891 - Wrong result -innodb.alter_algorithm : Modified in 10.4.13 -innodb.alter_algorithm2 : Added in 10.4.13 innodb.alter_copy : MDEV-16181 - Assertion failure -innodb.alter_crash : MDEV-16944 - The process cannot access the file; modified in 10.4.14 +innodb.alter_crash : MDEV-16944 - The process cannot access the file innodb.alter_large_dml : MDEV-20148 - Debug sync point wait timed out -innodb.alter_missing_tablespace : Modified in 10.4.13 -innodb.alter_primary_key : Added in 10.4.14 -innodb.analyze_table : Modified in 10.4.14 +innodb.alter_table : Modified in 10.4.16 innodb.binlog_consistent : MDEV-10618 - Server fails to start innodb.blob-crash : MDEV-20481 - Crash during recovery -innodb.buf_pool_resize_oom : Added in 10.4.13 -innodb.corrupted_during_recovery : Modified in 10.4.13 innodb.create-index : MDEV-20159 - Assertion failure -innodb.default_row_format_alter : Modified in 10.4.14 innodb.default_row_format_compatibility : MDEV-20159 - Assertion failure innodb.doublewrite : MDEV-12905 - Server crash -innodb.foreign_key : Modified in 10.4.13 -innodb.foreign_key_debug : Added in 10.4.13 +innodb.foreign-keys : Modified in 10.4.16 +innodb.foreign_key : Modified in 10.4.16 innodb.group_commit_crash : MDEV-14191 - InnoDB registration failed +innodb.group_commit_crash_no_optimize_thread : MDEV-11770 - Checksum mismatch innodb.ibuf_not_empty : MDEV-19021 - Wrong result +innodb.innodb : Modified in 10.4.16 innodb.innodb-32k-crash : MDEV-20194 - Extra warnings +innodb.innodb-64k : Modified in 10.4.16 innodb.innodb-64k-crash : MDEV-13872 - Failure and crash on startup -innodb.innodb-alter : Modified in 10.4.14 innodb.innodb-alter-debug : MDEV-13182 - InnoDB: adjusting FSP_SPACE_FLAGS innodb.innodb-alter-table : MDEV-10619 - Testcase timeout -innodb.innodb-alter-timestamp : Modified in 10.4.13 innodb.innodb-bigblob : MDEV-18655 - ASAN unknown crash -innodb.innodb-blob : MDEV-12053 - Client crash; modified in 10.4.13 +innodb.innodb-blob : MDEV-12053 - Client crash innodb.innodb-change-buffer-recovery : MDEV-19115 - Lost connection to MySQL server during query innodb.innodb-dict : MDEV-20159 - Assertion failure innodb.innodb-fk : MDEV-13832 - Assertion failure on shutdown innodb.innodb-get-fk : MDEV-13276 - Server crash +innodb.innodb-index : Include file modified in 10.4.16 +innodb.innodb-index-debug : Include file modified in 10.4.16 innodb.innodb-index-online : MDEV-14809 - Cannot save statistics innodb.innodb-page_compression_default : MDEV-13644 - Assertion failure innodb.innodb-page_compression_lzma : MDEV-14353 - Wrong result @@ -481,23 +423,20 @@ innodb.innodb-page_compression_tables : MDEV-13644 - Assertion failure innodb.innodb-page_compression_zip : MDEV-10641 - mutex problem innodb.innodb-table-online : MDEV-13894 - Wrong result innodb.innodb-timeout : MDEV-20159 - Assertion failure -innodb.innodb-ucs2 : MDEV-23370 - Server crash -innodb.innodb-wl5522 : MDEV-13644 - Assertion failure; modified in 10.4.13 +innodb.innodb-wl5522 : MDEV-13644 - Assertion failure innodb.innodb-wl5522-1 : MDEV-22945 - Server crash -innodb.innodb-wl5522-debug : MDEV-14200 - Wrong errno; modified in 10.4.13 +innodb.innodb-wl5522-debug : MDEV-14200 - Wrong errno innodb.innodb_buffer_pool_dump_pct : MDEV-20139 - Timeout in wait_condition.inc -innodb.innodb_buffer_pool_load_now : Added in 10.4.13 innodb.innodb_buffer_pool_resize : MDEV-16964 - Assertion failure -innodb.innodb_buffer_pool_resize_debug : MDEV-22515 - Timeout in wait_condition; added in 10.4.13 +innodb.innodb_buffer_pool_resize_debug : MDEV-22515 - Timeout in wait_condition innodb.innodb_buffer_pool_resize_with_chunks : MDEV-16964 - Assertion failure innodb.innodb_bug14147491 : MDEV-11808 - Index is corrupt innodb.innodb_bug30423 : MDEV-7311 - Wrong result innodb.innodb_bug47167 : MDEV-20524 - Table 'user' is marked as crashed and should be repaired innodb.innodb_bug48024 : MDEV-14352 - Assertion failure innodb.innodb_bulk_create_index_replication : MDEV-15273 - Slave failed to start -innodb.innodb_defrag_concurrent : Modified in 10.4.13 innodb.innodb_defrag_stats_many_tables : MDEV-14198 - Table is full -innodb.innodb_force_recovery_rollback : MDEV-22889 - Wrong result; added in 10.4.14 +innodb.innodb_force_recovery_rollback : MDEV-22889 - Wrong result innodb.innodb_information_schema : MDEV-8851 - Wrong result innodb.innodb_max_recordsize_32k : MDEV-14801 - Operation failed innodb.innodb_max_recordsize_64k : MDEV-15203 - Wrong result @@ -505,149 +444,124 @@ innodb.innodb_monitor : MDEV-10939 - Testcase timeout innodb.innodb_mysql : MDEV-19873 - Wrong result innodb.innodb_simulate_comp_failures_small : MDEV-20526 - ASAN use-after-poison innodb.innodb_stats : MDEV-10682 - wrong result -innodb.innodb_stats_persistent : MDEV-17745 - Wrong result; MDEV-21567 - Wrong result in execution plan +innodb.innodb_stats_drop_locked : Modified in 10.4.16 +innodb.innodb_stats_persistent : MDEV-21567 - Wrong result in execution plan innodb.innodb_stats_persistent_debug : MDEV-14801 - Operation failed innodb.innodb_sys_semaphore_waits : MDEV-10331 - Semaphore wait -innodb.innodb_sys_var_valgrind : Added in 10.4.13 +innodb.innodb_trx_weight : Configuration deleted in 10.4.16 innodb.innodb_zip_innochecksum2 : MDEV-13882 - Warning: difficult to find free blocks -innodb.instant_alter : Modified in 10.4.13 -innodb.instant_alter_bugs : Modified in 10.4.14 -innodb.instant_alter_charset : Modified in 10.4.14 -innodb.instant_alter_debug : Modified in 10.4.13 -innodb.instant_alter_extend : MDEV-20963 - Binary files differ; modified in 10.4.14 -innodb.instant_alter_index_rename : Modified in 10.4.13 -innodb.instant_alter_limit : Modified in 10.4.14 -innodb.leaf_page_corrupted_during_recovery : Modified in 10.4.14 +innodb.instant_alter_bugs : Modified in 10.4.16 +innodb.instant_alter_crash : Modified in 10.4.16 +innodb.instant_alter_extend : MDEV-20963 - Binary files differ +innodb.instant_alter_index_rename : Modified in 10.4.16 +innodb.instant_alter_purge : Modified in 10.4.16 innodb.log_corruption : MDEV-13251 - Wrong result innodb.log_data_file_size : MDEV-14204 - Server failed to start; MDEV-20648 - Assertion failure innodb.log_file : MDEV-20159 - Assertion failure innodb.log_file_name : MDEV-14193 - Exception -innodb.log_file_name_debug : Modified in 10.4.13 innodb.log_file_size : MDEV-15668 - Not found pattern innodb.monitor : MDEV-16179 - Wrong result -innodb.mvcc : Modified in 10.4.14 innodb.page_id_innochecksum : MDEV-20159 - Assertion failure innodb.purge_secondary : MDEV-15681 - Wrong result innodb.purge_thread_shutdown : MDEV-13792 - Wrong result -innodb.read_only_recover_committed : Modified in 10.4.14 innodb.read_only_recovery : MDEV-13886 - Server crash innodb.recovery_shutdown : MDEV-15671 - Checksum mismatch in datafile -innodb.row_format_redundant : MDEV-15192 - Trying to access missing tablespace +innodb.row_format_redundant : MDEV-15192 - Trying to access missing tablespace; modified in 10.4.16 +innodb.stats_persistent : Added in 10.4.16 innodb.table_definition_cache_debug : MDEV-14206 - Extra warning -innodb.table_flags : MDEV-13572 - Wrong result; MDEV-19374 - Server failed to start +innodb.table_flags : MDEV-13572 - Wrong result; MDEV-19374 - Server failed to start; modified in 10.4.16 +innodb.temp_table_savepoint : MDEV-24077 - Assertion failure innodb.temporary_table : MDEV-13265 - Wrong result -innodb.truncate_foreign : Modified in 10.4.14 +innodb.truncate : Modified in 10.4.16 innodb.undo_truncate : MDEV-17340 - Server hung; MDEV-20840 - Sporadic timeout innodb.undo_truncate_recover : MDEV-17679 - Server has gone away; MDEV-19200 - Shutdown fails +innodb.update-cascade : Combinations added in 10.4.16 innodb.update_time : MDEV-14804 - Wrong result -innodb.xa_recovery : MDEV-15279 - mysqld got exception; modified in 10.4.14 -innodb.xa_recovery_debug : Modified in 10.4.14 +innodb.xa_recovery : MDEV-15279 - mysqld got exception #----------------------------------------------------------------------- -innodb_fts.innodb-fts-ddl : Modified in 10.4.14 -innodb_fts.innodb_fts_misc : Modified in 10.4.13 +innodb_fts.basic : Modified in 10.4.16 +innodb_fts.fulltext2 : MDEV-24074 - Server crash +innodb_fts.innodb_fts_misc_1 : Modified in 10.4.16 innodb_fts.innodb_fts_misc_debug : MDEV-14156 - Unexpected warning innodb_fts.innodb_fts_plugin : MDEV-13888 - Errors in server log innodb_fts.innodb_fts_stopword_charset : MDEV-13259 - Table crashed -innodb_fts.misc_debug : Modified in 10.4.13 -innodb_fts.misc_debug2 : Added in 10.4.13 -innodb_fts.stopword : Added in 10.4.13 -innodb_fts.sync : Modified in 10.4.13 innodb_fts.sync_ddl : MDEV-21568 - Errno: 2000; MDEV-18654 - Assertion failure #----------------------------------------------------------------------- innodb_gis.alter_spatial_index : MDEV-13745 - Server crash -innodb_gis.bug16236208 : Modified in 10.4.13 -innodb_gis.bug16266012 : Modified in 10.4.13 -innodb_gis.geometry : Modified in 10.4.13 -innodb_gis.gis_split_inf : Modified in 10.4.13 innodb_gis.gis_split_nan : MDEV-21678 - Cannot get geometry object -innodb_gis.point_big : Re-enabled in 10.4.13 +innodb_gis.rtree_add_index : Include file modified in 10.4.16 +innodb_gis.rtree_compress : Include file modified in 10.4.16 innodb_gis.rtree_compress2 : MDEV-16269 - Wrong result innodb_gis.rtree_concurrent_srch : MDEV-15284 - Wrong result with embedded -innodb_gis.rtree_multi_pk : Modified in 10.4.13 -innodb_gis.rtree_purge : MDEV-15275 - Timeout +innodb_gis.rtree_purge : MDEV-15275 - Timeout; include file modified in 10.4.16 innodb_gis.rtree_recovery : MDEV-15274 - Error on check -innodb_gis.rtree_split : MDEV-14208 - Too many arguments; modified in 10.4.13 -innodb_gis.rtree_undo : MDEV-14456 - Timeout in include file +innodb_gis.rtree_split : MDEV-14208 - Too many arguments +innodb_gis.rtree_undo : MDEV-14456 - Timeout in include file; include file modified in 10.4.16 innodb_gis.types : MDEV-15679 - Table is marked as crashed #----------------------------------------------------------------------- innodb_zip.cmp_per_index : MDEV-14490 - Table is marked as crashed -innodb_zip.create_options : MDEV-23370 - Server crash; MDEV-21329 - Assertion failure +innodb_zip.create_options : MDEV-21329 - Assertion failure; MDEV-24076 - Assertion failure innodb_zip.index_large_prefix_4k : MDEV-21679 - Row size too large innodb_zip.innochecksum : MDEV-14486 - Server failed to shut down innodb_zip.innochecksum_3 : MDEV-13279 - Extra warnings -innodb_zip.recover : MDEV-22512 - Server failed to restart -innodb_zip.wl5522_debug_zip : MDEV-11600 - Operating system error number 2; modified in 10.4.13 -innodb_zip.wl5522_zip : Modified in 10.4.13 +innodb_zip.recover : MDEV-22512 - Server failed to restart (fixed in 10.5+) +innodb_zip.wl5522_debug_zip : MDEV-11600 - Operating system error number 2 innodb_zip.wl6470_1 : MDEV-14240 - Assertion failure innodb_zip.wl6501_1 : MDEV-10891 - Can't create UNIX socket innodb_zip.wl6501_scale_1 : MDEV-13254 - Timeout, MDEV-14104 - Error 192 #----------------------------------------------------------------------- -maria.bulk_insert_crash : Added in 10.4.14 -maria.encrypt-no-key : Added in 10.4.14 -maria.icp : Include file modified in 10.4.13 +maria.alter : Modified in 10.4.16 +maria.create : Modified in 10.4.16 maria.insert_select : MDEV-12757 - Timeout maria.insert_select-7314 : MDEV-16492 - Timeout maria.maria : MDEV-14430 - Extra warning -maria.maria-no-logging : MDEV-20196 - Crash on shutdown or server can't start +maria.maria-no-logging : MDEV-20196 - Crash on shutdown or server can't start; modified in 10.4.16 #----------------------------------------------------------------------- -mariabackup.* : suite.pm modified in 10.4.13 mariabackup.absolute_ibdata_paths : MDEV-16571 - Wrong result -mariabackup.apply-log-only : MDEV-20135 - Timeout; modified in 10.4.14 -mariabackup.apply-log-only-incr : Modified in 10.4.14 -mariabackup.backup_lock_wait_timeout : Added in 10.4.13 -mariabackup.binlog : Modified in 10.4.14 +mariabackup.apply-log-only : MDEV-20135 - Timeout +mariabackup.backup_ssl : MDEV-24073 - Server crash upon shutdown mariabackup.create_with_data_directory_during_backup : MDEV-20159 - Assertion failure mariabackup.data_directory : MDEV-15270 - Error on exec +mariabackup.ddl_incremental_encrypted : Added in 10.4.16 mariabackup.full_backup : MDEV-16571 - Wrong result -mariabackup.huge_lsn : MDEV-18569 - Table doesn't exist; modified in 10.4.14 -mariabackup.incremental_backup : MDEV-21222 - Memory allocation failure; modified in 10.4.14 -mariabackup.incremental_ddl_before_backup : Modified in 10.4.14 -mariabackup.incremental_ddl_during_backup : Modified in 10.4.14 +mariabackup.huge_lsn : MDEV-18569 - Table doesn't exist +mariabackup.incremental_backup : MDEV-21222 - Memory allocation failure +mariabackup.incremental_ddl_during_backup : Modified in 10.4.16 mariabackup.incremental_encrypted : MDEV-15667 - timeout mariabackup.incremental_rocksdb : MDEV-20954 - Cannot access the file -mariabackup.innodb_xa_rollback : Added in 10.4.13 +mariabackup.innodb_redo_overwrite : MDEV-24023 - Wrong result; added in 10.4.16 mariabackup.log_checksum_mismatch : MDEV-16571 - Wrong result -mariabackup.mdev-14447 : MDEV-15201 - Timeout; modified in 10.4.14 -mariabackup.options_check : Added in 10.4.14 -mariabackup.partial_exclude : MDEV-15270 - Error on exec; modified in 10.4.13 -mariabackup.undo_space_id : Modified in 10.4.14 -mariabackup.unencrypted_page_compressed : MDEV-18653 - Wrong error +mariabackup.mdev-14447 : MDEV-15201 - Timeout +mariabackup.mlog_index_load : Modified in 10.4.16 +mariabackup.partial_exclude : MDEV-15270 - Error on exec +mariabackup.rpl_slave_info : Added in 10.4.16 +mariabackup.unencrypted_page_compressed : MDEV-18653 - Wrong error; include file modified in 10.4.16 mariabackup.xb_compressed_encrypted : MDEV-14812 - Segmentation fault mariabackup.xb_file_key_management : MDEV-16571 - Wrong result -mariabackup.xb_fulltext_encrypted : Modified in 10.4.14 mariabackup.xb_page_compress : MDEV-14810 - status: 1, errno: 11 -mariabackup.xb_partition : MDEV-17584 - Crash upon shutdown; modified in 10.4.14 +mariabackup.xb_partition : MDEV-17584 - Crash upon shutdown mariabackup.xb_rocksdb : MDEV-17338 - Server hung on shutdown #----------------------------------------------------------------------- -mroonga/storage.column_datetime_32bit_2038 : Wrong result on Alpha -mroonga/storage.column_datetime_32bit_before_unix_epoch : Wrong result on Alpha -mroonga/storage.column_datetime_32bit_max : Wrong result on Alpha -mroonga/storage.column_datetime_32bit_out_of_range : Wrong result on Alpha -mroonga/storage.index_multiple_column_unique_date_32bit_equal : Wrong result on Alpha -mroonga/storage.index_multiple_column_unique_date_order_32bit_desc : Wrong result on Alpha -mroonga/storage.index_multiple_column_unique_datetime_index_read : MDEV-8643 - Valgrind -mroonga/storage.optimization_count_skip_index_between : Modified in 10.4.13 -mroonga/storage.optimization_count_skip_index_greater : Modified in 10.4.13 -mroonga/storage.optimization_count_skip_index_greater_equal : Modified in 10.4.13 -mroonga/storage.optimization_count_skip_index_less : Modified in 10.4.13 -mroonga/storage.optimization_count_skip_index_less_equal : Modified in 10.4.13 -mroonga/storage.optimization_count_skip_primary_key_between : Modified in 10.4.13 -mroonga/storage.optimization_count_skip_primary_key_greater : Modified in 10.4.13 -mroonga/storage.optimization_count_skip_primary_key_greater_equal : Modified in 10.4.13 -mroonga/storage.repair_table_no_index_file : MDEV-9364 - wrong result, MDEV-14807 - wrong error message -mroonga/storage.variable_max_n_records_for_estimate_not_found_in_limit : Modified in 10.4.13 +mroonga/storage.column_datetime_32bit_2038 : Wrong result on Alpha +mroonga/storage.column_datetime_32bit_before_unix_epoch : Wrong result on Alpha +mroonga/storage.column_datetime_32bit_max : Wrong result on Alpha +mroonga/storage.column_datetime_32bit_out_of_range : Wrong result on Alpha +mroonga/storage.index_multiple_column_unique_date_32bit_equal : Wrong result on Alpha +mroonga/storage.index_multiple_column_unique_date_order_32bit_desc : Wrong result on Alpha +mroonga/storage.index_multiple_column_unique_datetime_index_read : MDEV-8643 - Valgrind +mroonga/storage.repair_table_no_index_file : MDEV-9364 - wrong result, MDEV-14807 - wrong error message #----------------------------------------------------------------------- @@ -667,32 +581,22 @@ multi_source.status_vars : MDEV-4632 - failed while waiting for Slave_received_h #----------------------------------------------------------------------- -oqgraph.social : MDEV-22280 - Timeout; MDEV-22280 - Timeout +oqgraph.social : MDEV-22280 - Timeout #----------------------------------------------------------------------- -parts.longname : Modified in 10.4.14 -parts.partition_alter1_1_2_innodb : MDEV-18655 - ASAN unknown crash -parts.partition_alter1_1_innodb : MDEV-18655 - ASAN unknown crash -parts.partition_alter1_2_innodb : MDEV-18655 - ASAN unknown crash -parts.partition_alter2_2_maria : MDEV-14364 - Lost connection to MySQL server during query -parts.partition_alter_instant : Added in 10.4.13 -parts.partition_auto_increment_archive : MDEV-16491 - Marked as crashed and should be repaired; include file modified in 10.4.14 -parts.partition_auto_increment_blackhole : Include file modified in 10.4.14 -parts.partition_auto_increment_innodb : Include file modified in 10.4.14 -parts.partition_auto_increment_maria : MDEV-14430 - Extra warning; include file modified in 10.4.14 -parts.partition_auto_increment_memory : Include file modified in 10.4.14 -parts.partition_auto_increment_myisam : Include file modified in 10.4.14 -parts.partition_basic_innodb : MDEV-20214 - ASAN error -parts.partition_debug : Modified in 10.4.14 -parts.partition_debug_innodb : MDEV-10891 - Can't create UNIX socket; MDEV-15095 - Table doesn't exist -parts.partition_exch_qa_10 : MDEV-11765 - wrong result -parts.partition_innodb_status_file : MDEV-12901 - Valgrind -parts.partition_special_innodb : MDEV-16942 - Timeout; modified in 10.4.13 - -#----------------------------------------------------------------------- - -percona.* : MDEV-10997 - Not maintained +parts.partition_alter1_1_2_innodb : MDEV-18655 - ASAN unknown crash +parts.partition_alter1_1_innodb : MDEV-18655 - ASAN unknown crash +parts.partition_alter1_2_innodb : MDEV-18655 - ASAN unknown crash +parts.partition_alter2_2_maria : MDEV-14364 - Lost connection to MySQL server during query +parts.partition_auto_increment_archive : MDEV-16491 - Marked as crashed and should be repaired +parts.partition_auto_increment_maria : MDEV-14430 - Extra warning +parts.partition_basic_innodb : MDEV-20214 - ASAN error +parts.partition_debug_innodb : MDEV-10891 - Can't create UNIX socket; MDEV-15095 - Table doesn't exist +parts.partition_exch_qa_10 : MDEV-11765 - wrong result +parts.partition_innodb_status_file : MDEV-12901 - Valgrind +parts.partition_special_innodb : MDEV-16942 - Timeout +parts.reorganize : Added in 10.4.16 #----------------------------------------------------------------------- @@ -706,13 +610,14 @@ perfschema.hostcache_ipv4_addrinfo_again_allow : MDEV-12759 - Crash perfschema.hostcache_ipv6_addrinfo_again_allow : MDEV-12752 - Crash perfschema.hostcache_ipv6_addrinfo_bad_allow : MDEV-13260 - Crash perfschema.hostcache_ipv6_ssl : MDEV-10696 - Crash +perfschema.nesting : MDEV-23458 - Wrong result perfschema.pfs_upgrade_event : MDEV-20957 - Wrong result perfschema.pfs_upgrade_func : MDEV-20957 - Upgrade file was not properly created perfschema.pfs_upgrade_proc : MDEV-20533 - Upgrade file was not properly created perfschema.pfs_upgrade_table : MDEV-20533 - Exec failed perfschema.pfs_upgrade_view : MDEV-20533 - Upgrade file was not properly created perfschema.privilege_table_io : MDEV-13184 - Extra lines -perfschema.relaylog : MDEV-18134 - Wrong result +perfschema.relaylog : MDEV-18134 - Wrong result; MDEV-24075 - Extra warning perfschema.rpl_gtid_func : MDEV-16897 - Wrong result perfschema.socket_instances_func : MDEV-20140 - Wrong result perfschema.socket_summary_by_event_name_func : MDEV-10622 - Wrong result @@ -730,17 +635,16 @@ perfschema_stress.* : MDEV-10996 - Not maintained #----------------------------------------------------------------------- -period.alter : Modified in 10.4.13 -period.update : Modified in 10.4.13 -period.versioning : MDEV-20159 - Assertion failure; include file modified in 10.4.14 +period.delete : Modified in 10.4.16 +period.update : Modified in 10.4.16 +period.versioning : MDEV-20159 - Assertion failure #----------------------------------------------------------------------- -plugins.audit_null_debug : Modified in 10.4.14 plugins.feedback_plugin_send : MDEV-7932, MDEV-11118 - Connection problems and such -plugins.multiauth : MDEV-20163 - Plugin could not be loaded; modified in 10.4.13 +plugins.multiauth : MDEV-20163 - Plugin could not be loaded plugins.processlist : MDEV-16574 - Wrong result -plugins.server_audit : MDEV-14295 - Wrong result; modified in 10.4.13 +plugins.server_audit : MDEV-14295 - Wrong result; modified in 10.4.16 plugins.thread_pool_server_audit : MDEV-14295 - Wrong result #----------------------------------------------------------------------- @@ -780,135 +684,128 @@ rocksdb_sys_vars.rocksdb_rate_limiter_bytes_per_sec_basic : MDEV-16639 - Crash #----------------------------------------------------------------------- -roles.create_and_grant_role : MDEV-11772 - wrong result -roles.drop_current_role : Added in 10.4.14 -roles.grant_revoke_current : Modified in 10.4.13 -roles.set_default_role_invalid : Modified in 10.4.14 - -#----------------------------------------------------------------------- - -rpl.circular_serverid0 : MDEV-19372 - ASAN heap-use-after-free; modified in 10.4.13 -rpl.create_or_replace2 : MDEV-19412 - Lost connection to MySQL server -rpl.create_or_replace_mix : MDEV-20523 - Wrong result -rpl.create_or_replace_statement : MDEV-20523 - Wrong result -rpl.create_select : MDEV-14121 - Assertion failure -rpl.last_insert_id : MDEV-10625 - warnings in error log -rpl.parallel_backup : Added in 10.4.14 -rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips -rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips -rpl.rpl_auto_increment_update_failure : MDEV-10625 - warnings in error log -rpl.rpl_binlog_dump_slave_gtid_state_info : Added in 10.4.14 -rpl.rpl_binlog_errors : MDEV-12742 - Crash; include file modified in 10.4.13 -rpl.rpl_binlog_grant : MDEV-21274 - Lost connection at handshake -rpl.rpl_binlog_index : MDEV-9501 - Failed registering on master -rpl.rpl_bug41902 : Configuration deleted in 10.4.13 -rpl.rpl_cant_read_event_incident : MDEV-20960 - Abort on shutdown -rpl.rpl_checksum_cache : MDEV-22510 - Server crash -rpl.rpl_circular_for_4_hosts : MDEV-20536 - Server crash -rpl.rpl_colSize : MDEV-16112 - Server crash -rpl.rpl_conditional_comments : Modified in 10.4.13 -rpl.rpl_corruption : MDEV-20527 - Slave stopped with wrong error code; include file modified in 10.4.13 -rpl.rpl_create_tmp_table_if_not_exists : MDEV-20159 - Assertion failure -rpl.rpl_ctype_latin1 : MDEV-14813 - Wrong result on Mac -rpl.rpl_ddl : MDEV-10417 - Fails on Mips -rpl.rpl_domain_id_filter_io_crash : MDEV-12729 - Timeout in include file, MDEV-13677 - Server crash; modified in 10.4.13 -rpl.rpl_domain_id_filter_master_crash : MDEV-19043 - Table marked as crashed -rpl.rpl_domain_id_filter_restart : MDEV-10684 - Wrong result; MDEV-19043 - Table marked as crashed -rpl.rpl_drop_db_fail : MDEV-16898 - Slave fails to start -rpl.rpl_dump_request_retry_warning : Added in 10.4.14 -rpl.rpl_extra_col_master_innodb : MDEV-16570 - Extra warning -rpl.rpl_fail_register : Modified in 10.4.14 -rpl.rpl_flushlog_loop : MDEV-21570 - Server crash -rpl.rpl_get_lock : MDEV-19368 - mysqltest failed but provided no output -rpl.rpl_get_master_version_and_clock : Re-enabled in 10.4.13; include file modified in 10.4.13 -rpl.rpl_gtid_basic : MDEV-10681 - server startup problem -rpl.rpl_gtid_crash : MDEV-9501 - Failed registering on master, MDEV-13643 - Lost connection -rpl.rpl_gtid_delete_domain : MDEV-14463 - Timeout; MDEV-23103 - Could not delete gtid domain -rpl.rpl_gtid_errorhandling : MDEV-13261 - Crash -rpl.rpl_gtid_mdev9033 : MDEV-10680 - warnings -rpl.rpl_gtid_reconnect : MDEV-14497 - Crash -rpl.rpl_gtid_startpos : MDEV-20141 - mysqltest failed but provided no output -rpl.rpl_gtid_stop_start : MDEV-10629 - Crash on shutdown, MDEV-12629 - Valgrind warnings -rpl.rpl_gtid_strict : Modified in 10.4.13 -rpl.rpl_gtid_until : MDEV-10625 - warnings in error log -rpl.rpl_ignore_grant : MDEV-20159 - Assertion failure -rpl.rpl_ignore_table : Modified in 10.4.13 -rpl.rpl_ignore_table_update : MDEV-20159 - Assertion failure -rpl.rpl_innodb_bug30888 : MDEV-10417 - Fails on Mips -rpl.rpl_insert : MDEV-9329 - Fails on Ubuntu/s390x -rpl.rpl_insert_delayed : MDEV-9329 - Fails on Ubuntu/s390x -rpl.rpl_insert_id : MDEV-15197 - Wrong result -rpl.rpl_insert_id_pk : MDEV-16567 - Assertion failure -rpl.rpl_insert_ignore : MDEV-14365 - Lost connection to MySQL server during query -rpl.rpl_invoked_features : MDEV-10417 - Fails on Mips -rpl.rpl_ipv4_as_ipv6 : MDEV-20147 - Incorrect checksum for freed object -rpl.rpl_mariadb_slave_capability : MDEV-11018 - Extra lines in binlog -rpl.rpl_mdev12179 : MDEV-19043 - Table marked as crashed -rpl.rpl_mdev6020 : MDEV-15272 - Server crash -rpl.rpl_mixed_mixing_engines : MDEV-21266 - Timeout -rpl.rpl_non_direct_row_mixing_engines : MDEV-16561 - Timeout in master_pos_wait -rpl.rpl_old_master : MDEV-22956 - Failing assertion -rpl.rpl_parallel : MDEV-10653 - Timeouts -rpl.rpl_parallel2 : MDEV-17390 - Operation cannot be performed; re-enabled in 10.4.14; modified in 10.4.14 -rpl.rpl_parallel_conflicts : MDEV-15272 - Server crash -rpl.rpl_parallel_mdev6589 : MDEV-12979 - Assertion failure -rpl.rpl_parallel_multilevel : MDEV-20160 - Server crash -rpl.rpl_parallel_multilevel2 : MDEV-14723 - Timeout -rpl.rpl_parallel_optimistic : MDEV-15278 - Failed to sync with master -rpl.rpl_parallel_optimistic_nobinlog : MDEV-15278 - Failed to sync with master -rpl.rpl_parallel_optimistic_until : MDEV-23021 - Query didn't return a result set; added in 10.4.14 -rpl.rpl_parallel_retry : MDEV-11119 - Crash; MDEV-17109 - Timeout -rpl.rpl_parallel_temptable : MDEV-10356 - Crash; MDEV-19076 - Wrong result -rpl.rpl_partition_innodb : MDEV-10417 - Fails on Mips -rpl.rpl_password_boundaries : MDEV-11534 - Slave IO warnings -rpl.rpl_read_only : MDEV-20159 - Assertion failure -rpl.rpl_row_001 : MDEV-16653 - MTR's internal check fails -rpl.rpl_row_basic_11bugs : MDEV-12171 - Server failed to start -rpl.rpl_row_basic_2myisam : MDEV-13875 - command "diff_files" failed -rpl.rpl_row_corruption : MDEV-21569 - mutex: LOCK_global_system_variables unlocking; modified in 10.4.13 -rpl.rpl_row_drop_create_temp_table : MDEV-14487 - Wrong result -rpl.rpl_row_end_of_statement_loss : MDEV-21237 - Server crash -rpl.rpl_row_img_blobs : MDEV-13875 - command "diff_files" failed -rpl.rpl_row_img_eng_min : MDEV-13875 - diff_files failed -rpl.rpl_row_img_eng_noblob : MDEV-13875 - command "diff_files" failed -rpl.rpl_row_index_choice : MDEV-15196 - Slave crash -rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x -rpl.rpl_row_until : MDEV-14052 - Master will not send events with checksum -rpl.rpl_row_virt : Added in 10.4.14 -rpl.rpl_semi_sync : MDEV-11220 - Wrong result -rpl.rpl_semi_sync_after_sync : MDEV-14366 - Wrong result -rpl.rpl_semi_sync_after_sync_row : MDEV-14366 - Wrong result -rpl.rpl_semi_sync_event_after_sync : MDEV-11806 - warnings -rpl.rpl_semi_sync_skip_repl : MDEV-23371 - Server crash -rpl.rpl_semi_sync_uninstall_plugin : MDEV-7140 - Assorted failures -rpl.rpl_semi_sync_wait_no_slave : MDEV-20159 - Assertion failure -rpl.rpl_semi_sync_wait_point : MDEV-11807 - timeout in wait condition -rpl.rpl_semisync_ali_issues : MDEV-16272 - Wrong result -rpl.rpl_show_slave_hosts : MDEV-10681 - Crash -rpl.rpl_shutdown_wait_slaves : MDEV-22517 - Timeout on sync_with_master -rpl.rpl_skip_replication : MDEV-23372 - Extra warning -rpl.rpl_slave_grp_exec : MDEV-10514 - Deadlock -rpl.rpl_slave_load_in : MDEV-20159 - Assertion failure -rpl.rpl_slow_query_log : MDEV-13250 - Test abort -rpl.rpl_sp_effects : MDEV-13249 - Crash -rpl.rpl_start_stop_slave : MDEV-13567 - Sync slave timeout -rpl.rpl_stm_multi_query : MDEV-9501 - Failed registering on master -rpl.rpl_stm_relay_ign_space : MDEV-14360 - Test assertion -rpl.rpl_stm_stop_middle_group : MDEV-13791 - Server crash; include file modified in 10.4.13 -rpl.rpl_temporal_mysql56_to_mariadb53 : MDEV-9501 - Failed registering on master -rpl.rpl_temporary_error2 : MDEV-10634 - Wrong number of retries -rpl.rpl_test_framework : MDEV-19368 - mysqltest failed but provided no output -rpl.rpl_trigger : MDEV-18055 - Wrong result -rpl.rpl_truncate_3innodb : MDEV-19454 - Syntax error -rpl.rpl_upgrade_master_info : MDEV-16567 - Assertion failure -rpl.rpl_user_variables : MDEV-20522 - Wrong result -rpl.rpl_variables : MDEV-20150 - Server crash -rpl.sec_behind_master-5114 : MDEV-13878 - Wrong result -rpl.show_status_stop_slave_race-7126 : MDEV-17438 - Timeout - -#----------------------------------------------------------------------- - -rpl-tokudb.* : MDEV-14354 - Tests fail with tcmalloc +roles.acl_load_mutex-5170 : Modified in 10.4.16 +roles.create_and_grant_role : MDEV-11772 - wrong result + +#----------------------------------------------------------------------- + +rpl.circular_serverid0 : MDEV-19372 - ASAN heap-use-after-free +rpl.create_or_replace2 : MDEV-19412 - Lost connection to MySQL server +rpl.create_or_replace_mix : MDEV-20523 - Wrong result +rpl.create_or_replace_statement : MDEV-20523 - Wrong result +rpl.create_select : MDEV-14121 - Assertion failure +rpl.last_insert_id : MDEV-10625 - warnings in error log +rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips +rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips +rpl.rpl_auto_increment_update_failure : MDEV-10625 - warnings in error log +rpl.rpl_binlog_errors : MDEV-12742 - Crash +rpl.rpl_binlog_grant : MDEV-21274 - Lost connection at handshake +rpl.rpl_binlog_index : Modified in 10.4.16 +rpl.rpl_cant_read_event_incident : MDEV-20960 - Abort on shutdown +rpl.rpl_checksum_cache : MDEV-22510 - Server crash +rpl.rpl_circular_for_4_hosts : MDEV-20536 - Server crash +rpl.rpl_colSize : MDEV-16112 - Server crash +rpl.rpl_corruption : MDEV-20527 - Slave stopped with wrong error code +rpl.rpl_create_tmp_table_if_not_exists : MDEV-20159 - Assertion failure +rpl.rpl_ctype_latin1 : MDEV-14813 - Wrong result on Mac +rpl.rpl_ddl : MDEV-10417 - Fails on Mips +rpl.rpl_domain_id_filter_io_crash : MDEV-12729 - Timeout in include file, MDEV-13677 - Server crash +rpl.rpl_domain_id_filter_master_crash : MDEV-19043 - Table marked as crashed +rpl.rpl_domain_id_filter_restart : MDEV-10684 - Wrong result; MDEV-19043 - Table marked as crashed +rpl.rpl_drop_db_fail : MDEV-16898 - Slave fails to start +rpl.rpl_extra_col_master_innodb : MDEV-16570 - Extra warning +rpl.rpl_extra_col_master_myisam : MDEV-23372 - Extra warning +rpl.rpl_filter_tables_dynamic : Modified in 10.4.16 +rpl.rpl_filter_wild_tables_dynamic : Modified in 10.4.16 +rpl.rpl_flushlog_loop : MDEV-21570 - Server crash +rpl.rpl_get_lock : MDEV-19368 - mysqltest failed but provided no output +rpl.rpl_gtid_basic : MDEV-10681 - server startup problem +rpl.rpl_gtid_crash : MDEV-13643 - Lost connection; modified in 10.4.16 +rpl.rpl_gtid_delete_domain : MDEV-14463 - Timeout; MDEV-23103 - Could not delete gtid domain; modified in 10.4.16 +rpl.rpl_gtid_errorhandling : MDEV-13261 - Crash +rpl.rpl_gtid_mdev9033 : MDEV-10680 - warnings +rpl.rpl_gtid_reconnect : MDEV-14497 - Crash +rpl.rpl_gtid_startpos : MDEV-20141 - mysqltest failed but provided no output +rpl.rpl_gtid_stop_start : MDEV-10629 - Crash on shutdown, MDEV-12629 - Valgrind warnings +rpl.rpl_gtid_until : MDEV-10625 - warnings in error log +rpl.rpl_ignore_grant : MDEV-20159 - Assertion failure +rpl.rpl_ignore_table_update : MDEV-20159 - Assertion failure +rpl.rpl_innodb_bug30888 : MDEV-10417 - Fails on Mips +rpl.rpl_insert : MDEV-9329 - Fails on Ubuntu/s390x +rpl.rpl_insert_delayed : MDEV-9329 - Fails on Ubuntu/s390x +rpl.rpl_insert_id : MDEV-15197 - Wrong result +rpl.rpl_insert_id_pk : MDEV-16567 - Assertion failure +rpl.rpl_insert_ignore : MDEV-14365 - Lost connection to MySQL server during query +rpl.rpl_invoked_features : MDEV-10417 - Fails on Mips +rpl.rpl_ipv4_as_ipv6 : MDEV-20147 - Incorrect checksum for freed object +rpl.rpl_mariadb_slave_capability : MDEV-11018 - Extra lines in binlog +rpl.rpl_mdev12179 : MDEV-19043 - Table marked as crashed +rpl.rpl_mdev6020 : MDEV-23426 - Server crash, ASAN failures; MDEV-15272 - Server crash +rpl.rpl_mixed_mixing_engines : MDEV-21266 - Timeout +rpl.rpl_mysql_upgrade : Modified in 10.4.16 +rpl.rpl_non_direct_row_mixing_engines : MDEV-16561 - Timeout in master_pos_wait +rpl.rpl_old_master : MDEV-22956 - Failing assertion +rpl.rpl_parallel : MDEV-10653 - Timeouts +rpl.rpl_parallel2 : MDEV-17390 - Operation cannot be performed +rpl.rpl_parallel_conflicts : MDEV-15272 - Server crash +rpl.rpl_parallel_mdev6589 : MDEV-12979 - Assertion failure +rpl.rpl_parallel_multilevel : MDEV-20160 - Server crash +rpl.rpl_parallel_multilevel2 : MDEV-14723 - Timeout +rpl.rpl_parallel_optimistic : MDEV-15278 - Failed to sync with master +rpl.rpl_parallel_optimistic_nobinlog : MDEV-15278 - Failed to sync with master +rpl.rpl_parallel_optimistic_until : MDEV-23021 - Query didn't return a result set +rpl.rpl_parallel_retry : MDEV-11119 - Crash; MDEV-17109 - Timeout; modified in 10.4.16 +rpl.rpl_parallel_temptable : MDEV-10356 - Crash; MDEV-19076 - Wrong result +rpl.rpl_partition_innodb : MDEV-10417 - Fails on Mips +rpl.rpl_password_boundaries : MDEV-11534 - Slave IO warnings +rpl.rpl_read_only : MDEV-20159 - Assertion failure +rpl.rpl_rewrt_db : MDEV-24060 - Server did not start +rpl.rpl_row_001 : MDEV-16653 - MTR's internal check fails +rpl.rpl_row_basic_11bugs : MDEV-12171 - Server failed to start +rpl.rpl_row_basic_2myisam : MDEV-13875 - command "diff_files" failed +rpl.rpl_row_corruption : MDEV-21569 - mutex: LOCK_global_system_variables unlocking +rpl.rpl_row_drop_create_temp_table : MDEV-14487 - Wrong result +rpl.rpl_row_end_of_statement_loss : MDEV-21237 - Server crash +rpl.rpl_row_img_blobs : MDEV-13875 - command "diff_files" failed +rpl.rpl_row_img_eng_min : MDEV-13875 - diff_files failed +rpl.rpl_row_img_eng_noblob : MDEV-13875 - command "diff_files" failed +rpl.rpl_row_index_choice : MDEV-15196 - Slave crash +rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x +rpl.rpl_row_until : MDEV-14052 - Master will not send events with checksum +rpl.rpl_semi_sync : MDEV-11220 - Wrong result +rpl.rpl_semi_sync_after_sync : MDEV-14366 - Wrong result +rpl.rpl_semi_sync_after_sync_row : MDEV-14366 - Wrong result +rpl.rpl_semi_sync_event_after_sync : MDEV-11806 - warnings +rpl.rpl_semi_sync_skip_repl : MDEV-23371 - Server crash +rpl.rpl_semi_sync_uninstall_plugin : MDEV-7140 - Assorted failures +rpl.rpl_semi_sync_wait_no_slave : MDEV-20159 - Assertion failure +rpl.rpl_semi_sync_wait_point : MDEV-11807 - timeout in wait condition +rpl.rpl_semisync_ali_issues : MDEV-16272 - Wrong result +rpl.rpl_show_slave_hosts : MDEV-10681 - Crash +rpl.rpl_shutdown_wait_slaves : MDEV-22517 - Timeout on sync_with_master +rpl.rpl_skip_replication : MDEV-23372 - Extra warning +rpl.rpl_slave_grp_exec : MDEV-10514 - Deadlock; re-enabled in 10.4.16; modified in 10.4.16 +rpl.rpl_slave_load_in : MDEV-20159 - Assertion failure +rpl.rpl_slave_load_tmpdir_not_exist : MDEV-23372 - Extra warning +rpl.rpl_slow_query_log : MDEV-13250 - Test abort +rpl.rpl_sp_effects : MDEV-13249 - Crash +rpl.rpl_start_stop_slave : MDEV-13567 - Sync slave timeout; modified in 10.4.16 +rpl.rpl_stm_relay_ign_space : MDEV-14360 - Test assertion +rpl.rpl_stm_stop_middle_group : MDEV-13791 - Server crash +rpl.rpl_sync : MDEV-10633 - Database page corruption +rpl.rpl_temporary_error2 : MDEV-10634 - Wrong number of retries +rpl.rpl_test_framework : MDEV-19368 - mysqltest failed but provided no output +rpl.rpl_trigger : MDEV-18055 - Wrong result +rpl.rpl_truncate_3innodb : MDEV-19454 - Syntax error +rpl.rpl_upgrade_master_info : MDEV-16567 - Assertion failure +rpl.rpl_user_variables : MDEV-20522 - Wrong result +rpl.rpl_variables : MDEV-20150 - Server crash +rpl.sec_behind_master-5114 : MDEV-13878 - Wrong result +rpl.show_status_stop_slave_race-7126 : Modified in 10.4.16 + +#----------------------------------------------------------------------- + +rpl-tokudb.* : MDEV-14354 - Tests failing with tcmalloc rpl-tokudb.rpl_deadlock_tokudb : MDEV-20529 - mysqltest failed but provided no output rpl-tokudb.rpl_tokudb_commit_after_flush : MDEV-16966 - Server crash @@ -929,22 +826,19 @@ spider.basic_sql : MDEV-11186 - Internal check fails #----------------------------------------------------------------------- -spider/bg.direct_aggregate : MDEV-7098 - Packets out of order -spider/bg.direct_aggregate_part : MDEV-7098 - Trying to unlock mutex that wasn't locked -spider/bg.ha : MDEV-9329 - failures on s390x -spider/bg.ha_part : MDEV-9329 - Fails on Ubuntu/s390x -spider/bg.spider3_fixes : MDEV-12639 - Syntax error -spider/bg.spider3_fixes_part : MDEV-7098 - Trying to unlock mutex -spider/bg.spider_fixes : MDEV-7098 -Mutex problem, MDEV-9329 - failures on s390x -spider/bg.spider_fixes_part : MDEV-7098 - Trying to unlock mutex that wasn't locked -spider/bg.vp_fixes : MDEV-9329 - Fails on Ubuntu/s390x +spider/bg.* : MDEV-24059 - Timeout +spider/bg.ha : MDEV-9329 - failures on s390x +spider/bg.ha_part : MDEV-9329 - Fails on Ubuntu/s390x +spider/bg.spider3_fixes : MDEV-12639 - Syntax error +spider/bg.spider_fixes : MDEV-9329 - failures on s390x +spider/bg.vp_fixes : MDEV-9329 - Fails on Ubuntu/s390x #----------------------------------------------------------------------- -spider/bugfix.mdev_20502 : Added in 10.4.13 -spider/bugfix.mdev_21884 : Added in 10.4.13 -spider/bugfix.return_found_rows_insert : Modified in 10.4.13 -spider/bugfix.return_found_rows_update : Modified in 10.4.13 +spider/bugfix.direct_sql_with_comma_pwd : Added in 10.4.16 +spider/bugfix.mdev_20100 : Added in 10.4.16 +spider/bugfix.mdev_22246 : Added in 10.4.16 +spider/bugfix.xa_cmd : Added in 10.4.16 #----------------------------------------------------------------------- @@ -952,12 +846,10 @@ spider/handler.* : MDEV-10987, MDEV-10990 - Tests have not been maintained #----------------------------------------------------------------------- -sql_sequence.alter : Modified in 10.4.14 sql_sequence.concurrent_create : MDEV-16635 - Server crash -sql_sequence.create : Modified in 10.4.14 -sql_sequence.kill : MDEV-23393 - Server crash; added in 10.4.14 +sql_sequence.kill : MDEV-23393 - Server crash +sql_sequence.next : Modified in 10.4.16 sql_sequence.read_only : MDEV-22956 - Failing assertion -sql_sequence.rebuild : Modified in 10.4.13 #----------------------------------------------------------------------- @@ -965,27 +857,24 @@ storage_engine.* : Tests are not always timely maintained #----------------------------------------------------------------------- -stress.* : Added to the main set in 10.4.14 stress.ddl_innodb : MDEV-10635 - Testcase timeout -stress.misc : Added in 10.4.14 #----------------------------------------------------------------------- -sys_vars.alter_algorithm_basic : Added in 10.4.13 sys_vars.autocommit_func2 : MDEV-9329 - Fails on Ubuntu/s390x sys_vars.host_cache_size_auto : MDEV-20112 - Wrong result sys_vars.innodb_buffer_pool_dump_at_shutdown_basic : MDEV-14280 - Unexpected error sys_vars.innodb_checksum_algorithm_basic : MDEV-21568 - Errno: 2000 -sys_vars.innodb_instant_alter_column_allowed_basic : Added in 10.4.13 sys_vars.keep_files_on_create_basic : MDEV-10676 - timeout sys_vars.log_slow_admin_statements_func : MDEV-12235 - Server crash -sys_vars.max_sort_length_basic : Modified in 10.4.14 -sys_vars.optimizer_switch_basic : Modified in 10.4.14 -sys_vars.rpl_init_slave_func : MDEV-10149 - Test assertion -sys_vars.session_track_system_variables_basic : Modified in 10.4.14 +sys_vars.replicate_do_db_basic : Modified in 10.4.16 +sys_vars.rpl_init_slave_func : Modified in 10.4.16 +sys_vars.session_track_system_variables_basic : Modified in 10.4.16 sys_vars.slow_query_log_func : MDEV-14273 - Wrong result sys_vars.thread_cache_size_func : MDEV-11775 - Wrong result sys_vars.wait_timeout_func : MDEV-12896 - Wrong result +sys_vars.wsrep_cluster_address_basic : Modified in 10.4.16 +sys_vars.wsrep_on_basic : Configuration deleted in 10.4.16 #----------------------------------------------------------------------- @@ -1009,7 +898,6 @@ tokudb.locks-select-update-1 : MDEV-13406 - Lock wait timeout tokudb.rows-32m-rand-insert : MDEV-12640 - Crash tokudb.rows-32m-seq-insert : MDEV-12640 - Crash tokudb.savepoint-5 : MDEV-15280 - Wrong result -tokudb.type_blob : Modified in 10.4.13 tokudb.type_datetime : MDEV-15193 - Wrong result #----------------------------------------------------------------------- @@ -1028,13 +916,12 @@ tokudb_bugs.frm_store : MDEV-12823 - Valgrind tokudb_bugs.frm_store2 : MDEV-12823 - Valgrind tokudb_bugs.frm_store3 : MDEV-12823 - Valgrind tokudb_bugs.xa : MDEV-11804 - Lock wait timeout -tokudb_bugs.xa-3 : MDEV-22512 - Server failed to restart -tokudb_bugs.xa-4 : MDEV-22512 - Server failed to restart +tokudb_bugs.xa-3 : MDEV-22512 - Server failed to restart (fixed in 10.5+) +tokudb_bugs.xa-4 : MDEV-22512 - Server failed to restart (fixed in 10.5+) #----------------------------------------------------------------------- -tokudb_parts.partition_alter4_tokudb : MDEV-12640 - Lost connection -tokudb_parts.partition_auto_increment_tokudb : Include file modified in 10.4.14 +tokudb_parts.partition_alter4_tokudb : MDEV-12640 - Lost connection #----------------------------------------------------------------------- @@ -1060,43 +947,29 @@ unit.mf_iocache : MDEV-20952 - ASAN stack-buffer-overflow vcol.not_supported : MDEV-10639 - Testcase timeout vcol.vcol_keys_innodb : MDEV-10639 - Testcase timeout -vcol.vcol_keys_myisam : Modified in 10.4.14 -vcol.vcol_misc : MDEV-16651 - Wrong error message; modified in 10.4.14 +vcol.vcol_misc : MDEV-16651 - Wrong error message; modified in 10.4.16 #----------------------------------------------------------------------- -versioning.alter : Include file modified in 10.4.14 -versioning.auto_increment : Include file modified in 10.4.14 -versioning.commit_id : Include file modified in 10.4.14 -versioning.create : Include file modified in 10.4.14 -versioning.delete : Include file modified in 10.4.14 -versioning.delete_history : Include file modified in 10.4.14 -versioning.engines : Combinations modified in 10.4.14 -versioning.foreign : Include file modified in 10.4.14 -versioning.insert : Include file modified in 10.4.14 -versioning.online : Include file modified in 10.4.14 -versioning.partition : Modified in 10.4.14 -versioning.partition_innodb : Modified in 10.4.14 -versioning.partition_rotation : Modified in 10.4.14 -versioning.replace : Include file modified in 10.4.14 -versioning.select : Modified in 10.4.14 -versioning.select2 : Modified in 10.4.14 -versioning.sysvars : Modified in 10.4.14 -versioning.update : MDEV-22475 - Wrong result code; modified in 10.4.14 -versioning.update-big : Include file modified in 10.4.14 -versioning.view : Modified in 10.4.14 +versioning.create : Modified in 10.4.16 +versioning.select : Modified in 10.4.16 +versioning.sysvars : Modified in 10.4.16 +versioning.update : MDEV-22475 - Wrong result code +versioning.view : Modified in 10.4.16 #----------------------------------------------------------------------- -wsrep.* : suite.pm modified in 10.4.13 -wsrep.MDEV-20625 : Added in 10.4.13 +wsrep.MDEV-22443 : Added in 10.4.16 +wsrep.MDEV-23081 : Added in 10.4.16 +wsrep.MDEV-23092 : Added in 10.4.16 +wsrep.MDEV-23466 : Added in 10.4.16 wsrep.foreign_key : MDEV-14725 - WSREP has not yet prepared node +wsrep.mdev_22681 : Added in 10.4.16 wsrep.mdev_6832 : MDEV-14195 - Check testcase failed wsrep.pool_of_threads : MDEV-17345 - WSREP has not yet prepared node for application use -wsrep.trans : Modified in 10.4.13 -wsrep.variables : MDEV-17585 - Deadlock +wsrep.variables : Modified in 10.4.16 +wsrep.variables_debug : Added in 10.4.16 #----------------------------------------------------------------------- -wsrep_info.* : suite.pm modified in 10.4.13 wsrep_info.plugin : MDEV-22470 - WSREP: no nodes coming from prim view, prim not possible diff --git a/mysys/array.c b/mysys/array.c index 07abc460de7..e8b253a9e99 100644 --- a/mysys/array.c +++ b/mysys/array.c @@ -138,8 +138,9 @@ void *alloc_dynamic(DYNAMIC_ARRAY *array) array->size_of_element, MYF(array->malloc_flags | MY_WME)))) DBUG_RETURN(0); - memcpy(new_ptr, array->buffer, - array->elements * array->size_of_element); + if (array->elements) + memcpy(new_ptr, array->buffer, + array->elements * array->size_of_element); array->malloc_flags&= ~MY_INIT_BUFFER_USED; } else if (!(new_ptr=(char*) diff --git a/mysys/my_addr_resolve.c b/mysys/my_addr_resolve.c index 3f20f535d37..3a49c749010 100644 --- a/mysys/my_addr_resolve.c +++ b/mysys/my_addr_resolve.c @@ -159,10 +159,18 @@ err: #include <ctype.h> #include <sys/wait.h> +#if defined(HAVE_POLL_H) +#include <poll.h> +#elif defined(HAVE_SYS_POLL_H) +#include <sys/poll.h> +#endif /* defined(HAVE_POLL_H) */ + static int in[2], out[2]; static pid_t pid; static char addr2line_binary[1024]; static char output[1024]; +static struct pollfd poll_fds; +Dl_info info; int start_addr2line_fork(const char *binary_path) { @@ -212,15 +220,16 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc) ssize_t extra_bytes_read = 0; ssize_t parsed = 0; - fd_set set; - struct timeval timeout; + int ret; int filename_start = -1; int line_number_start = -1; - Dl_info info; void *offset; + poll_fds.fd = out[0]; + poll_fds.events = POLLIN | POLLRDBAND; + if (!dladdr(ptr, &info)) return 1; @@ -242,16 +251,16 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc) if (write(in[1], input, len) <= 0) return 3; - FD_ZERO(&set); - FD_SET(out[0], &set); - /* 100 ms should be plenty of time for addr2line to issue a response. */ - timeout.tv_sec = 0; - timeout.tv_usec = 100000; + /* 500 ms should be plenty of time for addr2line to issue a response. */ /* Read in a loop till all the output from addr2line is complete. */ while (parsed == total_bytes_read && - select(out[0] + 1, &set, NULL, NULL, &timeout) > 0) + (ret= poll(&poll_fds, 1, 500))) { + /* error during poll */ + if (ret < 0) + return 1; + extra_bytes_read= read(out[0], output + total_bytes_read, sizeof(output) - total_bytes_read); if (extra_bytes_read < 0) diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c index 536a3a5f3bc..a6f38dcb145 100644 --- a/mysys/my_alloc.c +++ b/mysys/my_alloc.c @@ -491,7 +491,7 @@ char *strmake_root(MEM_ROOT *root, const char *str, size_t len) void *memdup_root(MEM_ROOT *root, const void *str, size_t len) { char *pos; - if ((pos=alloc_root(root,len))) + if ((pos=alloc_root(root,len)) && len) memcpy(pos,str,len); return pos; } diff --git a/mysys/my_error.c b/mysys/my_error.c index 20836269939..2bb9305b2fb 100644 --- a/mysys/my_error.c +++ b/mysys/my_error.c @@ -112,9 +112,6 @@ void my_error(uint nr, myf MyFlags, ...) char ebuff[ERRMSGSIZE]; DBUG_ENTER("my_error"); DBUG_PRINT("my", ("nr: %d MyFlags: %lu errno: %d", nr, MyFlags, errno)); - - if (errno == 1213) - DBUG_ASSERT(0); if (!(format = my_get_err_msg(nr))) (void) my_snprintf(ebuff, sizeof(ebuff), "Unknown error %d", nr); diff --git a/plugin/auth_pam/CMakeLists.txt b/plugin/auth_pam/CMakeLists.txt index d89b8591a8f..f7d8e019751 100644 --- a/plugin/auth_pam/CMakeLists.txt +++ b/plugin/auth_pam/CMakeLists.txt @@ -14,8 +14,8 @@ CHECK_C_SOURCE_COMPILES( #include <grp.h> #include <unistd.h> int main() { - char *arg_1; - gid_t arg_2, arg_3; + char *arg_1= 0; + gid_t arg_2=0, arg_3; int arg_4; (void)getgrouplist(arg_1,arg_2,&arg_3,&arg_4); return 0; diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c index 30acfa3d6f6..64fc319aa22 100644 --- a/plugin/server_audit/server_audit.c +++ b/plugin/server_audit/server_audit.c @@ -709,6 +709,8 @@ static char *coll_search(struct user_coll *c, const char *n, size_t len) { struct user_name un; struct user_name *found; + if (!c->n_users) + return 0; un.name_len= len; un.name= (char *) n; found= (struct user_name*) bsearch(&un, c->users, c->n_users, @@ -739,7 +741,8 @@ static int coll_insert(struct user_coll *c, char *n, size_t len) static void coll_sort(struct user_coll *c) { - qsort(c->users, c->n_users, sizeof(c->users[0]), cmp_users); + if (c->n_users) + qsort(c->users, c->n_users, sizeof(c->users[0]), cmp_users); } @@ -970,7 +973,8 @@ static void get_str_n(char *dest, int *dest_len, size_t dest_size, if (src_len >= dest_size) src_len= dest_size - 1; - memcpy(dest, src, src_len); + if (src_len) + memcpy(dest, src, src_len); dest[src_len]= 0; *dest_len= (int)src_len; } diff --git a/sql/field.cc b/sql/field.cc index 4a82eae6a0e..a7d5f6b3328 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -8674,7 +8674,10 @@ int Field_blob::cmp_binary(const uchar *a_ptr, const uchar *b_ptr, b_length=get_length(b_ptr); if (b_length > max_length) b_length=max_length; - diff=memcmp(a,b,MY_MIN(a_length,b_length)); + if (uint32 len= MY_MIN(a_length,b_length)) + diff= memcmp(a,b,len); + else + diff= 0; return diff ? diff : (int) (a_length - b_length); } @@ -8731,7 +8734,8 @@ uint Field_blob::get_key_image(uchar *buff,uint length, imagetype type_arg) length=(uint) blob_length; } int2store(buff,length); - memcpy(buff+HA_KEY_BLOB_LENGTH, blob, length); + if (length) + memcpy(buff+HA_KEY_BLOB_LENGTH, blob, length); return HA_KEY_BLOB_LENGTH+length; } diff --git a/sql/field.h b/sql/field.h index b3bc2d4dbea..a512d74b444 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1394,6 +1394,8 @@ public: virtual uint max_packed_col_length(uint max_length) { return max_length;} + virtual bool is_packable() const { return false; } + uint offset(const uchar *record) const { return (uint) (ptr - record); @@ -1986,6 +1988,7 @@ public: bool can_optimize_range(const Item_bool_func *cond, const Item *item, bool is_eq_func) const; + bool is_packable() const { return true; } }; /* base class for float and double and decimal (old one) */ diff --git a/sql/filesort.cc b/sql/filesort.cc index aa25474be1a..ad4cb2b6e6b 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -1978,7 +1978,14 @@ sortlength(THD *thd, SORT_FIELD *sortorder, uint s_length, if (sortorder->field) { CHARSET_INFO *cs= sortorder->field->sort_charset(); + sortorder->type= sortorder->field->is_packable() ? + SORT_FIELD_ATTR::VARIABLE_SIZE : + SORT_FIELD_ATTR::FIXED_SIZE; + sortorder->length= sortorder->field->sort_length(); + if (sortorder->is_variable_sized()) + set_if_smaller(sortorder->length, thd->variables.max_sort_length); + if (use_strnxfrm((cs=sortorder->field->sort_charset()))) { *multi_byte_charset= true; @@ -1989,6 +1996,10 @@ sortlength(THD *thd, SORT_FIELD *sortorder, uint s_length, } else { + sortorder->type= sortorder->item->type_handler()->is_packable() ? + SORT_FIELD_ATTR::VARIABLE_SIZE : + SORT_FIELD_ATTR::FIXED_SIZE; + sortorder->item->type_handler()->sortlength(thd, sortorder->item, sortorder); if (use_strnxfrm(sortorder->item->collation.collation)) @@ -1998,7 +2009,8 @@ sortlength(THD *thd, SORT_FIELD *sortorder, uint s_length, if (sortorder->item->maybe_null) length++; // Place for NULL marker } - set_if_smaller(sortorder->length, thd->variables.max_sort_length); + if (sortorder->is_variable_sized()) + set_if_smaller(sortorder->length, thd->variables.max_sort_length); length+=sortorder->length; } sortorder->field= (Field*) 0; // end marker diff --git a/sql/handler.h b/sql/handler.h index 3b0cedfcd96..c516ea4bfc4 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -841,8 +841,10 @@ struct xid_t { void set(long f, const char *g, long gl, const char *b, long bl) { formatID= f; - memcpy(data, g, gtrid_length= gl); - memcpy(data+gl, b, bqual_length= bl); + if ((gtrid_length= gl)) + memcpy(data, g, gl); + if ((bqual_length= bl)) + memcpy(data+gl, b, bl); } void set(ulonglong xid) { diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 2904980c825..bf992886eda 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -866,6 +866,8 @@ int Arg_comparator::compare_decimal() { if (set_null) owner->null_value= 0; + val1.round_self_if_needed((*a)->decimals, HALF_UP); + val2.round_self_if_needed((*b)->decimals, HALF_UP); return val1.cmp(val2); } } @@ -888,6 +890,8 @@ int Arg_comparator::compare_e_decimal() VDec val1(*a), val2(*b); if (val1.is_null() || val2.is_null()) return MY_TEST(val1.is_null() && val2.is_null()); + val1.round_self_if_needed((*a)->decimals, HALF_UP); + val2.round_self_if_needed((*b)->decimals, HALF_UP); return MY_TEST(val1.cmp(val2) == 0); } diff --git a/sql/item_func.cc b/sql/item_func.cc index 7a15f919742..837156ce39a 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1481,14 +1481,13 @@ double Item_func_div::real_op() my_decimal *Item_func_div::decimal_op(my_decimal *decimal_value) { int err; - my_decimal tmp; VDec2_lazy val(args[0], args[1]); if ((null_value= val.has_null())) return 0; if ((err= check_decimal_overflow(my_decimal_div(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW & ~E_DEC_DIV_ZERO, - &tmp, + decimal_value, val.m_a.ptr(), val.m_b.ptr(), prec_increment))) > 3) { @@ -1497,7 +1496,6 @@ my_decimal *Item_func_div::decimal_op(my_decimal *decimal_value) null_value= 1; return 0; } - tmp.round_to(decimal_value, decimals, HALF_UP); return decimal_value; } @@ -3928,6 +3926,8 @@ int Interruptible_wait::wait(mysql_cond_t *cond, mysql_mutex_t *mutex) timeout= m_abs_timeout; error= mysql_cond_timedwait(cond, mutex, &timeout); + if (m_thd->check_killed()) + break; if (error == ETIMEDOUT || error == ETIME) { /* Return error if timed out or connection is broken. */ @@ -4774,7 +4774,8 @@ update_hash(user_var_entry *entry, bool set_null, void *ptr, size_t length, length--; // Fix length change above entry->value[length]= 0; // Store end \0 } - memmove(entry->value, ptr, length); + if (length) + memmove(entry->value, ptr, length); if (type == DECIMAL_RESULT) ((my_decimal*)entry->value)->fix_buffer_pointer(); entry->length= length; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index b980923d03d..e00fc2fd3ab 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2000, 2015, Oracle and/or its affiliates. - Copyright (c) 2008, 2015, MariaDB + Copyright (c) 2008, 2020, 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 @@ -472,7 +472,8 @@ Item_sum::Item_sum(THD *thd, Item_sum *item): if (!(orig_args= (Item**) thd->alloc(sizeof(Item*)*arg_count))) return; } - memcpy(orig_args, item->orig_args, sizeof(Item*)*arg_count); + if (arg_count) + memcpy(orig_args, item->orig_args, sizeof(Item*)*arg_count); init_aggregator(); with_distinct= item->with_distinct; if (item->aggr) @@ -1131,7 +1132,8 @@ Item_sum_num::fix_fields(THD *thd, Item **ref) check_sum_func(thd, ref)) return TRUE; - memcpy (orig_args, args, sizeof (Item *) * arg_count); + if (arg_count) + memcpy (orig_args, args, sizeof (Item *) * arg_count); fixed= 1; return FALSE; } @@ -1363,7 +1365,8 @@ Item_sum_sp::fix_fields(THD *thd, Item **ref) if (check_sum_func(thd, ref)) return TRUE; - memcpy(orig_args, args, sizeof(Item *) * arg_count); + if (arg_count) + memcpy(orig_args, args, sizeof(Item *) * arg_count); fixed= 1; return FALSE; } @@ -3779,7 +3782,8 @@ Item_func_group_concat(THD *thd, Name_resolution_context *context_arg, /* orig_args is only used for print() */ orig_args= (Item**) (order + arg_count_order); - memcpy(orig_args, args, sizeof(Item*) * arg_count); + if (arg_count) + memcpy(orig_args, args, sizeof(Item*) * arg_count); if (limit_clause) { row_limit= row_limit_arg; diff --git a/sql/lex_string.h b/sql/lex_string.h index 88a7154b064..b638e7111f8 100644 --- a/sql/lex_string.h +++ b/sql/lex_string.h @@ -34,12 +34,12 @@ static inline bool lex_string_cmp(CHARSET_INFO *charset, const LEX_CSTRING *a, static inline bool cmp(const LEX_CSTRING *a, const LEX_CSTRING *b) { - return (a->length != b->length || - memcmp(a->str, b->str, a->length)); + return a->length != b->length || + (a->length && memcmp(a->str, b->str, a->length)); } static inline bool cmp(const LEX_CSTRING a, const LEX_CSTRING b) { - return a.length != b.length || memcmp(a.str, b.str, a.length); + return a.length != b.length || (a.length && memcmp(a.str, b.str, a.length)); } /* diff --git a/sql/mf_iocache_encr.cc b/sql/mf_iocache_encr.cc index 072c0a48269..63830ec620a 100644 --- a/sql/mf_iocache_encr.cc +++ b/sql/mf_iocache_encr.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2015, MariaDB + Copyright (c) 2015, 2020, 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 @@ -85,7 +85,6 @@ static int my_b_encr_read(IO_CACHE *info, uchar *Buffer, size_t Count) do { - size_t copied; uint elength, wlength, length; uchar iv[MY_AES_BLOCK_SIZE]= {0}; @@ -116,11 +115,13 @@ static int my_b_encr_read(IO_CACHE *info, uchar *Buffer, size_t Count) DBUG_ASSERT(length <= info->buffer_length); - copied= MY_MIN(Count, (size_t)(length - pos_offset)); - - memcpy(Buffer, info->buffer + pos_offset, copied); - Count-= copied; - Buffer+= copied; + size_t copied= MY_MIN(Count, (size_t)(length - pos_offset)); + if (copied) + { + memcpy(Buffer, info->buffer + pos_offset, copied); + Count-= copied; + Buffer+= copied; + } info->read_pos= info->buffer + pos_offset + copied; info->read_end= info->buffer + length; diff --git a/sql/my_decimal.h b/sql/my_decimal.h index a7f6fc9e88d..9b1aebb98b5 100644 --- a/sql/my_decimal.h +++ b/sql/my_decimal.h @@ -207,15 +207,15 @@ public: { return to_string(to, 0, 0, 0); } - String *to_string_round(String *to, uint scale, my_decimal *round_buff) const + String *to_string_round(String *to, int scale, my_decimal *round_buff) const { (void) round_to(round_buff, scale, HALF_UP); // QQ: check result? return round_buff->to_string(to); } - int round_to(my_decimal *to, uint scale, decimal_round_mode mode, + int round_to(my_decimal *to, int scale, decimal_round_mode mode, int mask= E_DEC_FATAL_ERROR) const { - return check_result(mask, decimal_round(this, to, (int) scale, mode)); + return check_result(mask, decimal_round(this, to, scale, mode)); } int to_binary(uchar *bin, int prec, int scale, uint mask= E_DEC_FATAL_ERROR) const; diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 2156b877ace..7a45e59b6e4 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -15628,6 +15628,113 @@ static void print_ror_scans_arr(TABLE *table, const char *msg, DBUG_VOID_RETURN; } +static String dbug_print_sel_arg_buf; + +static void +print_sel_arg_key(Field *field, const uchar *key, String *out) +{ + TABLE *table= field->table; + my_bitmap_map *old_sets[2]; + dbug_tmp_use_all_columns(table, old_sets, table->read_set, table->write_set); + + if (field->real_maybe_null()) + { + if (*key) + { + out->append("NULL"); + goto end; + } + key++; // Skip null byte + } + + field->set_key_image(key, field->pack_length()); + + if (field->type() == MYSQL_TYPE_BIT) + (void) field->val_int_as_str(out, 1); + else + field->val_str(out); + +end: + dbug_tmp_restore_column_maps(table->read_set, table->write_set, old_sets); +} + + +/* + @brief + Produce a string representation of an individual SEL_ARG and return pointer + to it + + @detail + Intended usage: + + (gdb) p dbug_print_sel_arg(ptr) +*/ + +const char *dbug_print_sel_arg(SEL_ARG *sel_arg) +{ + StringBuffer<64> buf; + String &out= dbug_print_sel_arg_buf; + out.length(0); + + if (!sel_arg) + { + out.append("NULL"); + goto end; + } + + out.append("SEL_ARG("); + + const char *stype; + switch(sel_arg->type) { + case SEL_ARG::IMPOSSIBLE: + stype="IMPOSSIBLE"; + break; + case SEL_ARG::MAYBE: + stype="MAYBE"; + break; + case SEL_ARG::MAYBE_KEY: + stype="MAYBE_KEY"; + break; + case SEL_ARG::KEY_RANGE: + default: + stype= NULL; + } + + if (stype) + { + out.append("type="); + out.append(stype); + goto end; + } + + if (sel_arg->min_flag & NO_MIN_RANGE) + out.append("-inf"); + else + { + print_sel_arg_key(sel_arg->field, sel_arg->min_value, &buf); + out.append(buf); + } + + out.append((sel_arg->min_flag & NEAR_MIN)? "<" : "<="); + + out.append(sel_arg->field->field_name); + + out.append((sel_arg->max_flag & NEAR_MAX)? "<" : "<="); + + if (sel_arg->max_flag & NO_MAX_RANGE) + out.append("+inf"); + else + { + print_sel_arg_key(sel_arg->field, sel_arg->max_value, &buf); + out.append(buf); + } + + out.append(")"); + +end: + return dbug_print_sel_arg_buf.c_ptr_safe(); +} + /***************************************************************************** ** Print a quick range for debugging diff --git a/sql/opt_split.cc b/sql/opt_split.cc index c70fac49930..6807a623b73 100644 --- a/sql/opt_split.cc +++ b/sql/opt_split.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2017 MariaDB + Copyright (c) 2017, 2020, 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 @@ -751,13 +751,13 @@ void JOIN::add_keyuses_for_splitting() added_keyuse_count)) goto err; - memcpy(keyuse.buffer, - save_qep->keyuse.buffer, - (size_t) save_qep->keyuse.elements * keyuse.size_of_element); - keyuse.elements= save_qep->keyuse.elements; + idx= keyuse.elements= save_qep->keyuse.elements; + if (keyuse.elements) + memcpy(keyuse.buffer, + save_qep->keyuse.buffer, + (size_t) keyuse.elements * keyuse.size_of_element); keyuse_ext= &ext_keyuses_for_splitting->at(0); - idx= save_qep->keyuse.elements; for (i=0; i < added_keyuse_count; i++, keyuse_ext++, idx++) { set_dynamic(&keyuse, (KEYUSE *) keyuse_ext, idx); diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index 0a3c30a176d..af2d9ddc2e7 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -399,20 +399,28 @@ int opt_sum_query(THD *thd, break; } longlong info_limit= 1; - table->file->info_push(INFO_KIND_FORCE_LIMIT_BEGIN, &info_limit); - if (likely(!(error= table->file->ha_index_init((uint) ref.key, 1)))) - error= (is_max ? - get_index_max_value(table, &ref, range_fl) : - get_index_min_value(table, &ref, item_field, range_fl, - prefix_len)); + error= 0; + table->file->info_push(INFO_KIND_FORCE_LIMIT_BEGIN, &info_limit); + if (!table->const_table) + { + if (likely(!(error= table->file->ha_index_init((uint) ref.key, + 1)))) + error= (is_max ? + get_index_max_value(table, &ref, range_fl) : + get_index_min_value(table, &ref, item_field, range_fl, + prefix_len)); + } /* Verify that the read tuple indeed matches the search key */ if (!error && reckey_in_range(is_max, &ref, item_field->field, conds, range_fl, prefix_len)) error= HA_ERR_KEY_NOT_FOUND; - table->file->ha_end_keyread(); - table->file->ha_index_end(); + if (!table->const_table) + { + table->file->ha_end_keyread(); + table->file->ha_index_end(); + } table->file->info_push(INFO_KIND_FORCE_LIMIT_END, NULL); if (error) { diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 9648f8922c2..4be70abb7db 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2020,7 +2020,7 @@ retry_share: #ifdef WITH_WSREP if (!((flags & MYSQL_OPEN_IGNORE_FLUSH) || - (wsrep_on(thd) && thd->wsrep_applier))) + (thd->wsrep_applier))) #else if (!(flags & MYSQL_OPEN_IGNORE_FLUSH)) #endif diff --git a/sql/sql_class.cc b/sql/sql_class.cc index ab9a0118bde..041574485fe 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -4887,7 +4887,8 @@ extern "C" size_t thd_query_safe(MYSQL_THD thd, char *buf, size_t buflen) if (!mysql_mutex_trylock(&thd->LOCK_thd_data)) { len= MY_MIN(buflen - 1, thd->query_length()); - memcpy(buf, thd->query(), len); + if (len) + memcpy(buf, thd->query(), len); mysql_mutex_unlock(&thd->LOCK_thd_data); } buf[len]= '\0'; diff --git a/sql/sql_class.h b/sql/sql_class.h index fb22b0bcf6d..8c479db8936 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -6088,6 +6088,8 @@ struct SORT_FIELD_ATTR { uint length; /* Length of sort field */ uint suffix_length; /* Length suffix (0-4) */ + enum Type { FIXED_SIZE, VARIABLE_SIZE } type; + bool is_variable_sized() { return type == VARIABLE_SIZE; } }; diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc index e9ad53850dd..20ed976daab 100644 --- a/sql/sql_join_cache.cc +++ b/sql/sql_join_cache.cc @@ -1396,7 +1396,8 @@ uint JOIN_CACHE::write_record_data(uchar * link, bool *is_full) blob_field->get_image(cp, copy->length, blob_field->charset()); DBUG_ASSERT(cp + copy->length + copy->blob_length <= buff + buff_size); - memcpy(cp+copy->length, copy->str, copy->blob_length); + if (copy->blob_length) + memcpy(cp+copy->length, copy->str, copy->blob_length); cp+= copy->length+copy->blob_length; } break; diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index cc66ae6b853..00a45907f2f 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -9553,7 +9553,8 @@ bool LEX::new_sp_instr_stmt(THD *thd, qbuff.length= prefix.length + suffix.length; if (!(qbuff.str= (char*) alloc_root(thd->mem_root, qbuff.length + 1))) return true; - memcpy(qbuff.str, prefix.str, prefix.length); + if (prefix.length) + memcpy(qbuff.str, prefix.str, prefix.length); strmake(qbuff.str + prefix.length, suffix.str, suffix.length); i->m_query= qbuff; return sphead->add_instr(i); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 6eb147d0480..8cb25197ea2 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -104,6 +104,8 @@ #include "my_json_writer.h" +#define PRIV_LOCK_TABLES (SELECT_ACL | LOCK_TABLES_ACL) + #define FLAGSTR(V,F) ((V)&(F)?#F" ":"") #ifdef WITH_ARIA_STORAGE_ENGINE @@ -1101,7 +1103,6 @@ int bootstrap(MYSQL_FILE *file) thd->reset_kill_query(); /* Ensure that killed_errmsg is released */ free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); - free_root(&thd->transaction.mem_root,MYF(MY_KEEP_PREALLOC)); thd->lex->restore_set_statement_var(); } delete thd; @@ -2939,6 +2940,36 @@ retry: goto err; } } + /* + Check privileges of view tables here, after views were opened. + Either definer or invoker has to have PRIV_LOCK_TABLES to be able + to lock view and its tables. For mysqldump (that locks views + before dumping their structures) compatibility we allow locking + views that select from I_S or P_S tables, but downrade the lock + to TL_READ + */ + if (table->belong_to_view && + check_single_table_access(thd, PRIV_LOCK_TABLES, table, 1)) + { + if (table->grant.m_internal.m_schema_access) + table->lock_type= TL_READ; + else + { + bool error= true; + if (Security_context *sctx= table->security_ctx) + { + table->security_ctx= 0; + error= check_single_table_access(thd, PRIV_LOCK_TABLES, table, 1); + table->security_ctx= sctx; + } + if (error) + { + my_error(ER_VIEW_INVALID, MYF(0), table->belong_to_view->view_db.str, + table->belong_to_view->view_name.str); + goto err; + } + } + } } if (lock_tables(thd, tables, counter, 0) || @@ -5415,7 +5446,7 @@ mysql_execute_command(THD *thd) if (first_table && lex->type & (REFRESH_READ_LOCK|REFRESH_FOR_EXPORT)) { /* Check table-level privileges. */ - if (check_table_access(thd, LOCK_TABLES_ACL | SELECT_ACL, all_tables, + if (check_table_access(thd, PRIV_LOCK_TABLES, all_tables, FALSE, UINT_MAX, FALSE)) goto error; @@ -6755,7 +6786,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, @param thd Thread handler @param privilege requested privilege - @param all_tables global table list of query + @param tables global table list of query @param no_errors FALSE/TRUE - report/don't report error to the client (using my_error() call). @@ -6765,28 +6796,25 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, 1 access denied, error is sent to client */ -bool check_single_table_access(THD *thd, ulong privilege, - TABLE_LIST *all_tables, bool no_errors) +bool check_single_table_access(THD *thd, ulong privilege, TABLE_LIST *tables, + bool no_errors) { - Switch_to_definer_security_ctx backup_sctx(thd, all_tables); + Switch_to_definer_security_ctx backup_sctx(thd, tables); const char *db_name; - if ((all_tables->view || all_tables->field_translation) && - !all_tables->schema_table) - db_name= all_tables->view_db.str; + if ((tables->view || tables->field_translation) && !tables->schema_table) + db_name= tables->view_db.str; else - db_name= all_tables->db.str; + db_name= tables->db.str; - if (check_access(thd, privilege, db_name, - &all_tables->grant.privilege, - &all_tables->grant.m_internal, - 0, no_errors)) + if (check_access(thd, privilege, db_name, &tables->grant.privilege, + &tables->grant.m_internal, 0, no_errors)) return 1; /* Show only 1 table for check_grant */ - if (!(all_tables->belong_to_view && - (thd->lex->sql_command == SQLCOM_SHOW_FIELDS)) && - check_grant(thd, privilege, all_tables, FALSE, 1, no_errors)) + if (!(tables->belong_to_view && + (thd->lex->sql_command == SQLCOM_SHOW_FIELDS)) && + check_grant(thd, privilege, tables, FALSE, 1, no_errors)) return 1; return 0; @@ -9870,7 +9898,7 @@ static bool lock_tables_precheck(THD *thd, TABLE_LIST *tables) if (is_temporary_table(table)) continue; - if (check_table_access(thd, LOCK_TABLES_ACL | SELECT_ACL, table, + if (check_table_access(thd, PRIV_LOCK_TABLES, table, FALSE, 1, FALSE)) return TRUE; } diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index bf011bd2236..59a7586364a 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -127,6 +127,9 @@ When one supplies long data for a placeholder: #include "wsrep_trans_observer.h" #endif /* WITH_WSREP */ +/* Constants defining bits in parameter type flags. Flags are read from high byte of short value */ +static const uint PARAMETER_FLAG_UNSIGNED = 128U << 8; + /** A result class used to send cursor rows using the binary protocol. */ @@ -953,11 +956,73 @@ static bool insert_bulk_params(Prepared_statement *stmt, DBUG_RETURN(0); } -static bool set_conversion_functions(Prepared_statement *stmt, - uchar **data, uchar *data_end) + +/** + Checking if parameter type and flags are valid + + @param typecode ushort value with type in low byte, and flags in high byte + + @retval true this parameter is wrong + @retval false this parameter is OK +*/ + +static bool +parameter_type_sanity_check(ushort typecode) +{ + /* Checking if type in lower byte is valid */ + switch (typecode & 0xff) { + case MYSQL_TYPE_DECIMAL: + case MYSQL_TYPE_NEWDECIMAL: + case MYSQL_TYPE_TINY: + case MYSQL_TYPE_SHORT: + case MYSQL_TYPE_LONG: + case MYSQL_TYPE_LONGLONG: + case MYSQL_TYPE_INT24: + case MYSQL_TYPE_YEAR: + case MYSQL_TYPE_BIT: + case MYSQL_TYPE_FLOAT: + case MYSQL_TYPE_DOUBLE: + case MYSQL_TYPE_NULL: + case MYSQL_TYPE_VARCHAR: + case MYSQL_TYPE_TINY_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_LONG_BLOB: + case MYSQL_TYPE_BLOB: + case MYSQL_TYPE_VAR_STRING: + case MYSQL_TYPE_STRING: + case MYSQL_TYPE_ENUM: + case MYSQL_TYPE_SET: + case MYSQL_TYPE_GEOMETRY: + case MYSQL_TYPE_TIMESTAMP: + case MYSQL_TYPE_DATE: + case MYSQL_TYPE_TIME: + case MYSQL_TYPE_DATETIME: + case MYSQL_TYPE_NEWDATE: + break; + /* + This types normally cannot be sent by client, so maybe it'd be + better to treat them like an error here. + */ + case MYSQL_TYPE_TIMESTAMP2: + case MYSQL_TYPE_TIME2: + case MYSQL_TYPE_DATETIME2: + default: + return true; + }; + + // In Flags in high byte only unsigned bit may be set + if (typecode & ((~PARAMETER_FLAG_UNSIGNED) & 0x0000ff00)) + { + return true; + } + return false; +} + +static bool +set_conversion_functions(Prepared_statement *stmt, uchar **data) { uchar *read_pos= *data; - const uint signed_bit= 1 << 15; + DBUG_ENTER("set_conversion_functions"); /* First execute or types altered by the client, setup the @@ -970,12 +1035,17 @@ static bool set_conversion_functions(Prepared_statement *stmt, { ushort typecode; - if (read_pos >= data_end) - DBUG_RETURN(1); - + /* + stmt_execute_packet_sanity_check has already verified, that there + are enough data in the packet for data types + */ typecode= sint2korr(read_pos); read_pos+= 2; - (**it).unsigned_flag= MY_TEST(typecode & signed_bit); + if (parameter_type_sanity_check(typecode)) + { + DBUG_RETURN(1); + } + (**it).unsigned_flag= MY_TEST(typecode & PARAMETER_FLAG_UNSIGNED); (*it)->setup_conversion(thd, (uchar) (typecode & 0xff)); (*it)->sync_clones(); } @@ -985,7 +1055,7 @@ static bool set_conversion_functions(Prepared_statement *stmt, static bool setup_conversion_functions(Prepared_statement *stmt, - uchar **data, uchar *data_end, + uchar **data, bool bulk_protocol= 0) { /* skip null bits */ @@ -998,7 +1068,7 @@ static bool setup_conversion_functions(Prepared_statement *stmt, if (*read_pos++) //types supplied / first execute { *data= read_pos; - bool res= set_conversion_functions(stmt, data, data_end); + bool res= set_conversion_functions(stmt, data); DBUG_RETURN(res); } *data= read_pos; @@ -3149,11 +3219,19 @@ static void mysql_stmt_execute_common(THD *thd, void mysqld_stmt_execute(THD *thd, char *packet_arg, uint packet_length) { + const uint packet_min_lenght= 9; uchar *packet= (uchar*)packet_arg; // GCC 4.0.1 workaround + + DBUG_ENTER("mysqld_stmt_execute"); + + if (packet_length < packet_min_lenght) + { + my_error(ER_MALFORMED_PACKET, MYF(0)); + DBUG_VOID_RETURN; + } ulong stmt_id= uint4korr(packet); ulong flags= (ulong) packet[4]; uchar *packet_end= packet + packet_length; - DBUG_ENTER("mysqld_stmt_execute"); packet+= 9; /* stmt_id + 5 bytes of flags */ @@ -3209,6 +3287,84 @@ void mysqld_stmt_bulk_execute(THD *thd, char *packet_arg, uint packet_length) DBUG_VOID_RETURN; } +/** + Additional packet checks for direct execution + + @param thd THD handle + @param stmt prepared statement being directly executed + @param paket packet with parameters to bind + @param packet_end pointer to the byte after parameters end + @param bulk_op is it bulk operation + @param direct_exec is it direct execution + @param read_bytes need to read types (only with bulk_op) + + @retval true this parameter is wrong + @retval false this parameter is OK +*/ + +static bool +stmt_execute_packet_sanity_check(Prepared_statement *stmt, + uchar *packet, uchar *packet_end, + bool bulk_op, bool direct_exec, + bool read_types) +{ + + DBUG_ASSERT((!read_types) || (read_types && bulk_op)); + if (stmt->param_count > 0) + { + uint packet_length= static_cast<uint>(packet_end - packet); + uint null_bitmap_bytes= (bulk_op ? 0 : (stmt->param_count + 7)/8); + uint min_len_for_param_count = null_bitmap_bytes + + (bulk_op ? 0 : 1); /* sent types byte */ + + if (!bulk_op && packet_length >= min_len_for_param_count) + { + if ((read_types= packet[null_bitmap_bytes])) + { + /* + Should be 0 or 1. If the byte is not 1, that could mean, + e.g. that we read incorrect byte due to incorrect number + of sent parameters for direct execution (i.e. null bitmap + is shorter or longer, than it should be) + */ + if (packet[null_bitmap_bytes] != '\1') + { + return true; + } + } + } + + if (read_types) + { + /* 2 bytes per parameter of the type and flags */ + min_len_for_param_count+= 2*stmt->param_count; + } + else + { + /* + If types are not sent, there is nothing to do here. + But for direct execution types should always be sent + */ + return direct_exec; + } + + /* + If true, the packet is guaranteed too short for the number of + parameters in the PS + */ + return (packet_length < min_len_for_param_count); + } + else + { + /* + If there is no parameters, this should be normally already end + of the packet. If it's not - then error + */ + return (packet_end > packet); + } + return false; +} + /** Common part of prepared statement execution @@ -3248,6 +3404,22 @@ static void mysql_stmt_execute_common(THD *thd, llstr(stmt_id, llbuf), "mysqld_stmt_execute"); DBUG_VOID_RETURN; } + + /* + In case of direct execution application decides how many parameters + to send. + + Thus extra checks are required to prevent crashes caused by incorrect + interpretation of the packet data. Plus there can be always a broken + evil client. + */ + if (stmt_execute_packet_sanity_check(stmt, packet, packet_end, bulk_op, + stmt_id == LAST_STMT_ID, read_types)) + { + my_error(ER_MALFORMED_PACKET, MYF(0)); + DBUG_VOID_RETURN; + } + stmt->read_types= read_types; #if defined(ENABLED_PROFILING) @@ -4160,7 +4332,7 @@ Prepared_statement::set_parameters(String *expanded_query, { #ifndef EMBEDDED_LIBRARY uchar *null_array= packet; - res= (setup_conversion_functions(this, &packet, packet_end) || + res= (setup_conversion_functions(this, &packet) || set_params(this, null_array, packet, packet_end, expanded_query)); #else /* @@ -4360,7 +4532,7 @@ Prepared_statement::execute_bulk_loop(String *expanded_query, #ifndef EMBEDDED_LIBRARY if (read_types && - set_conversion_functions(this, &packet, packet_end)) + set_conversion_functions(this, &packet)) #else // bulk parameters are not supported for embedded, so it will an error #endif diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 8c27b023c93..7c729769cd2 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -27798,10 +27798,10 @@ JOIN::reoptimize(Item *added_where, table_map join_tables, if (save_to) { DBUG_ASSERT(!keyuse.elements); - memcpy(keyuse.buffer, - save_to->keyuse.buffer, - (size_t) save_to->keyuse.elements * keyuse.size_of_element); keyuse.elements= save_to->keyuse.elements; + if (size_t e= keyuse.elements) + memcpy(keyuse.buffer, + save_to->keyuse.buffer, e * keyuse.size_of_element); } /* Add the new access methods to the keyuse array. */ diff --git a/sql/sql_string.cc b/sql/sql_string.cc index c97b8a9a830..e3f4497274c 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2016, MariaDB + Copyright (c) 2016, 2020, 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 @@ -237,8 +237,8 @@ bool Binary_string::copy(const Binary_string &str) { if (alloc(str.str_length)) return TRUE; - str_length=str.str_length; - bmove(Ptr,str.Ptr,str_length); // May be overlapping + if ((str_length=str.str_length)) + bmove(Ptr,str.Ptr,str_length); // May be overlapping Ptr[str_length]=0; return FALSE; } @@ -574,8 +574,11 @@ bool Binary_string::append_ulonglong(ulonglong val) bool String::append(const char *s, size_t arg_length, CHARSET_INFO *cs) { + if (!arg_length) + return false; + uint32 offset; - + if (needs_conversion((uint32)arg_length, cs, charset(), &offset)) { size_t add_length; diff --git a/sql/sql_type.h b/sql/sql_type.h index c1b13dfa811..939c651233c 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -230,7 +230,7 @@ class Dec_ptr_and_buffer: public Dec_ptr protected: my_decimal m_buffer; public: - int round_to(my_decimal *to, uint scale, decimal_round_mode mode) + int round_to(my_decimal *to, int scale, decimal_round_mode mode) { DBUG_ASSERT(m_ptr); return m_ptr->round_to(to, scale, mode); @@ -239,6 +239,14 @@ public: { return round_to(&m_buffer, scale, mode); } + int round_self_if_needed(int scale, decimal_round_mode mode) + { + if (scale >= m_ptr->frac) + return E_DEC_OK; + int res= m_ptr->round_to(&m_buffer, scale, mode); + m_ptr= &m_buffer; + return res; + } String *to_string_round(String *to, uint dec) { /* @@ -3647,6 +3655,8 @@ public: const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const= 0; + virtual bool is_packable() const { return false; } + virtual uint32 max_display_length(const Item *item) const= 0; virtual uint32 Item_decimal_notation_int_digits(const Item *item) const { return 0; } virtual uint32 calc_pack_length(uint32 length) const= 0; @@ -4788,7 +4798,11 @@ public: void sortlength(THD *thd, const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; + + bool is_packable()const { return true; } + bool union_element_finalize(const Item * item) const; + bool Column_definition_prepare_stage1(THD *thd, MEM_ROOT *mem_root, Column_definition *c, diff --git a/sql/sys_vars.ic b/sql/sys_vars.ic index 9ab424b3f8d..50e2ec46222 100644 --- a/sql/sys_vars.ic +++ b/sql/sys_vars.ic @@ -726,7 +726,11 @@ public: { DBUG_ASSERT(FALSE); } void global_save_default(THD *thd, set_var *var) - { DBUG_ASSERT(FALSE); } + { + char *ptr= (char*)(intptr)option.def_value; + var->save_result.string_value.str= ptr; + var->save_result.string_value.length= ptr ? strlen(ptr) : 0; + } bool session_update(THD *thd, set_var *var) { diff --git a/sql/table.h b/sql/table.h index 264ece6ac6d..6073e35fa85 100644 --- a/sql/table.h +++ b/sql/table.h @@ -3237,7 +3237,8 @@ inline void mark_as_null_row(TABLE *table) { table->null_row=1; table->status|=STATUS_NULL_ROW; - bfill(table->null_flags,table->s->null_bytes,255); + if (table->s->null_bytes) + bfill(table->null_flags,table->s->null_bytes,255); } bool is_simple_order(ORDER *order); diff --git a/sql/unireg.cc b/sql/unireg.cc index beb754ed852..41481d253ee 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -981,8 +981,11 @@ static bool pack_fields(uchar **buff_arg, List<Create_field> &create_fields, it.rewind(); while ((field=it++)) { - memcpy(buff, field->comment.str, field->comment.length); - buff+= field->comment.length; + if (size_t l= field->comment.length) + { + memcpy(buff, field->comment.str, l); + buff+= l; + } } } *buff_arg= buff; diff --git a/sql/unireg.h b/sql/unireg.h index 8e9fa27ea6a..cac290c7806 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -76,7 +76,8 @@ #define cmp_record(A,B) memcmp((A)->record[0],(A)->B,(size_t) (A)->s->reclength) #define empty_record(A) { \ restore_record((A),s->default_values); \ - bfill((A)->null_flags,(A)->s->null_bytes,255);\ + if ((A)->s->null_bytes) \ + bfill((A)->null_flags,(A)->s->null_bytes,255); \ } /* Defines for use with openfrm, openprt and openfrd */ diff --git a/storage/blackhole/ha_blackhole.h b/storage/blackhole/ha_blackhole.h index 6ee30877b64..e827cd25bfc 100644 --- a/storage/blackhole/ha_blackhole.h +++ b/storage/blackhole/ha_blackhole.h @@ -20,6 +20,7 @@ #include "thr_lock.h" /* THR_LOCK */ #include "handler.h" /* handler */ #include "table.h" /* TABLE_SHARE */ +#include "sql_const.h" /* MAX_KEY */ /* Shared structure for correct LOCK operation @@ -65,9 +66,9 @@ public: HA_READ_ORDER | HA_KEYREAD_ONLY); } /* The following defines can be increased if necessary */ -#define BLACKHOLE_MAX_KEY 64 /* Max allowed keys */ +#define BLACKHOLE_MAX_KEY MAX_KEY /* Max allowed keys */ #define BLACKHOLE_MAX_KEY_SEG 16 /* Max segments for key */ -#define BLACKHOLE_MAX_KEY_LENGTH 1000 +#define BLACKHOLE_MAX_KEY_LENGTH 3500 /* Like in InnoDB */ uint max_supported_keys() const { return BLACKHOLE_MAX_KEY; } uint max_supported_key_length() const { return BLACKHOLE_MAX_KEY_LENGTH; } uint max_supported_key_part_length() const { return BLACKHOLE_MAX_KEY_LENGTH; } diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 00a0f4f6270..f8bf8804246 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -4532,14 +4532,13 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, const char *dbn, bool case TAB_DIR: case TAB_ZIP: case TAB_OEM: - if (table && table->pos_in_table_list) // if SELECT - { + if (table && table->pos_in_table_list) { // if SELECT #if MYSQL_VERSION_ID > 100200 Switch_to_definer_security_ctx backup_ctx(thd, table->pos_in_table_list); #endif // VERSION_ID > 100200 + return check_global_access(thd, FILE_ACL); - } - else + } else return check_global_access(thd, FILE_ACL); case TAB_ODBC: case TAB_JDBC: @@ -4555,7 +4554,7 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, const char *dbn, bool case TAB_VIR: // This is temporary until a solution is found return false; - } // endswitch type + } // endswitch type my_printf_error(ER_UNKNOWN_ERROR, "check_privileges failed", MYF(0)); return true; diff --git a/storage/maria/ma_create.c b/storage/maria/ma_create.c index 3bf5dbd8a29..ba147f08b45 100644 --- a/storage/maria/ma_create.c +++ b/storage/maria/ma_create.c @@ -1168,6 +1168,7 @@ int maria_create(const char *name, enum data_file_type datafile_type, FALSE, TRUE)) goto err; my_free(log_data); + log_data= 0; } if (!(flags & HA_DONT_TOUCH_DATA)) diff --git a/storage/myisam/mi_key.c b/storage/myisam/mi_key.c index 2909f5998e1..7d263d9fc7b 100644 --- a/storage/myisam/mi_key.c +++ b/storage/myisam/mi_key.c @@ -144,8 +144,11 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, set_if_smaller(length,tmp_length); FIX_LENGTH(cs, pos, length, char_length); store_key_length_inc(key,char_length); - memcpy(key, pos, char_length); - key+= char_length; + if (char_length) + { + memcpy(key, pos, char_length); + key+= char_length; + } continue; } else if (keyseg->flag & HA_SWAP_KEY) diff --git a/storage/perfschema/pfs_setup_object.cc b/storage/perfschema/pfs_setup_object.cc index f33030e927f..8da9fccc65f 100644 --- a/storage/perfschema/pfs_setup_object.cc +++ b/storage/perfschema/pfs_setup_object.cc @@ -144,12 +144,18 @@ static void set_setup_object_key(PFS_setup_object_key *key, char *ptr= &key->m_hash_key[0]; ptr[0]= (char) object_type; ptr++; - memcpy(ptr, schema, schema_length); - ptr+= schema_length; + if (schema_length) + { + memcpy(ptr, schema, schema_length); + ptr+= schema_length; + } ptr[0]= 0; ptr++; - memcpy(ptr, object, object_length); - ptr+= object_length; + if (object_length) + { + memcpy(ptr, object, object_length); + ptr+= object_length; + } ptr[0]= 0; ptr++; key->m_key_length= (uint)(ptr - &key->m_hash_key[0]); diff --git a/storage/tokudb/mysql-test/tokudb/r/type_newdecimal.result b/storage/tokudb/mysql-test/tokudb/r/type_newdecimal.result index 17229fa5956..ad920deeda4 100644 --- a/storage/tokudb/mysql-test/tokudb/r/type_newdecimal.result +++ b/storage/tokudb/mysql-test/tokudb/r/type_newdecimal.result @@ -1533,8 +1533,11 @@ select (1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 * 1.01500000 * 1.01500000 * 0.99500000) 0.81298807395367312459230693948000000000 create table t1 as select 5.05 / 0.014; +Warnings: +Note 1265 Data truncated for column '5.05 / 0.014' at row 1 show warnings; Level Code Message +Note 1265 Data truncated for column '5.05 / 0.014' at row 1 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -1649,6 +1652,8 @@ my_col 0.12345678912345678912345678912345678912 DROP TABLE t1; CREATE TABLE t1 SELECT 1 / .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS my_col; +Warnings: +Note 1265 Data truncated for column 'my_col' at row 1 DESCRIBE t1; Field Type Null Key Default Extra my_col decimal(65,4) YES NULL diff --git a/storage/tokudb/mysql-test/tokudb/r/type_ranges.result b/storage/tokudb/mysql-test/tokudb/r/type_ranges.result index e915d56f21f..38252e870df 100644 --- a/storage/tokudb/mysql-test/tokudb/r/type_ranges.result +++ b/storage/tokudb/mysql-test/tokudb/r/type_ranges.result @@ -92,6 +92,8 @@ DROP INDEX test ON t1; insert into t1 values (10, 1,1,1,1,1,1,1,1,1,1,1,1,1,NULL,0,0,0,1,1,1,1,'one','one'); insert into t1 values (NULL,2,2,2,2,2,2,2,2,2,2,2,2,2,NULL,NULL,NULL,NULL,NULL,NULL,2,2,'two','two,one'); insert into t1 values (0,1/3,3,3,3,3,3,3,3,3,3,3,3,3,NULL,'19970303','10:10:10','19970303101010','','','','3',3,3); +Warnings: +Warning 1265 Data truncated for column 'string' at row 1 insert into t1 values (0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,NULL,19970807,080706,19970403090807,-1,-1,-1,'-1',-1,-1); Warnings: Warning 1264 Out of range value for column 'utiny' at row 1 @@ -129,7 +131,7 @@ select auto,string,tiny,short,medium,long_int,longlong,real_float,real_double,ut auto string tiny short medium long_int longlong real_float real_double utiny ushort umedium ulong ulonglong mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000) date_field time_field date_time blob_col tinyblob_col mediumblob_col longblob_col 10 1 1 1 1 1 1 1.0 1.0000 1 00001 1 1 1 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 1 1 1 11 2 2 2 2 2 2 2.0 2.0000 2 00002 2 2 2 0 NULL NULL NULL NULL NULL 2 2 -12 0.3333 3 3 3 3 3 3.0 3.0000 3 00003 3 3 3 0 1997-03-03 10:10:10 1997-03-03 10:10:10 3 +12 0.33333333 3 3 3 3 3 3.0 3.0000 3 00003 3 3 3 0 1997-03-03 10:10:10 1997-03-03 10:10:10 3 13 -1 -1 -1 -1 -1 -1 -1.0 -1.0000 0 00000 0 0 0 0 1997-08-07 08:07:06 1997-04-03 09:08:07 -1 -1 -1 -1 14 -429496729 -128 -32768 -8388608 -2147483648 -4294967295 -4294967296.0 -4294967295.0000 0 00000 0 0 0 0 0000-00-00 00:00:00 0000-00-00 00:00:00 -4294967295 -4294967295 -4294967295 -4294967295 15 4294967295 127 32767 8388607 2147483647 4294967295 4294967296.0 4294967295.0000 255 65535 16777215 4294967295 4294967295 0 0000-00-00 00:00:00 0000-00-00 00:00:00 4294967295 4294967295 4294967295 4294967295 @@ -181,7 +183,7 @@ Warning 1265 Data truncated for column 'new_field' at row 7 select * from t2; auto string mediumblob_col new_field 1 2 2 ne -2 0.3333 ne +2 0.33333333 ne 3 -1 -1 ne 4 -429496729 -4294967295 ne 5 4294967295 4294967295 ne diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index 0324c0665e2..bc0d794db3d 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -1,6 +1,6 @@ /* Copyright (c) 2002-2007 MySQL AB & tommy@valley.ne.jp Copyright (c) 2002, 2014, Oracle and/or its affiliates. - Copyright (c) 2009, 2014, SkySQL Ab. + Copyright (c) 2009, 2020, MariaDB Corporation. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -399,7 +399,7 @@ my_strnxfrm_8bit_bin(CHARSET_INFO *cs, { set_if_smaller(srclen, dstlen); set_if_smaller(srclen, nweights); - if (dst != src) + if (srclen && dst != src) memcpy(dst, src, srclen); return my_strxfrm_pad_desc_and_reverse(cs, dst, dst + srclen, dst + dstlen, (uint)(nweights - srclen), flags, 0); diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index cbf50c638fd..afc5771d6c5 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -553,9 +553,11 @@ int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)), alloced= a= (uchar*) my_malloc(a_length+b_length+2, MYF(MY_FAE)); b= a + a_length+1; - memcpy((char*) a, (char*) a0, a_length); + if (a_length) + memcpy((char*) a, (char*) a0, a_length); a[a_length]= 0; /* if length(a0)> len1, need to put 'end of string' */ - memcpy((char *)b, (char *)b0, b_length); + if (b_length) + memcpy((char *)b, (char *)b0, b_length); b[b_length]= 0; /* put end of string */ a_length= thai2sortable(a, a_length); b_length= thai2sortable(b, b_length); diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 1f0ad42f6ea..393bf342dd5 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -20941,6 +20941,153 @@ static void test_explain_meta() } +#ifndef EMBEDDED_LIBRARY +#define MDEV19838_MAX_PARAM_COUNT 32 +#define MDEV19838_FIELDS_COUNT 17 +static void test_mdev19838() +{ + int rc; + MYSQL_BIND bind[MDEV19838_MAX_PARAM_COUNT]; + unsigned int i, paramCount = 1; + char charvalue[] = "012345678901234567890123456789012345"; + MYSQL_STMT *stmt; + + myheader("test_mdev19838"); + + rc = mysql_query(mysql, "CREATE TABLE mdev19838(" + "f1 char(36)," + "f2 char(36)," + "f3 char(36)," + "f4 char(36)," + "f5 char(36)," + "f6 char(36)," + "f7 char(36)," + "f8 char(36)," + "f9 char(36)," + "f10 char(36)," + "f11 char(36)," + "f12 char(36)," + "f13 char(36)," + "f14 char(36)," + "f15 char(36)," + "f16 char(36)," + "f17 char(36)" + ")"); + myquery(rc); + + stmt = mysql_stmt_init(mysql); + check_stmt(stmt); + + memset(bind, 0, sizeof(bind)); + + for (i = 0; i < MDEV19838_MAX_PARAM_COUNT; ++i) + { + bind[i].buffer = charvalue; + bind[i].buffer_type = MYSQL_TYPE_STRING; + bind[i].buffer_length = strlen(charvalue) + 1; + bind[i].length = &bind[i].length_value; + bind[i].length_value = bind[i].buffer_length - 1; + } + + for (paramCount = 1; paramCount < MDEV19838_FIELDS_COUNT; ++paramCount) + { + mysql_stmt_attr_set(stmt, STMT_ATTR_PREBIND_PARAMS, ¶mCount); + + rc = mysql_stmt_bind_param(stmt, bind); + check_execute(stmt, rc); + + rc = mariadb_stmt_execute_direct(stmt, "INSERT INTO mdev19838" + "(f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, f16, f17)" + " VALUES " + "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", -1); + + /* Expecting an error */ + DIE_UNLESS(rc != 0); + + mysql_stmt_close(stmt); + stmt = mysql_stmt_init(mysql); + check_stmt(stmt); + } + + paramCount = 0; + mysql_stmt_attr_set(stmt, STMT_ATTR_PREBIND_PARAMS, ¶mCount); + rc = mariadb_stmt_execute_direct(stmt, "INSERT INTO mdev19838(f1)" + " VALUES (?)", -1); + /* Expecting an error */ + DIE_UNLESS(rc != 0); + mysql_stmt_close(stmt); + + stmt = mysql_stmt_init(mysql); + check_stmt(stmt); + /* Correct number of parameters */ + paramCount = MDEV19838_FIELDS_COUNT; + mysql_stmt_attr_set(stmt, STMT_ATTR_PREBIND_PARAMS, ¶mCount); + mysql_stmt_bind_param(stmt, bind); + + rc = mariadb_stmt_execute_direct(stmt, "INSERT INTO mdev19838" + "(f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, f16, f17)" + " VALUES " + "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", -1); + check_execute(stmt, rc); + + /* MYSQL_TYPE_TINY = 1. This parameter byte can be read as "parameters send" flag byte. + Checking that wrong packet is still detected */ + bind[0].buffer_type = MYSQL_TYPE_TINY; + bind[0].length_value = 1; + bind[0].buffer_length = 1; + + for (paramCount = 8; paramCount > 0; --paramCount) + { + mysql_stmt_close(stmt); + stmt = mysql_stmt_init(mysql); + check_stmt(stmt); + + mysql_stmt_attr_set(stmt, STMT_ATTR_PREBIND_PARAMS, ¶mCount); + + rc = mysql_stmt_bind_param(stmt, bind); + check_execute(stmt, rc); + + rc = mariadb_stmt_execute_direct(stmt, "INSERT INTO mdev19838" + "(f1, f2, f3, f4, f5, f6, f7, f8, f9)" + " VALUES " + "(?, ?, ?, ?, ?, ?, ?, ?, ?)", -1); + + /* Expecting an error */ + DIE_UNLESS(rc != 0); + } + + /* Test of query w/out parameters, with parameter sent and not sent */ + for (paramCount = MDEV19838_MAX_PARAM_COUNT; paramCount != (unsigned int)-1; --paramCount) + { + mysql_stmt_close(stmt); + stmt = mysql_stmt_init(mysql); + check_stmt(stmt); + + mysql_stmt_attr_set(stmt, STMT_ATTR_PREBIND_PARAMS, ¶mCount); + + if (paramCount > 0) + { + rc = mysql_stmt_bind_param(stmt, bind); + check_execute(stmt, rc); + } + + rc = mariadb_stmt_execute_direct(stmt, "INSERT INTO mdev19838" + "(f1)" + " VALUES " + "(0x1111111111111111)", -1); + + /* Expecting an error if parameters are sent */ + DIE_UNLESS(rc != 0 || paramCount == 0); + } + + mysql_stmt_close(stmt); + + rc = mysql_query(mysql, "drop table mdev19838"); + myquery(rc); +} +#endif // EMBEDDED_LIBRARY + + /* MDEV-20261 NULL passed to String::eq, SEGV, server crash, regression in 10.4 */ @@ -21280,6 +21427,9 @@ static struct my_tests_st my_tests[]= { #endif { "test_ps_params_in_ctes", test_ps_params_in_ctes }, { "test_explain_meta", test_explain_meta }, +#ifndef EMBEDDED_LIBRARY + { "test_mdev19838", test_mdev19838 }, +#endif { "test_mdev18408", test_mdev18408 }, { "test_mdev20261", test_mdev20261 }, { 0, 0 } |