diff options
387 files changed, 9146 insertions, 3402 deletions
@@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=10 -MYSQL_VERSION_MINOR=6 -MYSQL_VERSION_PATCH=5 -SERVER_MATURITY=stable +MYSQL_VERSION_MINOR=7 +MYSQL_VERSION_PATCH=1 +SERVER_MATURITY=gamma diff --git a/client/client_priv.h b/client/client_priv.h index ee33a0b0f99..23b2e6782a1 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -104,6 +104,7 @@ enum options_client OPT_SHUTDOWN_WAIT_FOR_SLAVES, OPT_COPY_S3_TABLES, OPT_PRINT_TABLE_METADATA, + OPT_ASOF_TIMESTAMP, OPT_MAX_CLIENT_OPTION /* should be always the last */ }; diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 0ac2c8b5853..d35591cd71c 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -70,7 +70,7 @@ static char **defaults_argv; static my_bool not_used; /* Can't use GET_BOOL without a value pointer */ -char upgrade_from_version[sizeof("10.20.456-MariaDB")+1]; +char upgrade_from_version[1024]; static my_bool opt_write_binlog; diff --git a/client/mysqldump.c b/client/mysqldump.c index 17e793d3a9e..a73f06d592a 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -129,7 +129,7 @@ static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0, opt_no_data_m opt_include_master_host_port= 0, opt_events= 0, opt_comments_used= 0, opt_alltspcs=0, opt_notspcs= 0, opt_logging, - opt_drop_trigger= 0 ; + opt_drop_trigger= 0; #define OPT_SYSTEM_ALL 1 #define OPT_SYSTEM_USERS 2 #define OPT_SYSTEM_PLUGINS 4 @@ -155,7 +155,7 @@ static char *opt_password=0,*current_user=0, *lines_terminated=0, *enclosed=0, *opt_enclosed=0, *escaped=0, *where=0, *order_by=0, *err_ptr= 0, - *log_error_file= NULL; + *log_error_file= NULL, *opt_asof_timestamp= NULL; static const char *opt_compatible_mode_str= 0; static char **defaults_argv= 0; static char compatible_mode_normal_str[255]; @@ -278,6 +278,9 @@ static struct my_option my_long_options[] = "Adds 'STOP SLAVE' prior to 'CHANGE MASTER' and 'START SLAVE' to bottom of dump.", &opt_slave_apply, &opt_slave_apply, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"as-of", OPT_ASOF_TIMESTAMP, + "Dump system versioned table as of specified timestamp.", + &opt_asof_timestamp, &opt_asof_timestamp, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"character-sets-dir", OPT_CHARSETS_DIR, "Directory for character set files.", (char **)&charsets_dir, (char **)&charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -1325,6 +1328,12 @@ static int get_options(int *argc, char ***argv) my_progname_short); return(EX_USAGE); } + if (opt_asof_timestamp && strchr(opt_asof_timestamp, '\'')) + { + fprintf(stderr, "%s: Incorrect DATETIME value: '%s'\n", + my_progname_short, opt_asof_timestamp); + return(EX_USAGE); + } if (strcmp(default_charset, MYSQL_AUTODETECT_CHARSET_NAME) && !(charset_info= get_charset_by_csname(default_charset, MY_CS_PRIMARY, @@ -3039,7 +3048,7 @@ static void get_sequence_structure(const char *seq, const char *db) */ static uint get_table_structure(const char *table, const char *db, char *table_type, - char *ignore_flag) + char *ignore_flag, my_bool *versioned) { my_bool init=0, delayed, write_data, complete_insert; my_ulonglong num_fields; @@ -3106,6 +3115,26 @@ static uint get_table_structure(const char *table, const char *db, char *table_t verbose_msg("-- Retrieving table structure for table %s...\n", table); + if (versioned) + { + if (!opt_asof_timestamp) + versioned= NULL; + else + { + my_snprintf(query_buff, sizeof(query_buff), "select 1 from" + " information_schema.tables where table_schema=database()" + " and table_name=%s and table_type='SYSTEM VERSIONED'", + quote_for_equal(table, table_buff)); + if (!mysql_query_with_error_report(mysql, &result, query_buff)) + { + *versioned= result->row_count > 0; + mysql_free_result(result); + } + else + *versioned= 0; + } + } + len= my_snprintf(query_buff, sizeof(query_buff), "SET SQL_QUOTE_SHOW_CREATE=%d", (opt_quoted || opt_keywords)); @@ -3383,9 +3412,10 @@ static uint get_table_structure(const char *table, const char *db, char *table_t } else { - dynstr_append_checked(&insert_pat, " VALUES "); - if (!extended_insert) - dynstr_append_checked(&insert_pat, "("); + if (extended_insert) + dynstr_append_checked(&insert_pat, " VALUES\n"); + else + dynstr_append_checked(&insert_pat, " VALUES ("); } } @@ -3991,6 +4021,15 @@ static char *alloc_query_str(size_t size) } +static void vers_append_system_time(DYNAMIC_STRING* query_string) +{ + DBUG_ASSERT(opt_asof_timestamp); + dynstr_append_checked(query_string, " FOR SYSTEM_TIME AS OF TIMESTAMP '"); + dynstr_append_checked(query_string, opt_asof_timestamp); + dynstr_append_checked(query_string, "'"); +} + + /* SYNOPSIS @@ -4018,6 +4057,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key, ulong rownr, row_break; uint num_fields; size_t total_length, init_length; + my_bool versioned= 0; MYSQL_RES *res; MYSQL_FIELD *field; @@ -4028,7 +4068,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key, Make sure you get the create table info before the following check for --no-data flag below. Otherwise, the create table info won't be printed. */ - num_fields= get_table_structure(table, db, table_type, &ignore_flag); + num_fields= get_table_structure(table, db, table_type, &ignore_flag, &versioned); /* The "table" could be a view. If so, we don't do anything here. @@ -4135,6 +4175,8 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key, dynstr_append_checked(&query_string, " FROM "); dynstr_append_checked(&query_string, result_table); + if (versioned) + vers_append_system_time(&query_string); if (where) { @@ -4167,6 +4209,8 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key, dynstr_append_checked(&query_string, select_field_names.str); dynstr_append_checked(&query_string, " FROM "); dynstr_append_checked(&query_string, result_table); + if (versioned) + vers_append_system_time(&query_string); if (where) { @@ -4444,7 +4488,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key, if (total_length + row_length < opt_net_buffer_length) { total_length+= row_length; - fputc(',',md_result_file); /* Always row break */ + fputs(",\n",md_result_file); /* Always row break */ fputs(extended_row.str,md_result_file); } else @@ -5637,21 +5681,21 @@ static int dump_all_tables_in_db(char *database) if (general_log_table_exists) { if (!get_table_structure((char *) "general_log", - database, table_type, &ignore_flag) ) + database, table_type, &ignore_flag, NULL) ) verbose_msg("-- Warning: get_table_structure() failed with some internal " "error for 'general_log' table\n"); } if (slow_log_table_exists) { if (!get_table_structure((char *) "slow_log", - database, table_type, &ignore_flag) ) + database, table_type, &ignore_flag, NULL) ) verbose_msg("-- Warning: get_table_structure() failed with some internal " "error for 'slow_log' table\n"); } if (transaction_registry_table_exists) { if (!get_table_structure((char *) "transaction_registry", - database, table_type, &ignore_flag) ) + database, table_type, &ignore_flag, NULL) ) verbose_msg("-- Warning: get_table_structure() failed with some internal " "error for 'transaction_registry' table\n"); } diff --git a/config.h.cmake b/config.h.cmake index 80721592ab0..44ae067daad 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -179,6 +179,7 @@ #cmakedefine HAVE_MLOCKALL 1 #cmakedefine HAVE_MMAP 1 #cmakedefine HAVE_MMAP64 1 +#cmakedefine HAVE_MPROTECT 1 #cmakedefine HAVE_PERROR 1 #cmakedefine HAVE_POLL 1 #cmakedefine HAVE_POSIX_FALLOCATE 1 diff --git a/configure.cmake b/configure.cmake index bfb79ef3217..740bf812304 100644 --- a/configure.cmake +++ b/configure.cmake @@ -375,6 +375,7 @@ CHECK_FUNCTION_EXISTS (mlock HAVE_MLOCK) CHECK_FUNCTION_EXISTS (mlockall HAVE_MLOCKALL) CHECK_FUNCTION_EXISTS (mmap HAVE_MMAP) CHECK_FUNCTION_EXISTS (mmap64 HAVE_MMAP64) +CHECK_FUNCTION_EXISTS (mprotect HAVE_MPROTECT) CHECK_FUNCTION_EXISTS (perror HAVE_PERROR) CHECK_FUNCTION_EXISTS (poll HAVE_POLL) CHECK_FUNCTION_EXISTS (posix_fallocate HAVE_POSIX_FALLOCATE) diff --git a/debian/additions/mariadb.conf.d/50-server.cnf b/debian/additions/mariadb.conf.d/50-server.cnf index 1d9344c756a..6bbb995c4b9 100644 --- a/debian/additions/mariadb.conf.d/50-server.cnf +++ b/debian/additions/mariadb.conf.d/50-server.cnf @@ -111,7 +111,7 @@ collation-server = utf8mb4_general_ci # you can put MariaDB-only options here [mariadb] -# This group is only read by MariaDB-10.6 servers. +# This group is only read by MariaDB-10.7 servers. # If you use the same .cnf file for MariaDB of different versions, # use this group for options that older servers don't understand -[mariadb-10.6] +[mariadb-10.7] diff --git a/debian/additions/source_mariadb-10.6.py b/debian/additions/source_mariadb-10.7.py index 43b1f35373e..d126a9a28d3 100644 --- a/debian/additions/source_mariadb-10.6.py +++ b/debian/additions/source_mariadb-10.7.py @@ -1,4 +1,4 @@ -'''apport package hook for mariadb-10.6 +'''apport package hook for mariadb-10.7 (c) 2009 Canonical Ltd. Author: Mathias Gug <mathias.gug@canonical.com> @@ -21,7 +21,7 @@ def _add_my_conf_files(report, filename): continue def add_info(report): - attach_conffiles(report, 'mariadb-server-10.6', conffiles=None) + attach_conffiles(report, 'mariadb-server-10.7', conffiles=None) key = 'Logs' + path_to_key('/var/log/daemon.log') report[key] = "" for line in read_file('/var/log/daemon.log').split('\n'): diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index 46686827b94..e695d27b4c2 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -50,7 +50,7 @@ then sed "/Package: mariadb-plugin-rocksdb/,/^$/d" -i debian/control sed "/Package: mariadb-plugin-spider/,/^$/d" -i debian/control sed "/Package: mariadb-plugin-oqgraph/,/^$/d" -i debian/control - sed "/ha_sphinx.so/d" -i debian/mariadb-server-10.6.install + sed "/ha_sphinx.so/d" -i debian/mariadb-server-10.7.install sed "/Package: libmariadbd19/,/^$/d" -i debian/control sed "/Package: libmariadbd-dev/,/^$/d" -i debian/control fi diff --git a/debian/changelog b/debian/changelog index 08065467bdc..59109117207 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,5 @@ -mariadb-10.6 (1:10.6.0) unstable; urgency=medium +mariadb-10.7 (1:10.7.0) unstable; urgency=medium * Initial Release - -- Otto Kekäläinen <otto@debian.org> Thu, 14 May 2020 18:00:57 +0300 + -- VicenÈ›iu Ciorbaru <vicentiu@mariadb.org> Thu, 18 Jun 2021 16:08:00 +0300 diff --git a/debian/control b/debian/control index 8576c1025f0..9cf0a8fae0e 100644 --- a/debian/control +++ b/debian/control @@ -1,4 +1,4 @@ -Source: mariadb-10.6 +Source: mariadb-10.7 Section: database Priority: optional Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net> @@ -259,7 +259,7 @@ Description: MariaDB common configuration files . This package includes configuration files common to all MariaDB programs. -Package: mariadb-client-core-10.6 +Package: mariadb-client-core-10.7 Architecture: any Depends: libmariadb3 (>= 10.5.4), mariadb-common (>= ${source:Version}), @@ -271,7 +271,8 @@ Conflicts: mariadb-client-10.0, mariadb-client-10.3, mariadb-client-10.4, mariadb-client-10.5, - mariadb-client-10.6 (<< ${source:Version}), + mariadb-client-10.6, + mariadb-client-10.7 (<< ${source:Version}), mariadb-client-5.1, mariadb-client-5.2, mariadb-client-5.3, @@ -282,6 +283,7 @@ Conflicts: mariadb-client-10.0, mariadb-client-core-10.3, mariadb-client-core-10.4, mariadb-client-core-10.5, + mariadb-client-core-10.6, mariadb-client-core-5.1, mariadb-client-core-5.2, mariadb-client-core-5.3, @@ -304,7 +306,8 @@ Breaks: mariadb-server-10.0, mariadb-server-core-10.3, mariadb-server-core-10.4, mariadb-server-core-10.5, - mariadb-server-core-10.6 (<< ${source:Version}), + mariadb-server-core-10.6, + mariadb-server-core-10.7 (<< ${source:Version}), mysql-server-core-5.5, mysql-server-core-5.6, mysql-server-core-5.7, @@ -318,7 +321,8 @@ Replaces: mariadb-client-10.0, mariadb-client-10.3, mariadb-client-10.4, mariadb-client-10.5, - mariadb-client-10.6 (<< ${source:Version}), + mariadb-client-10.6, + mariadb-client-10.7 (<< ${source:Version}), mariadb-client-5.1, mariadb-client-5.2, mariadb-client-5.3, @@ -329,6 +333,7 @@ Replaces: mariadb-client-10.0, mariadb-client-core-10.3, mariadb-client-core-10.4, mariadb-client-core-10.5, + mariadb-client-core-10.6, mariadb-client-core-5.1, mariadb-client-core-5.2, mariadb-client-core-5.3, @@ -341,7 +346,8 @@ Replaces: mariadb-client-10.0, mariadb-server-core-10.3, mariadb-server-core-10.4, mariadb-server-core-10.5, - mariadb-server-core-10.6 (<< ${source:Version}), + mariadb-server-core-10.6, + mariadb-server-core-10.7 (<< ${source:Version}), mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-5.1, @@ -369,10 +375,10 @@ Description: MariaDB database core client binaries . This package includes the core client files, as used by Akonadi. -Package: mariadb-client-10.6 +Package: mariadb-client-10.7 Architecture: any Depends: debianutils (>=1.6), - mariadb-client-core-10.6 (>= ${source:Version}), + mariadb-client-core-10.7 (>= ${source:Version}), mariadb-common, ${misc:Depends}, ${perl:Depends}, @@ -384,7 +390,8 @@ Conflicts: mariadb-client (<< ${source:Version}), mariadb-client-10.3, mariadb-client-10.4, mariadb-client-10.5, - mariadb-client-10.6 (<< ${source:Version}), + mariadb-client-10.6, + mariadb-client-10.7 (<< ${source:Version}), mariadb-client-5.1, mariadb-client-5.2, mariadb-client-5.3, @@ -410,21 +417,24 @@ Breaks: mariadb-client-core-10.0, mariadb-client-core-10.3, mariadb-client-core-10.4, mariadb-client-core-10.5, - mariadb-client-core-10.6 (<< ${source:Version}), + mariadb-client-core-10.6, + mariadb-client-core-10.7 (<< ${source:Version}), mariadb-server-10.0, mariadb-server-10.1, mariadb-server-10.2, mariadb-server-10.3, mariadb-server-10.4, mariadb-server-10.5, - mariadb-server-10.6 (<< ${source:Version}), + mariadb-server-10.6, + mariadb-server-10.7 (<< ${source:Version}), mariadb-server-core-10.0, mariadb-server-core-10.1, mariadb-server-core-10.2, mariadb-server-core-10.3, mariadb-server-core-10.4, mariadb-server-core-10.5, - mariadb-server-core-10.6 (<< ${source:Version}), + mariadb-server-core-10.6, + mariadb-server-core-10.7 (<< ${source:Version}), mysql-server-5.5, mysql-server-5.6, mysql-server-5.7, @@ -443,6 +453,7 @@ Replaces: mariadb-client (<< ${source:Version}), mariadb-client-10.3, mariadb-client-10.4, mariadb-client-10.5, + mariadb-client-10.6, mariadb-client-5.1, mariadb-client-5.2, mariadb-client-5.3, @@ -453,21 +464,24 @@ Replaces: mariadb-client (<< ${source:Version}), mariadb-client-core-10.3, mariadb-client-core-10.4, mariadb-client-core-10.5, - mariadb-client-core-10.6 (<< ${source:Version}), + mariadb-client-core-10.6, + mariadb-client-core-10.7 (<< ${source:Version}), mariadb-server-10.0, mariadb-server-10.1, mariadb-server-10.2, mariadb-server-10.3, mariadb-server-10.4, mariadb-server-10.5, - mariadb-server-10.6 (<< ${source:Version}), + mariadb-server-10.6, + mariadb-server-10.7 (<< ${source:Version}), mariadb-server-core-10.0, mariadb-server-core-10.1, mariadb-server-core-10.2, mariadb-server-core-10.3, mariadb-server-core-10.4, mariadb-server-core-10.5, - mariadb-server-core-10.6 (<< ${source:Version}), + mariadb-server-core-10.6, + mariadb-server-core-10.7 (<< ${source:Version}), mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-5.1, @@ -508,7 +522,7 @@ Description: MariaDB database client binaries This package includes the client binaries and the additional tools innotop and mariadb-report (mysqlreport). -Package: mariadb-server-core-10.6 +Package: mariadb-server-core-10.7 Architecture: any Depends: mariadb-common (>= ${source:Version}), ${misc:Depends}, @@ -537,13 +551,15 @@ Breaks: mariadb-client-10.0, mariadb-client-10.3, mariadb-client-10.4, mariadb-client-10.5, - mariadb-client-10.6 (<< ${source:Version}), + mariadb-client-10.6, + mariadb-client-10.7 (<< ${source:Version}), mariadb-server-10.0, mariadb-server-10.1, mariadb-server-10.3, mariadb-server-10.4, mariadb-server-10.5, - mariadb-server-10.6 (<< ${source:Version}), + mariadb-server-10.6, + mariadb-server-10.7 (<< ${source:Version}), mysql-client-5.5, mysql-server-5.5, mysql-server-5.6, @@ -558,13 +574,15 @@ Replaces: mariadb-client-10.0, mariadb-client-10.3, mariadb-client-10.4, mariadb-client-10.5, - mariadb-client-10.6 (<< ${source:Version}), + mariadb-client-10.6, + mariadb-client-10.7 (<< ${source:Version}), mariadb-server-10.0, mariadb-server-10.1, mariadb-server-10.3, mariadb-server-10.4, mariadb-server-10.5, - mariadb-server-10.6 (<< ${source:Version}), + mariadb-server-10.6, + mariadb-server-10.7 (<< ${source:Version}), mariadb-server-core-10.0, mariadb-server-core-10.1, mariadb-server-core-10.2, @@ -601,7 +619,7 @@ Description: MariaDB database core server files . This package includes the core server files, as used by Akonadi. -Package: mariadb-server-10.6 +Package: mariadb-server-10.7 Architecture: any Suggests: mailx, mariadb-test, @@ -616,8 +634,8 @@ Depends: galera-4 (>=26.4), libdbi-perl, lsb-base (>= 3.0-10), lsof [linux-any], - mariadb-client-10.6 (>= ${source:Version}), - mariadb-server-core-10.6 (>= ${source:Version}), + mariadb-client-10.7 (>= ${source:Version}), + mariadb-server-core-10.7 (>= ${source:Version}), passwd, perl (>= 5.6), procps, @@ -664,7 +682,8 @@ Replaces: handlersocket-mysql-5.5, libmariadbclient-dev (<< 5.5.0), libmariadbclient16, mariadb-client-10.5, - mariadb-client-10.6 (<< ${source:Version}), + mariadb-client-10.6, + mariadb-client-10.7 (<< ${source:Version}), mariadb-server (<< ${source:Version}), mariadb-server-10.0, mariadb-server-10.1, @@ -705,11 +724,11 @@ Description: MariaDB database server binaries Package: mariadb-server Architecture: all -Depends: mariadb-server-10.6 (>= ${source:Version}), +Depends: mariadb-server-10.7 (>= ${source:Version}), ${misc:Depends} Description: MariaDB database server (metapackage depending on the latest version) This is an empty package that depends on the current "best" version of - mariadb-server (currently mariadb-server-10.6), as determined by the MariaDB + mariadb-server (currently mariadb-server-10.7), as determined by the MariaDB maintainers. Install this package if in doubt about which MariaDB version you need. That will install the version recommended by the package maintainers. @@ -721,11 +740,11 @@ Description: MariaDB database server (metapackage depending on the latest versio Package: mariadb-client Architecture: all -Depends: mariadb-client-10.6 (>= ${source:Version}), +Depends: mariadb-client-10.7 (>= ${source:Version}), ${misc:Depends} Description: MariaDB database client (metapackage depending on the latest version) This is an empty package that depends on the current "best" version of - mariadb-client (currently mariadb-client-10.6), as determined by the MariaDB + mariadb-client (currently mariadb-client-10.7), as determined by the MariaDB maintainers. Install this package if in doubt about which MariaDB version you want, as this is the one considered to be in the best shape. @@ -737,7 +756,7 @@ Breaks: mariadb-backup-10.1, Replaces: mariadb-backup-10.1, mariadb-backup-10.2, mariadb-client-10.1 -Depends: mariadb-client-core-10.6 (= ${binary:Version}), +Depends: mariadb-client-core-10.7 (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} Description: Backup tool for MariaDB server @@ -750,7 +769,7 @@ Description: Backup tool for MariaDB server Package: mariadb-plugin-connect Architecture: any Depends: libxml2, - mariadb-server-10.6 (= ${server:Version}), + mariadb-server-10.7 (= ${server:Version}), unixodbc, ${misc:Depends}, ${shlibs:Depends} @@ -773,7 +792,7 @@ Description: Connect storage engine for MariaDB Package: mariadb-plugin-s3 Architecture: any Depends: libcurl4, - mariadb-server-10.6 (= ${server:Version}), + mariadb-server-10.7 (= ${server:Version}), ${misc:Depends}, ${shlibs:Depends} Description: Amazon S3 archival storage engine for MariaDB @@ -783,7 +802,7 @@ Description: Amazon S3 archival storage engine for MariaDB Package: mariadb-plugin-rocksdb Architecture: amd64 arm64 mips64el ppc64el -Depends: mariadb-server-10.6 (= ${server:Version}), +Depends: mariadb-server-10.7 (= ${server:Version}), python3, rocksdb-tools, ${misc:Depends}, @@ -803,7 +822,7 @@ Description: RocksDB storage engine for MariaDB Package: mariadb-plugin-oqgraph Architecture: any Depends: libjudydebian1, - mariadb-server-10.6 (= ${server:Version}), + mariadb-server-10.7 (= ${server:Version}), ${misc:Depends}, ${shlibs:Depends} Breaks: mariadb-oqgraph-engine-10.0, @@ -823,7 +842,7 @@ Description: OQGraph storage engine for MariaDB Package: mariadb-plugin-mroonga Architecture: any-alpha any-amd64 any-arm any-arm64 any-i386 any-ia64 any-mips64el any-mips64r6el any-mipsel any-mipsr6el any-nios2 any-powerpcel any-ppc64el any-sh3 any-sh4 any-tilegx -Depends: mariadb-server-10.6 (= ${server:Version}), +Depends: mariadb-server-10.7 (= ${server:Version}), ${misc:Depends}, ${shlibs:Depends} Breaks: mariadb-server-10.0, @@ -843,7 +862,7 @@ Description: Mroonga storage engine for MariaDB Package: mariadb-plugin-spider Architecture: any -Depends: mariadb-server-10.6 (= ${server:Version}), +Depends: mariadb-server-10.7 (= ${server:Version}), ${misc:Depends}, ${shlibs:Depends} Breaks: mariadb-server-10.0, @@ -865,7 +884,7 @@ Description: Spider storage engine for MariaDB Package: mariadb-plugin-gssapi-server Architecture: any Depends: libgssapi-krb5-2, - mariadb-server-10.6, + mariadb-server-10.7, ${misc:Depends}, ${shlibs:Depends} Breaks: mariadb-gssapi-server-10.1, @@ -886,7 +905,7 @@ Package: mariadb-plugin-gssapi-client Architecture: any Multi-Arch: same Depends: libgssapi-krb5-2, - mariadb-client-10.6 (= ${binary:Version}), + mariadb-client-10.7 (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} Breaks: mariadb-gssapi-client-10.1, @@ -906,7 +925,7 @@ Description: GSSAPI authentication plugin for MariaDB client Package: mariadb-plugin-cracklib-password-check Architecture: any Depends: libcrack2 (>= 2.9.0), - mariadb-server-10.6, + mariadb-server-10.7, ${misc:Depends}, ${shlibs:Depends} Description: CrackLib Password Validation Plugin for MariaDB @@ -917,8 +936,8 @@ Description: CrackLib Password Validation Plugin for MariaDB Package: mariadb-test Architecture: any -Depends: mariadb-client-10.6 (= ${binary:Version}), - mariadb-server-10.6 (= ${server:Version}), +Depends: mariadb-client-10.7 (= ${binary:Version}), + mariadb-server-10.7 (= ${server:Version}), mariadb-test-data (= ${source:Version}), virtual-mysql-testsuite, ${misc:Depends}, diff --git a/debian/mariadb-client-10.6.README.Debian b/debian/mariadb-client-10.7.README.Debian index 64f0f509951..64f0f509951 100644 --- a/debian/mariadb-client-10.6.README.Debian +++ b/debian/mariadb-client-10.7.README.Debian diff --git a/debian/mariadb-client-10.6.docs b/debian/mariadb-client-10.7.docs index c09092629c3..c09092629c3 100644 --- a/debian/mariadb-client-10.6.docs +++ b/debian/mariadb-client-10.7.docs diff --git a/debian/mariadb-client-10.6.install b/debian/mariadb-client-10.7.install index 3a92ded15b6..3a92ded15b6 100644 --- a/debian/mariadb-client-10.6.install +++ b/debian/mariadb-client-10.7.install diff --git a/debian/mariadb-client-10.6.links b/debian/mariadb-client-10.7.links index bc42197629b..bc42197629b 100644 --- a/debian/mariadb-client-10.6.links +++ b/debian/mariadb-client-10.7.links diff --git a/debian/mariadb-client-10.6.manpages b/debian/mariadb-client-10.7.manpages index 8735caeea8b..8735caeea8b 100644 --- a/debian/mariadb-client-10.6.manpages +++ b/debian/mariadb-client-10.7.manpages diff --git a/debian/mariadb-client-10.6.menu b/debian/mariadb-client-10.7.menu index 90280215b8b..edd489cf316 100644 --- a/debian/mariadb-client-10.6.menu +++ b/debian/mariadb-client-10.7.menu @@ -1,3 +1,3 @@ # According to /usr/share/menu/ policy 1.4, not /usr/share/doc/debian-policy/ -?package(mariadb-client-10.6):needs="text" section="Applications/Data Management"\ +?package(mariadb-client-10.7):needs="text" section="Applications/Data Management"\ title="Innotop" command="/usr/bin/innotop" diff --git a/debian/mariadb-client-core-10.6.install b/debian/mariadb-client-core-10.7.install index 421b62d2a1a..421b62d2a1a 100644 --- a/debian/mariadb-client-core-10.6.install +++ b/debian/mariadb-client-core-10.7.install diff --git a/debian/mariadb-client-core-10.6.links b/debian/mariadb-client-core-10.7.links index 5134dd814b5..5134dd814b5 100644 --- a/debian/mariadb-client-core-10.6.links +++ b/debian/mariadb-client-core-10.7.links diff --git a/debian/mariadb-server-10.6.README.Debian b/debian/mariadb-server-10.7.README.Debian index 6042249a706..6042249a706 100644 --- a/debian/mariadb-server-10.6.README.Debian +++ b/debian/mariadb-server-10.7.README.Debian diff --git a/debian/mariadb-server-10.6.config b/debian/mariadb-server-10.7.config index 27e2e9f4929..f47b147ee62 100644 --- a/debian/mariadb-server-10.6.config +++ b/debian/mariadb-server-10.7.config @@ -9,6 +9,6 @@ ${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 } # Beware that there are two ypwhich one of them needs the 2>/dev/null! if test -n "`which ypwhich 2>/dev/null`" && ypwhich >/dev/null 2>&1; then - db_input high mariadb-server-10.6/nis_warning || true + db_input high mariadb-server-10.7/nis_warning || true db_go fi diff --git a/debian/mariadb-server-10.6.dirs b/debian/mariadb-server-10.7.dirs index 5057fe806c3..5057fe806c3 100644 --- a/debian/mariadb-server-10.6.dirs +++ b/debian/mariadb-server-10.7.dirs diff --git a/debian/mariadb-server-10.6.install b/debian/mariadb-server-10.7.install index 4d15f5d8e54..4a3e13f831f 100644 --- a/debian/mariadb-server-10.6.install +++ b/debian/mariadb-server-10.7.install @@ -3,7 +3,7 @@ debian/additions/debian-start.inc.sh usr/share/mysql debian/additions/echo_stderr usr/share/mysql debian/additions/mariadb.conf.d/50-mysqld_safe.cnf etc/mysql/mariadb.conf.d debian/additions/mariadb.conf.d/50-server.cnf etc/mysql/mariadb.conf.d -debian/additions/source_mariadb-10.6.py usr/share/apport/package-hooks +debian/additions/source_mariadb-10.7.py usr/share/apport/package-hooks etc/apparmor.d/usr.sbin.mariadbd etc/security/user_map.conf lib/*/security/pam_user_map.so @@ -52,7 +52,7 @@ usr/lib/mysql/plugin/simple_password_check.so usr/lib/mysql/plugin/sql_errlog.so usr/lib/mysql/plugin/type_mysql_json.so usr/lib/mysql/plugin/wsrep_info.so -usr/share/doc/mariadb-server-10.6/mariadbd.sym.gz +usr/share/doc/mariadb-server-10.7/mariadbd.sym.gz usr/share/man/man1/aria_chk.1 usr/share/man/man1/aria_dump_log.1 usr/share/man/man1/aria_ftdump.1 diff --git a/debian/mariadb-server-10.6.links b/debian/mariadb-server-10.7.links index 9cc3a436ba8..9cc3a436ba8 100644 --- a/debian/mariadb-server-10.6.links +++ b/debian/mariadb-server-10.7.links diff --git a/debian/mariadb-server-10.6.logcheck.ignore.paranoid b/debian/mariadb-server-10.7.logcheck.ignore.paranoid index 407d4063270..407d4063270 100644 --- a/debian/mariadb-server-10.6.logcheck.ignore.paranoid +++ b/debian/mariadb-server-10.7.logcheck.ignore.paranoid diff --git a/debian/mariadb-server-10.6.logcheck.ignore.server b/debian/mariadb-server-10.7.logcheck.ignore.server index a64fc54e15c..a64fc54e15c 100644 --- a/debian/mariadb-server-10.6.logcheck.ignore.server +++ b/debian/mariadb-server-10.7.logcheck.ignore.server diff --git a/debian/mariadb-server-10.6.logcheck.ignore.workstation b/debian/mariadb-server-10.7.logcheck.ignore.workstation index a64fc54e15c..a64fc54e15c 100644 --- a/debian/mariadb-server-10.6.logcheck.ignore.workstation +++ b/debian/mariadb-server-10.7.logcheck.ignore.workstation diff --git a/debian/mariadb-server-10.6.mariadb.init b/debian/mariadb-server-10.7.mariadb.init index a16e9f88edb..d2a11d6471e 100644 --- a/debian/mariadb-server-10.6.mariadb.init +++ b/debian/mariadb-server-10.7.mariadb.init @@ -165,7 +165,7 @@ case "${1:-''}" in if ! mariadbd_status check_dead warn; then log_end_msg 1 - log_failure_msg "Please stop MariaDB manually and read /usr/share/doc/mariadb-server-10.6/README.Debian.gz!" + log_failure_msg "Please stop MariaDB manually and read /usr/share/doc/mariadb-server-10.7/README.Debian.gz!" exit -1 else log_end_msg 0 diff --git a/debian/mariadb-server-10.6.mysql-server.logrotate b/debian/mariadb-server-10.7.mysql-server.logrotate index 4111a276dc3..4111a276dc3 100644 --- a/debian/mariadb-server-10.6.mysql-server.logrotate +++ b/debian/mariadb-server-10.7.mysql-server.logrotate diff --git a/debian/mariadb-server-10.6.mysql.default b/debian/mariadb-server-10.7.mysql.default index 36079edecb2..36079edecb2 100644 --- a/debian/mariadb-server-10.6.mysql.default +++ b/debian/mariadb-server-10.7.mysql.default diff --git a/debian/mariadb-server-10.6.postinst b/debian/mariadb-server-10.7.postinst index 431607c2993..23fa348693b 100644 --- a/debian/mariadb-server-10.6.postinst +++ b/debian/mariadb-server-10.7.postinst @@ -161,7 +161,7 @@ EOF # Clean up old flags before setting new one rm -f $mysql_datadir/debian-*.flag # Flag data dir to avoid downgrades - touch $mysql_datadir/debian-10.6.flag + touch $mysql_datadir/debian-10.7.flag # initiate databases. Output is not allowed by debconf :-( # This will fail if we are upgrading an existing database; in this case diff --git a/debian/mariadb-server-10.6.postrm b/debian/mariadb-server-10.7.postrm index 97789a038df..97789a038df 100644 --- a/debian/mariadb-server-10.6.postrm +++ b/debian/mariadb-server-10.7.postrm diff --git a/debian/mariadb-server-10.6.preinst b/debian/mariadb-server-10.7.preinst index 919031066c9..919031066c9 100644 --- a/debian/mariadb-server-10.6.preinst +++ b/debian/mariadb-server-10.7.preinst diff --git a/debian/mariadb-server-10.6.prerm b/debian/mariadb-server-10.7.prerm index 8fd172da9d2..8fd172da9d2 100644 --- a/debian/mariadb-server-10.6.prerm +++ b/debian/mariadb-server-10.7.prerm diff --git a/debian/mariadb-server-10.6.templates b/debian/mariadb-server-10.7.templates index 32e908c71e9..916baf0d483 100644 --- a/debian/mariadb-server-10.6.templates +++ b/debian/mariadb-server-10.7.templates @@ -7,7 +7,7 @@ # Even minor modifications require translation updates and such # changes should be coordinated with translators and reviewers. -Template: mariadb-server-10.6/old_data_directory_saved +Template: mariadb-server-10.7/old_data_directory_saved Type: note _Description: The old data directory will be saved at new location A file named /var/lib/mysql/debian-*.flag exists on this system. @@ -19,7 +19,7 @@ _Description: The old data directory will be saved at new location . Please manually export/import your data (e.g. with mysqldump) if needed. -Template: mariadb-server-10.6/nis_warning +Template: mariadb-server-10.7/nis_warning Type: note #flag:translate!:3,5 _Description: Important note for NIS/YP users @@ -33,7 +33,7 @@ _Description: Important note for NIS/YP users . /var/lib/mysql: drwxr-xr-x mysql mysql -Template: mariadb-server-10.6/postrm_remove_databases +Template: mariadb-server-10.7/postrm_remove_databases Type: boolean Default: false _Description: Remove all MariaDB databases? diff --git a/debian/mariadb-server-10.6.triggers b/debian/mariadb-server-10.7.triggers index d1f5f5e14f1..d1f5f5e14f1 100644 --- a/debian/mariadb-server-10.6.triggers +++ b/debian/mariadb-server-10.7.triggers diff --git a/debian/mariadb-server-core-10.6.install b/debian/mariadb-server-core-10.7.install index f760f34e3f7..f760f34e3f7 100644 --- a/debian/mariadb-server-core-10.6.install +++ b/debian/mariadb-server-core-10.7.install diff --git a/debian/mariadb-server-core-10.6.links b/debian/mariadb-server-core-10.7.links index c2be98f38fb..c2be98f38fb 100644 --- a/debian/mariadb-server-core-10.6.links +++ b/debian/mariadb-server-core-10.7.links diff --git a/debian/not-installed b/debian/not-installed index 6924c9ad1a5..ff05d1827ef 100644 --- a/debian/not-installed +++ b/debian/not-installed @@ -16,15 +16,15 @@ usr/lib/*/libdbbc.a # ColumnStore header file usr/lib/*/libidbboot.a # ColumnStore header file usr/lib/*/libprocessor.a # ColumnStore header file usr/lib/*/libwe_xml.a # ColumnStore header file -usr/share/doc/mariadb-server-10.6/COPYING -usr/share/doc/mariadb-server-10.6/COPYING.AGPLv3 -usr/share/doc/mariadb-server-10.6/COPYING.GPLv2 -usr/share/doc/mariadb-server-10.6/COPYING.thirdparty -usr/share/doc/mariadb-server-10.6/CREDITS -usr/share/doc/mariadb-server-10.6/EXCEPTIONS-CLIENT -usr/share/doc/mariadb-server-10.6/INSTALL-BINARY -usr/share/doc/mariadb-server-10.6/PATENTS -usr/share/doc/mariadb-server-10.6/README-wsrep +usr/share/doc/mariadb-server-10.7/COPYING +usr/share/doc/mariadb-server-10.7/COPYING.AGPLv3 +usr/share/doc/mariadb-server-10.7/COPYING.GPLv2 +usr/share/doc/mariadb-server-10.7/COPYING.thirdparty +usr/share/doc/mariadb-server-10.7/CREDITS +usr/share/doc/mariadb-server-10.7/EXCEPTIONS-CLIENT +usr/share/doc/mariadb-server-10.7/INSTALL-BINARY +usr/share/doc/mariadb-server-10.7/PATENTS +usr/share/doc/mariadb-server-10.7/README-wsrep usr/share/groonga/COPYING usr/share/groonga-normalizer-mysql/lgpl-2.0.txt usr/share/groonga-normalizer-mysql/README.md diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in index 17bbe40ee92..d96402785cc 100644 --- a/debian/po/POTFILES.in +++ b/debian/po/POTFILES.in @@ -1 +1 @@ -[type: gettext/rfc822deb] mariadb-server-10.6.templates +[type: gettext/rfc822deb] mariadb-server-10.7.templates diff --git a/debian/po/ar.po b/debian/po/ar.po index 8512209efbb..b4a2ff0aab3 100644 --- a/debian/po/ar.po +++ b/debian/po/ar.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: templates\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2007-05-01 13:04+0300\n" "Last-Translator: Ossama M. Khayat <okhayat@yahoo.com>\n" @@ -27,13 +27,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -42,7 +42,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -50,20 +50,20 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "Important note for NIS/YP users" msgstr "ملاØظة هامة لمستخدمي NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -71,7 +71,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 #, fuzzy #| msgid "" #| "You should also check the permissions and the owner of the /var/lib/mysql " @@ -83,13 +83,13 @@ msgstr "عليك أيضاً أن تقوم بالتأكد من صلاØيات Ù…Ø #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "إزالة جميع قواعد بيانات MariaDBØŸ" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -97,7 +97,7 @@ msgstr "الدليل /var/lib/mysql الذي ÙŠØتوي قواعد بيانات #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " diff --git a/debian/po/ca.po b/debian/po/ca.po index d9c69e19983..8796ca196a8 100644 --- a/debian/po/ca.po +++ b/debian/po/ca.po @@ -1,12 +1,12 @@ # mariadb (debconf) translation to Catalan. -# his file is distributed under the same license as the mariadb-10.6 package. +# his file is distributed under the same license as the mariadb-10.7 package. # Aleix Badia i Bosch <abadia@ica.es> 2004 # Innocent De Marchi <tangram.peces@gmail.com> 2017 # msgid "" msgstr "" -"Project-Id-Version: mariadb-10.6\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Project-Id-Version: mariadb-10.7\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2017-03-20 17:55+0100\n" "Last-Translator: Innocent De Marchi <tangram.peces@gmail.com>\n" @@ -19,13 +19,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "El directori de dades antigues es desarà a una nova localització" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -37,7 +37,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -47,7 +47,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" @@ -56,13 +56,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "Important note for NIS/YP users" msgstr "Nota important pels usuaris de «NIS/YP»" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -72,7 +72,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -82,13 +82,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Eliminar totes les bases de dades MariaDB?" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -98,7 +98,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " diff --git a/debian/po/cs.po b/debian/po/cs.po index 8176d86457b..573fc645663 100644 --- a/debian/po/cs.po +++ b/debian/po/cs.po @@ -13,8 +13,8 @@ # msgid "" msgstr "" -"Project-Id-Version: mariadb-10.6\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Project-Id-Version: mariadb-10.7\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2020-10-18 17:13+0200\n" "Last-Translator: Miroslav Kure <kurem@debian.cz>\n" @@ -26,13 +26,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "Starý adresář s daty bude uložen na novém mÃstÄ›." #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -44,7 +44,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -54,7 +54,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" @@ -63,13 +63,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "Important note for NIS/YP users" msgstr "Důležitá poznámka pro uživatele NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -79,7 +79,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -88,13 +88,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Odstranit vÅ¡echny MariaDB databáze?" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -104,7 +104,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " diff --git a/debian/po/da.po b/debian/po/da.po index 4de2e4e7057..aa45b277904 100644 --- a/debian/po/da.po +++ b/debian/po/da.po @@ -1,13 +1,13 @@ -# Danish translation mariadb-10.6. -# Copyright (C) 2014 mariadb-10.6 og nedenstÃ¥ende oversættere. -# This file is distributed under the same license as the mariadb-10.6 package. +# Danish translation mariadb-10.7. +# Copyright (C) 2014 mariadb-10.7 og nedenstÃ¥ende oversættere. +# This file is distributed under the same license as the mariadb-10.7 package. # Claus Hindsgaul <claus.hindsgaul@gmail.com>, 2005, 2006, 2007. # Joe Hansen <joedalton2@yahoo.dk>, 2014, 2016. # msgid "" msgstr "" -"Project-Id-Version: mariadb-10.6\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Project-Id-Version: mariadb-10.7\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2016-07-09 22:41+0200\n" "Last-Translator: Joe Hansen <joedalton2@yahoo.dk>\n" @@ -19,13 +19,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "Den gamle datamappe vil blive gemt pÃ¥ en ny placering" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -37,7 +37,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -47,7 +47,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" @@ -56,13 +56,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "Important note for NIS/YP users" msgstr "Vigtig oplysning til NIS/YP-brugere" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -72,7 +72,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -82,13 +82,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Fjern alle MariaDB-databaser?" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -98,7 +98,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " diff --git a/debian/po/de.po b/debian/po/de.po index ab11604aee9..a8f8cad1787 100644 --- a/debian/po/de.po +++ b/debian/po/de.po @@ -1,4 +1,4 @@ -# German translation of mariadb-10.6 10.0.13-1 +# German translation of mariadb-10.7 10.0.13-1 # Alwin Meschede <ameschede@gmx.de>, 2006, 2007. # Thomas Mueller <thomas.mueller@tmit.eu>, 2009. # Chris Leick <c.leick@vollbio.de>, 2014-2016. @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: mariadb 10.0.25-1\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2016-05-12 22:39+0100\n" "Last-Translator: Chris Leick <c.leick@vollbio.de>\n" @@ -19,13 +19,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "Das alte Datenverzeichnis wird an einer neuen Stelle gespeichert" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -37,7 +37,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -47,7 +47,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" @@ -56,13 +56,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "Important note for NIS/YP users" msgstr "Wichtige Anmerkung für NIS/YP-Benutzer!" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -72,7 +72,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -82,13 +82,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Alle MariaDB-Datenbanken entfernen?" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -98,7 +98,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " diff --git a/debian/po/es.po b/debian/po/es.po index 35d107b7960..043ab9a2ab6 100644 --- a/debian/po/es.po +++ b/debian/po/es.po @@ -40,7 +40,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1_5.0.24-3\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2016-04-30 21:26+0200\n" "Last-Translator: Javier Fernández-Sanguino <jfs@debian.org>\n" @@ -54,13 +54,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "Se guardará el directorio antiguo de datos a la nueva ubicación" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -72,7 +72,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -82,7 +82,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" @@ -91,13 +91,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "Important note for NIS/YP users" msgstr "Nota importante para los usuarios de NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -107,7 +107,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -117,13 +117,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "¿Desea eliminar todas las bases de datos MariaDB?" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -133,7 +133,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " diff --git a/debian/po/eu.po b/debian/po/eu.po index 191d92b615e..67e07070a3d 100644 --- a/debian/po/eu.po +++ b/debian/po/eu.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: eu\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2009-07-29 11:59+0200\n" "Last-Translator: Piarres Beobide <pi@beobide.net>\n" @@ -20,13 +20,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -35,7 +35,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -43,20 +43,20 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "Important note for NIS/YP users" msgstr "NIS/YP erabiltzaileentzat ohar garrantzitsua" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -64,7 +64,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 #, fuzzy #| msgid "" #| "You should also check the permissions and the owner of the /var/lib/mysql " @@ -78,13 +78,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Ezabatu MariaDB datubase guztiak?" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -93,7 +93,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " diff --git a/debian/po/fi.po b/debian/po/fi.po index 16e310b8c6a..b787b265ea3 100644 --- a/debian/po/fi.po +++ b/debian/po/fi.po @@ -1,11 +1,11 @@ -# Finnish translations for mariadb-10.6 package -# This file is distributed under the same license as the mariadb-10.6 package. +# Finnish translations for mariadb-10.7 package +# This file is distributed under the same license as the mariadb-10.7 package. # Antti Järvinen <antti.jarvinen@katiska.org>, 2017. # msgid "" msgstr "" -"Project-Id-Version: mariadb-10.6\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Project-Id-Version: mariadb-10.7\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2017-03-15 22:36+0200\n" "Last-Translator: antti.jarvinen@katiska.org\n" @@ -19,13 +19,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "Vanha datahakemisto tullaan tallentamaan uuteen paikkaan" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -37,7 +37,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -47,7 +47,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" @@ -56,13 +56,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "Important note for NIS/YP users" msgstr "Merkittävä huomio NIS/YP -käyttäjille" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -72,7 +72,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -80,13 +80,13 @@ msgstr "Tarkista myös hakemiston /var/lib/mysql omistaja ja oikeudet:" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Poistetaanko kaikki MariaDB-tietokannat?" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -95,7 +95,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " diff --git a/debian/po/fr.po b/debian/po/fr.po index 1604203696b..ade489bae0f 100644 --- a/debian/po/fr.po +++ b/debian/po/fr.po @@ -1,6 +1,6 @@ -# Translation of mariadb-10.6 debconf templates to French +# Translation of mariadb-10.7 debconf templates to French # Copyright (C) 2004-2016 Debian French l10n team <debian-l10n-french@lists.debian.org> -# This file is distributed under the same license as the mariadb-10.6 packages. +# This file is distributed under the same license as the mariadb-10.7 packages. # # Translators: # Christian Perrier <bubulle@debian.org>, 2004, 2006, 2007, 2009, 2013. @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: fr\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2016-12-31 18:35+0100\n" "Last-Translator: Baptiste Jammet <baptiste@mailoo.org>\n" @@ -23,13 +23,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "L'ancien répertoire de données sera sauvegardé à un nouvel emplacement" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -41,7 +41,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -51,7 +51,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" @@ -60,13 +60,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "Important note for NIS/YP users" msgstr "Note importante pour les utilisateurs NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -76,7 +76,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -86,13 +86,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Faut-il supprimer toutes les bases de données MariaDB ?" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -102,7 +102,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " diff --git a/debian/po/gl.po b/debian/po/gl.po index d84a745a732..a18097f76cd 100644 --- a/debian/po/gl.po +++ b/debian/po/gl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2007-04-20 09:44+0200\n" "Last-Translator: Jacobo Tarrio <jtarrio@debian.org>\n" @@ -17,13 +17,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -32,7 +32,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -40,20 +40,20 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "Important note for NIS/YP users" msgstr "Nota importante para os usuarios de NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -61,7 +61,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 #, fuzzy #| msgid "" #| "You should also check the permissions and the owner of the /var/lib/mysql " @@ -75,13 +75,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "¿Eliminar tódalas bases de datos de MariaDB?" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -91,7 +91,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " diff --git a/debian/po/it.po b/debian/po/it.po index fb3d0485a22..1adfc8bbf24 100644 --- a/debian/po/it.po +++ b/debian/po/it.po @@ -1,11 +1,11 @@ -# Italian (it) translation of debconf templates for mariadb-10.6 -# This file is distributed under the same license as the mariadb-10.6 package. +# Italian (it) translation of debconf templates for mariadb-10.7 +# This file is distributed under the same license as the mariadb-10.7 package. # Luca Monducci <luca.mo@tiscali.it>, 2006-2017. # msgid "" msgstr "" -"Project-Id-Version: mariadb-10.6 10.0.13 italian debconf templates\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Project-Id-Version: mariadb-10.7 10.0.13 italian debconf templates\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2017-083-20 20:29+0100\n" "Last-Translator: Luca Monducci <luca.mo@tiscali.it>\n" @@ -17,13 +17,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "La vecchia directory data verrà salvata in una nuova posizione" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -35,7 +35,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -45,7 +45,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" @@ -54,13 +54,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "Important note for NIS/YP users" msgstr "Nota importante per gli utenti NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -70,7 +70,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -80,13 +80,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Eliminare tutti i database MariaDB?" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -96,7 +96,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " diff --git a/debian/po/ja.po b/debian/po/ja.po index c7a3bea42ce..a2a8583843c 100644 --- a/debian/po/ja.po +++ b/debian/po/ja.po @@ -15,8 +15,8 @@ # msgid "" msgstr "" -"Project-Id-Version: mariadb-10.6 10.0.32-1\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Project-Id-Version: mariadb-10.7 10.0.32-1\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2016-05-01 11:27+0900\n" "Last-Translator: Takuma Yamada <tyamada@takumayamada.com>\n" @@ -30,13 +30,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "å¤ã„データディレクトリã¯ã€æ–°ã—ã„å ´æ‰€ã«ä¿å˜ã•ã‚Œã¾ã™" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -48,7 +48,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -58,7 +58,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" @@ -67,13 +67,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "Important note for NIS/YP users" msgstr "NIS/YP ユーザã¸ã®é‡è¦ãªæ³¨æ„" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -83,7 +83,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -91,13 +91,13 @@ msgstr "/var/lib/mysql ã®æ‰€æœ‰è€…権é™ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹å¿…è¦ã‚‚ã‚ã‚Šã¾ #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "ã™ã¹ã¦ã® MariaDB データベースを削除ã—ã¾ã™ã‹?" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -107,7 +107,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " diff --git a/debian/po/nb.po b/debian/po/nb.po index b11a70c3a0e..a3a9e069486 100644 --- a/debian/po/nb.po +++ b/debian/po/nb.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql_nb\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2007-02-18 12:13+0100\n" "Last-Translator: Bjørn Steensrud <bjornst@powertech.no>\n" @@ -19,13 +19,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -34,7 +34,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -42,14 +42,14 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 #, fuzzy #| msgid "Important note for NIS/YP users!" msgid "Important note for NIS/YP users" @@ -57,7 +57,7 @@ msgstr "Viktig merknad for NIS/YP-brukere!" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -65,7 +65,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -73,13 +73,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -87,7 +87,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 #, fuzzy #| msgid "" #| "The script is about to remove the data directory /var/lib/mysql. If it is " diff --git a/debian/po/nl.po b/debian/po/nl.po index 90e6ea767bb..00ab55777c6 100644 --- a/debian/po/nl.po +++ b/debian/po/nl.po @@ -1,13 +1,13 @@ # Dutch mariadb-10 po-debconf translation, # Copyright (C) 2006 THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the mariadb-10.6 package. +# This file is distributed under the same license as the mariadb-10.7 package. # Vincent Zweije <zweije@xs4all.nl>, 2006. # Frans Spiesschaert <Frans.Spiesschaert@yucom.be>, 2014, 2016, 2018. # msgid "" msgstr "" "Project-Id-Version: mariadb-10.2.7-1\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2018-03-29 21:25+0200\n" "Last-Translator: Frans Spiesschaert <Frans.Spiesschaert@yucom.be>\n" @@ -21,13 +21,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "De oude data-map zal op een nieuwe locatie bewaard worden" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -39,7 +39,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -49,7 +49,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" @@ -58,13 +58,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "Important note for NIS/YP users" msgstr "Belangrijke opmerking voor gebruikers van NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -74,7 +74,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -84,13 +84,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Wilt u alle MariaDB-databases verwijderen?" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -100,7 +100,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " diff --git a/debian/po/pt.po b/debian/po/pt.po index 4df8e3540a8..8c7823c8edf 100644 --- a/debian/po/pt.po +++ b/debian/po/pt.po @@ -6,8 +6,8 @@ # msgid "" msgstr "" -"Project-Id-Version: mariadb-10.6\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Project-Id-Version: mariadb-10.7\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2017-08-06 10:00+0100\n" "Last-Translator: Rui Branco <ruipb@debianpt.org>\n" @@ -20,13 +20,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "O antigo directório de data será guardado num novo local" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -38,7 +38,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -48,7 +48,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" @@ -57,13 +57,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "Important note for NIS/YP users" msgstr "Nota importante para os utilizadores de NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -73,7 +73,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -82,13 +82,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Remover todas as bases de dados MariaDB?" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -98,7 +98,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " diff --git a/debian/po/pt_BR.po b/debian/po/pt_BR.po index cf8127236e5..d0a4c6db8fe 100644 --- a/debian/po/pt_BR.po +++ b/debian/po/pt_BR.po @@ -1,12 +1,12 @@ -# Debconf translations for mariadb-10.6. -# This file is distributed under the same license as the mariadb-10.6 package. +# Debconf translations for mariadb-10.7. +# This file is distributed under the same license as the mariadb-10.7 package. # André LuÃs Lopes, <andrelop@debian.org>, 2005-2007. # Adriano Rafael Gomes <adrianorg@arg.eti.br>, 2015-2016. # msgid "" msgstr "" -"Project-Id-Version: mariadb-10.6\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Project-Id-Version: mariadb-10.7\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2016-04-30 16:16-0300\n" "Last-Translator: Adriano Rafael Gomes <adrianorg@arg.eti.br>\n" @@ -19,13 +19,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "O diretório de dados antigo será salvo em novo local" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -37,7 +37,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -47,7 +47,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" @@ -56,13 +56,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "Important note for NIS/YP users" msgstr "Aviso importante para usuários NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -72,7 +72,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -82,13 +82,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Remover todas as bases de dados do MariaDB?" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -98,7 +98,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " diff --git a/debian/po/ro.po b/debian/po/ro.po index 869a5efddd2..6fda31dc508 100644 --- a/debian/po/ro.po +++ b/debian/po/ro.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: po-debconf://mysql-dfsg\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2006-12-20 21:27+0200\n" "Last-Translator: stan ioan-eugen <stan.ieugen@gmail.com>\n" @@ -19,13 +19,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -34,7 +34,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -42,14 +42,14 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 #, fuzzy #| msgid "Important note for NIS/YP users!" msgid "Important note for NIS/YP users" @@ -57,7 +57,7 @@ msgstr "Notă importantă pentru utilizatorii NIS/YP!" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -65,7 +65,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -73,13 +73,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -87,7 +87,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 #, fuzzy #| msgid "" #| "The script is about to remove the data directory /var/lib/mysql. If it is " diff --git a/debian/po/ru.po b/debian/po/ru.po index 01152031369..ecdc8e658f7 100644 --- a/debian/po/ru.po +++ b/debian/po/ru.po @@ -6,8 +6,8 @@ # Yuri Kozlov <yuray@komyakino.ru>, 2009, 2014, 2016. msgid "" msgstr "" -"Project-Id-Version: mariadb-10.6 10.0.25-1\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Project-Id-Version: mariadb-10.7 10.0.25-1\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2016-05-04 18:56+0300\n" "Last-Translator: Yuri Kozlov <yuray@komyakino.ru>\n" @@ -22,13 +22,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "Каталог Ñо Ñтарыми данными будет Ñохранён в новом меÑте" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -40,7 +40,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -51,7 +51,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" @@ -60,13 +60,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "Important note for NIS/YP users" msgstr "Важное замечание Ð´Ð»Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»ÐµÐ¹ NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -76,7 +76,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -84,13 +84,13 @@ msgstr "Также проверьте права доÑтупа и Ð²Ð»Ð°Ð´ÐµÐ»Ñ #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Удалить вÑе базы данных MariaDB?" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -99,7 +99,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " diff --git a/debian/po/sv.po b/debian/po/sv.po index 0c44b9923df..4ac8f477339 100644 --- a/debian/po/sv.po +++ b/debian/po/sv.po @@ -1,13 +1,13 @@ -# Translation of mariadb-10.6 debconf template to Swedish +# Translation of mariadb-10.7 debconf template to Swedish # Copyright (C) 2017 Martin Bagge <brother@bsnet.se> -# This file is distributed under the same license as the mariadb-10.6 package. +# This file is distributed under the same license as the mariadb-10.7 package. # # Andreas Henriksson <andreas@fatal.se>, 2007 # Martin Bagge <brother@bsnet.se>, 2009, 2015, 2017 msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1 5.0.21-3\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2017-03-23 09:20+0100\n" "Last-Translator: Martin Bagge / brother <brother@bsnet.se>\n" @@ -20,13 +20,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "Den gamla data-katalogen kommer att sparas till en ny plats" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -38,7 +38,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -48,7 +48,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" @@ -57,13 +57,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "Important note for NIS/YP users" msgstr "Viktig information för NIS/YP-användare" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -73,7 +73,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -83,13 +83,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Ta bort alla MariaDB-databaser?" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -99,7 +99,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " diff --git a/debian/po/templates.pot b/debian/po/templates.pot index 73febcc0174..26d3231f0cd 100644 --- a/debian/po/templates.pot +++ b/debian/po/templates.pot @@ -1,13 +1,13 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the mariadb-10.6 package. +# This file is distributed under the same license as the mariadb-10.7 package. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: mariadb-10.6\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Project-Id-Version: mariadb-10.7\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" @@ -19,13 +19,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -34,7 +34,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -42,20 +42,20 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "Important note for NIS/YP users" msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -63,7 +63,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -71,13 +71,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -85,7 +85,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " diff --git a/debian/po/tr.po b/debian/po/tr.po index 9d292dad46c..2df83c2b502 100644 --- a/debian/po/tr.po +++ b/debian/po/tr.po @@ -5,8 +5,8 @@ # msgid "" msgstr "" -"Project-Id-Version: mariadb-10.6\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Project-Id-Version: mariadb-10.7\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2017-03-16 13:16+0300\n" "Last-Translator: Atila KOÇ <koc@artielektronik.com.tr>\n" @@ -20,13 +20,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "Eski veritabanı dizini yeni konumuna kaydedilecektir" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -38,7 +38,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -48,20 +48,20 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "GerektiÄŸinde verinizi elle (ör. mysqldump ile) içe/dışa aktarın." #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "Important note for NIS/YP users" msgstr "NIS/YP kullanıcıları için önemli not" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -71,7 +71,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -81,13 +81,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Tüm MariaDB veritabanları kaldırılsın mı?" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -96,7 +96,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " diff --git a/debian/po/vi.po b/debian/po/vi.po index 3aa7e3f3d25..6ff1185b81c 100644 --- a/debian/po/vi.po +++ b/debian/po/vi.po @@ -1,12 +1,12 @@ -# Vietnamese translations for mariadb-10.6 package -# Bản dịch Tiếng Việt dà nh cho gói mariadb-10.6. -# This file is distributed under the same license as the mariadb-10.6 package. +# Vietnamese translations for mariadb-10.7 package +# Bản dịch Tiếng Việt dà nh cho gói mariadb-10.7. +# This file is distributed under the same license as the mariadb-10.7 package. # Trần Ngá»c Quân <vnwildman@gmail.com>, 2017. # msgid "" msgstr "" -"Project-Id-Version: mariadb-10.6\n" -"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n" +"Project-Id-Version: mariadb-10.7\n" +"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n" "POT-Creation-Date: 2019-07-23 19:16-0300\n" "PO-Revision-Date: 2017-03-18 13:32+0700\n" "Last-Translator: Trần Ngá»c Quân <vnwildman@gmail.com>\n" @@ -20,13 +20,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "The old data directory will be saved at new location" msgstr "ThÆ° mục dữ liệu cÅ© sẽ được lÆ°u tại vị trà má»›i" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "A file named /var/lib/mysql/debian-*.flag exists on this system. The number " "indicates a database binary format version that cannot automatically be " @@ -38,7 +38,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Therefore the previous data directory will be renamed to /var/lib/mysql-* " "and a new data directory will be initialized at /var/lib/mysql." @@ -48,7 +48,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:2001 +#: ../mariadb-server-10.7.templates:2001 msgid "" "Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" @@ -57,13 +57,13 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "Important note for NIS/YP users" msgstr "Chú ý quan trá»ng cho ngÆ°á»i dùng NIS/YP" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "Using MariaDB under NIS/YP requires a mysql user account to be added on the " "local system with:" @@ -73,7 +73,7 @@ msgstr "" #. Type: note #. Description -#: ../mariadb-server-10.6.templates:3001 +#: ../mariadb-server-10.7.templates:3001 msgid "" "You should also check the permissions and ownership of the /var/lib/mysql " "directory:" @@ -82,13 +82,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "Remove all MariaDB databases?" msgstr "Xóa bá» má»i cÆ¡ sở dữ liệu MariaDB chứ?" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "The /var/lib/mysql directory which contains the MariaDB databases is about " "to be removed." @@ -98,7 +98,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mariadb-server-10.6.templates:4001 +#: ../mariadb-server-10.7.templates:4001 msgid "" "If you're removing the MariaDB package in order to later install a more " "recent version or if a different mariadb-server package is already using it, " diff --git a/debian/rules b/debian/rules index 192f98efcd6..2f6938b04a4 100755 --- a/debian/rules +++ b/debian/rules @@ -134,12 +134,12 @@ override_dh_auto_install: ifneq (,$(filter linux,$(DEB_HOST_ARCH_OS))) # Copy systemd files to a location available for dh_installinit - cp $(BUILDDIR)/support-files/mariadb.service debian/mariadb-server-10.6.mariadb.service - cp $(BUILDDIR)/support-files/mariadb.socket debian/mariadb-server-10.6.mariadb.socket - cp $(BUILDDIR)/support-files/mariadb-extra.socket debian/mariadb-server-10.6.mariadb-extra.socket - cp $(BUILDDIR)/support-files/mariadb@.service debian/mariadb-server-10.6.mariadb@.service - cp $(BUILDDIR)/support-files/mariadb@.socket debian/mariadb-server-10.6.mariadb@.socket - cp $(BUILDDIR)/support-files/mariadb-extra@.socket debian/mariadb-server-10.6.mariadb-extra@.socket + cp $(BUILDDIR)/support-files/mariadb.service debian/mariadb-server-10.7.mariadb.service + cp $(BUILDDIR)/support-files/mariadb.socket debian/mariadb-server-10.7.mariadb.socket + cp $(BUILDDIR)/support-files/mariadb-extra.socket debian/mariadb-server-10.7.mariadb-extra.socket + cp $(BUILDDIR)/support-files/mariadb@.service debian/mariadb-server-10.7.mariadb@.service + cp $(BUILDDIR)/support-files/mariadb@.socket debian/mariadb-server-10.7.mariadb@.socket + cp $(BUILDDIR)/support-files/mariadb-extra@.socket debian/mariadb-server-10.7.mariadb-extra@.socket endif # Run 'make install' without output since it is uninteresting and @@ -158,7 +158,7 @@ endif # nm numeric soft is not enough, therefore extra sort in command # to satisfy Debian reproducible build requirements - nm --defined-only $(BUILDDIR)/sql/mariadbd | LC_ALL=C sort | gzip -n -9 > $(TMP)/usr/share/doc/mariadb-server-10.6/mariadbd.sym.gz + nm --defined-only $(BUILDDIR)/sql/mariadbd | LC_ALL=C sort | gzip -n -9 > $(TMP)/usr/share/doc/mariadb-server-10.7/mariadbd.sym.gz # Rename and install AppArmor profile install -D -m 644 debian/apparmor-profile $(TMP)/etc/apparmor.d/usr.sbin.mariadbd diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml index 5f8175a0762..0039e1be393 100644 --- a/debian/salsa-ci.yml +++ b/debian/salsa-ci.yml @@ -224,7 +224,7 @@ fresh install: script: - *test-prepare-container - *test-install - - service mariadb status # There is no init.d/mysql in MariaDB 10.6 + - service mariadb status # There is no init.d/mysql in MariaDB 10.7 - *test-verify-final variables: GIT_STRATEGY: none @@ -232,7 +232,7 @@ fresh install: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -mariadb-10.6 Sid upgrade: +mariadb-10.7 Sid upgrade: stage: upgrade in Sid needs: - job: build @@ -246,7 +246,7 @@ mariadb-10.6 Sid upgrade: script: - *test-prepare-container - *test-install - - service mariadb status # There is no init.d/mysql in MariaDB 10.6 + - service mariadb status # There is no init.d/mysql in MariaDB 10.7 - *test-verify-final variables: GIT_STRATEGY: none @@ -254,7 +254,7 @@ mariadb-10.6 Sid upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -mariadb-10.3 Buster to mariadb-10.6 upgrade: +mariadb-10.3 Buster to mariadb-10.7 upgrade: stage: upgrade from Buster/Stretch needs: - job: build @@ -281,7 +281,7 @@ mariadb-10.3 Buster to mariadb-10.6 upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -mariadb-10.1 Stretch to mariadb-10.6 upgrade: +mariadb-10.1 Stretch to mariadb-10.7 upgrade: stage: upgrade from Buster/Stretch needs: - job: build @@ -325,7 +325,7 @@ test basic features: script: - *test-prepare-container - *test-install - - service mariadb status # There is no init.d/mysql in MariaDB 10.6 + - service mariadb status # There is no init.d/mysql in MariaDB 10.7 - *test-verify-final - | # Print info about server @@ -520,7 +520,7 @@ default-libmysqlclient-dev Stretch upgrade: # Upgrading from MySQL 8.0 with datadir in place is not possible. Users need to do a data dump. # The Debian maintainer scripts detect this situation and simply moves old datadir aside and start fresh. -mysql-8.0 Sid to mariadb-10.6 upgrade: +mysql-8.0 Sid to mariadb-10.7 upgrade: stage: upgrade in Sid needs: - job: build @@ -548,7 +548,7 @@ mysql-8.0 Sid to mariadb-10.6 upgrade: # Upgrading from MySQL 8.0 with datadir in place is not possible. Users need to do a data dump. # The Debian maintainer scripts detect this situation and simply moves old datadir aside and start fresh. -mysql-8.0 Focal to mariadb-10.6 upgrade: +mysql-8.0 Focal to mariadb-10.7 upgrade: stage: upgrade extras needs: - job: build buster-backports @@ -582,7 +582,8 @@ mysql-8.0 Focal to mariadb-10.6 upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -mariadb.org-10.5 to mariadb-10.6 upgrade: + +mariadb.org-10.5 to mariadb-10.7 upgrade: stage: upgrade extras needs: - job: build @@ -621,7 +622,7 @@ mariadb.org-10.5 to mariadb-10.6 upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -mariadb.org-10.4 to mariadb-10.6 upgrade: +mariadb.org-10.4 to mariadb-10.7 upgrade: stage: upgrade extras needs: - job: build @@ -654,7 +655,7 @@ mariadb.org-10.4 to mariadb-10.6 upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -mariadb.org-10.3 to mariadb-10.6 upgrade: +mariadb.org-10.3 to mariadb-10.7 upgrade: stage: upgrade extras needs: - job: build @@ -690,7 +691,7 @@ mariadb.org-10.3 to mariadb-10.6 upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -mariadb.org-10.2 to mariadb-10.6 upgrade: +mariadb.org-10.2 to mariadb-10.7 upgrade: stage: upgrade extras needs: - job: build @@ -726,7 +727,7 @@ mariadb.org-10.2 to mariadb-10.6 upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -mysql.com-5.7 to mariadb-10.6 upgrade: +mysql.com-5.7 to mariadb-10.7 upgrade: stage: upgrade extras needs: - job: build buster-backports @@ -758,7 +759,7 @@ mysql.com-5.7 to mariadb-10.6 upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -percona-xtradb-5.7 to mariadb-10.6 upgrade (MDEV-22679): +percona-xtradb-5.7 to mariadb-10.7 upgrade (MDEV-22679): stage: upgrade extras needs: - job: build buster-backports diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides index c52ff448bb6..66e4ff5b962 100644 --- a/debian/source/lintian-overrides +++ b/debian/source/lintian-overrides @@ -1,24 +1,24 @@ # Necessary for drop-in-place-replacement upgrades on mysql-server/-client # since package breaks/replaces these but at the same time also provides them -version-substvar-for-external-package mariadb-client-core-10.6 -> mysql-client-5.5 -version-substvar-for-external-package mariadb-server-10.6 -> mysql-server -version-substvar-for-external-package mariadb-server-10.6 -> mysql-server +version-substvar-for-external-package mariadb-client-core-10.7 -> mysql-client-5.5 +version-substvar-for-external-package mariadb-server-10.7 -> mysql-server +version-substvar-for-external-package mariadb-server-10.7 -> mysql-server version-substvar-for-external-package libmariadb-dev -> libmysqlclient-dev version-substvar-for-external-package libmariadb-dev -> libmysqld-dev -version-substvar-for-external-package mariadb-server-10.6 -> mysql-client-5.5 -version-substvar-for-external-package mariadb-server-10.6 -> mysql-client-5.6 -version-substvar-for-external-package mariadb-server-10.6 -> mysql-client-5.7 -version-substvar-for-external-package mariadb-server-10.6 -> mysql-client-8.0 -version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-5.1 -version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-5.1 -version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-5.5 -version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-5.5 -version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-5.6 -version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-5.6 -version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-5.7 -version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-5.7 -version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-8.0 -version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-8.0 +version-substvar-for-external-package mariadb-server-10.7 -> mysql-client-5.5 +version-substvar-for-external-package mariadb-server-10.7 -> mysql-client-5.6 +version-substvar-for-external-package mariadb-server-10.7 -> mysql-client-5.7 +version-substvar-for-external-package mariadb-server-10.7 -> mysql-client-8.0 +version-substvar-for-external-package mariadb-client-10.7 -> mysql-client-core-5.1 +version-substvar-for-external-package mariadb-client-10.7 -> mysql-client-core-5.1 +version-substvar-for-external-package mariadb-client-10.7 -> mysql-client-core-5.5 +version-substvar-for-external-package mariadb-client-10.7 -> mysql-client-core-5.5 +version-substvar-for-external-package mariadb-client-10.7 -> mysql-client-core-5.6 +version-substvar-for-external-package mariadb-client-10.7 -> mysql-client-core-5.6 +version-substvar-for-external-package mariadb-client-10.7 -> mysql-client-core-5.7 +version-substvar-for-external-package mariadb-client-10.7 -> mysql-client-core-5.7 +version-substvar-for-external-package mariadb-client-10.7 -> mysql-client-core-8.0 +version-substvar-for-external-package mariadb-client-10.7 -> mysql-client-core-8.0 version-substvar-for-external-package libmariadbd-dev -> libmariadbclient-dev # ColumnStore not used in Debian, safe to ignore. Reported upstream in https://jira.mariadb.org/browse/MDEV-24124 source-is-missing storage/columnstore/columnstore/utils/jemalloc/libjemalloc.so.2 diff --git a/debian/tests/control b/debian/tests/control index 4ed6c461508..b596e57c816 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -3,7 +3,7 @@ Tests: smoke # for its existence (see the list in debian/control), install it if available # and check in the test if it's functional when it should be. # The plugin package also already depends on the other one. -Depends: mariadb-plugin-rocksdb | mariadb-server-10.6 +Depends: mariadb-plugin-rocksdb | mariadb-server-10.7 Restrictions: allow-stderr needs-root isolation-container Tests: upstream diff --git a/debian/tests/smoke b/debian/tests/smoke index e5d50496bdb..f4bf0f789ce 100644 --- a/debian/tests/smoke +++ b/debian/tests/smoke @@ -4,7 +4,7 @@ # # This test should be declared in debian/tests/control with a dependency # on the package that provides a configured MariaDB server (eg. -# mariadb-server-10.6). +# mariadb-server-10.7). # # This test should be declared in debian/tests/control with the # following restrictions: @@ -88,7 +88,7 @@ if [ "$(dpkg-architecture -qDEB_HOST_ARCH_BITS)" != 32 ] && LOG=/var/lib/mysql/#rocksdb/LOG # XXX: The server may only be started during the install of - # mariadb-server-10.6, which happens before that of the plugin. + # mariadb-server-10.7, which happens before that of the plugin. [ -e $LOG ] || mysql -e "INSTALL PLUGIN RocksDB SONAME 'ha_rocksdb';" # XXX: rocksdb_supported_compression_types variable does not report ZSTD. diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc index ce3911502fb..e1f368a2c0f 100644 --- a/extra/innochecksum.cc +++ b/extra/innochecksum.cc @@ -70,7 +70,7 @@ static my_bool per_page_details; static ulint n_merge; static ulint physical_page_size; /* Page size in bytes on disk. */ ulong srv_page_size; -ulong srv_page_size_shift; +uint32_t srv_page_size_shift; /* Current page number (0 based). */ uint32_t cur_page_num; /* Current space. */ @@ -257,14 +257,14 @@ static void init_page_size(const byte* buf) + FSP_SPACE_FLAGS); if (fil_space_t::full_crc32(flags)) { - const ulong ssize = FSP_FLAGS_FCRC32_GET_PAGE_SSIZE(flags); + const uint32_t ssize = FSP_FLAGS_FCRC32_GET_PAGE_SSIZE(flags); srv_page_size_shift = UNIV_ZIP_SIZE_SHIFT_MIN - 1 + ssize; srv_page_size = 512U << ssize; physical_page_size = srv_page_size; return; } - const ulong ssize = FSP_FLAGS_GET_PAGE_SSIZE(flags); + const uint32_t ssize = FSP_FLAGS_GET_PAGE_SSIZE(flags); srv_page_size_shift = ssize ? UNIV_ZIP_SIZE_SHIFT_MIN - 1 + ssize @@ -428,12 +428,7 @@ static bool is_page_all_zeroes( with crypt_scheme encrypted @param[in] flags tablespace flags @retval true if page is corrupted otherwise false. */ -static -bool -is_page_corrupted( - byte* buf, - bool is_encrypted, - ulint flags) +static bool is_page_corrupted(byte *buf, bool is_encrypted, uint32_t flags) { /* enable if page is corrupted. */ @@ -590,7 +585,7 @@ Rewrite the checksum for the page. @retval false : skip the rewrite as checksum stored match with calculated or page is doublwrite buffer. */ -static bool update_checksum(byte* page, ulint flags) +static bool update_checksum(byte* page, uint32_t flags) { ib_uint32_t checksum = 0; byte stored1[4]; /* get FIL_PAGE_SPACE_OR_CHKSUM field checksum */ @@ -699,7 +694,7 @@ write_file( const char* filename, FILE* file, byte* buf, - ulint flags, + uint32_t flags, fpos_t* pos) { bool do_update; @@ -1365,7 +1360,7 @@ static int verify_checksum( byte* buf, bool is_encrypted, unsigned long long* mismatch_count, - ulint flags) + uint32_t flags) { int exit_status = 0; if (is_page_corrupted(buf, is_encrypted, flags)) { @@ -1406,7 +1401,7 @@ rewrite_checksum( byte* buf, fpos_t* pos, bool is_encrypted, - ulint flags) + uint32_t flags) { bool is_compressed = fil_space_t::is_compressed(flags); @@ -1575,7 +1570,7 @@ int main( from fsp_flags and encryption metadata from page 0 */ init_page_size(buf); - ulint flags = mach_read_from_4(FSP_HEADER_OFFSET + FSP_SPACE_FLAGS + buf); + uint32_t flags = mach_read_from_4(FSP_HEADER_OFFSET + FSP_SPACE_FLAGS + buf); if (physical_page_size == UNIV_ZIP_SIZE_MIN) { partial_page_read = false; diff --git a/extra/mariabackup/backup_mysql.cc b/extra/mariabackup/backup_mysql.cc index 3c16bdf7753..a653775142d 100644 --- a/extra/mariabackup/backup_mysql.cc +++ b/extra/mariabackup/backup_mysql.cc @@ -514,7 +514,8 @@ bool get_mysql_vars(MYSQL *connection) if (innodb_undo_tablespaces_var) { - srv_undo_tablespaces= strtoul(innodb_undo_tablespaces_var, &endptr, 10); + srv_undo_tablespaces= static_cast<uint32_t> + (strtoul(innodb_undo_tablespaces_var, &endptr, 10)); ut_ad(*endptr == 0); } @@ -1605,7 +1606,7 @@ bool write_backup_config_file() "innodb_log_file_size=%llu\n" "innodb_page_size=%lu\n" "innodb_undo_directory=%s\n" - "innodb_undo_tablespaces=%lu\n" + "innodb_undo_tablespaces=%u\n" "innodb_compression_level=%u\n" "%s%s\n" "%s\n", diff --git a/extra/mariabackup/common.h b/extra/mariabackup/common.h index 1973512ad82..89b189e3a87 100644 --- a/extra/mariabackup/common.h +++ b/extra/mariabackup/common.h @@ -149,10 +149,9 @@ static inline ATTRIBUTE_FORMAT(printf, 1,2) ATTRIBUTE_NORETURN void die(const ch /*********************************************************************** Computes bit shift for a given value. If the argument is not a power of 2, returns 0.*/ -static inline size_t -get_bit_shift(size_t value) +static inline unsigned get_bit_shift(size_t value) { - size_t shift; + unsigned shift; if (value == 0) return 0; diff --git a/extra/mariabackup/ds_local.cc b/extra/mariabackup/ds_local.cc index ddaa213491d..4c3016ec8f7 100644 --- a/extra/mariabackup/ds_local.cc +++ b/extra/mariabackup/ds_local.cc @@ -181,8 +181,8 @@ static void init_ibd_data(ds_local_file_t *local_file, const uchar *buf, size_t return; } - ulint flags = mach_read_from_4(&buf[FIL_PAGE_DATA + FSP_SPACE_FLAGS]); - ulint ssize = FSP_FLAGS_GET_PAGE_SSIZE(flags); + auto flags = mach_read_from_4(&buf[FIL_PAGE_DATA + FSP_SPACE_FLAGS]); + auto ssize = FSP_FLAGS_GET_PAGE_SSIZE(flags); local_file->pagesize= ssize == 0 ? UNIV_PAGE_SIZE_ORIG : ((UNIV_ZIP_SIZE_MIN >> 1) << ssize); local_file->compressed = fil_space_t::full_crc32(flags) ? fil_space_t::is_compressed(flags) diff --git a/extra/mariabackup/fil_cur.cc b/extra/mariabackup/fil_cur.cc index 824fb4f4232..37d2fc5972d 100644 --- a/extra/mariabackup/fil_cur.cc +++ b/extra/mariabackup/fil_cur.cc @@ -232,8 +232,8 @@ xb_fil_cur_open( mysql_mutex_unlock(&fil_system.mutex); } - cursor->space_size = (ulint)(cursor->statinfo.st_size - / cursor->page_size); + cursor->space_size = uint32_t(cursor->statinfo.st_size + / cursor->page_size); cursor->read_filter = read_filter; cursor->read_filter->init(&cursor->read_filter_ctxt, cursor, @@ -441,8 +441,8 @@ read_retry: "corrupted.%s", cursor->abs_path, ignore_corruption_warn); ut_print_buf(stderr, page, page_size); if (opt_log_innodb_page_corruption) { - corrupted_pages.add_page(cursor->node->name, cursor->node->space->id, - page_no); + corrupted_pages.add_page(cursor->node->name, + {cursor->node->space->id, page_no}); retry_count = 1; } else { @@ -465,8 +465,9 @@ read_retry: unsigned corrupted_page_no = static_cast<unsigned>(strtoul(dbug_val, NULL, 10)); if (page_no == corrupted_page_no) - corrupted_pages.add_page(cursor->node->name, cursor->node->space->id, - corrupted_page_no); + corrupted_pages.add_page(cursor->node->name, + {cursor->node->space->id, + corrupted_page_no}); }); cursor->buf_read += page_size; cursor->buf_npages++; diff --git a/extra/mariabackup/fil_cur.h b/extra/mariabackup/fil_cur.h index 0027b7768e9..6b868bf3edd 100644 --- a/extra/mariabackup/fil_cur.h +++ b/extra/mariabackup/fil_cur.h @@ -56,8 +56,8 @@ struct xb_fil_cur_t { unsigned buf_page_no; /*!< number of the first page in buffer */ uint thread_n; /*!< thread number for diagnostics */ - ulint space_id; /*!< ID of tablespace */ - ulint space_size; /*!< space size in pages */ + uint32_t space_id; /*!< ID of tablespace */ + uint32_t space_size; /*!< space size in pages */ /** @return whether this is not a file-per-table tablespace */ bool is_system() const diff --git a/extra/mariabackup/read_filt.h b/extra/mariabackup/read_filt.h index 2cd52d3d581..51150705367 100644 --- a/extra/mariabackup/read_filt.h +++ b/extra/mariabackup/read_filt.h @@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA #include "changed_page_bitmap.h" -typedef ulint space_id_t; +typedef uint32_t space_id_t; struct xb_fil_cur_t; diff --git a/extra/mariabackup/write_filt.cc b/extra/mariabackup/write_filt.cc index 8339286e1df..01e4d83e344 100644 --- a/extra/mariabackup/write_filt.cc +++ b/extra/mariabackup/write_filt.cc @@ -124,8 +124,8 @@ wf_incremental_process(xb_write_filt_ctxt_t *ctxt, ds_file_t *dstfile) i++, page += page_size) { if ((!cp->corrupted_pages || - !cp->corrupted_pages->contains(cursor->node->space->id, - cursor->buf_page_no + i)) && + !cp->corrupted_pages->contains({cursor->node->space->id, + cursor->buf_page_no + i})) && incremental_lsn >= mach_read_from_8(page + FIL_PAGE_LSN)) continue; diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index ae415b08c3e..61df34e28d1 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -369,45 +369,45 @@ CorruptedPages::CorruptedPages() { ut_a(!pthread_mutex_init(&m_mutex, NULL)); } CorruptedPages::~CorruptedPages() { ut_a(!pthread_mutex_destroy(&m_mutex)); } -void CorruptedPages::add_page_no_lock(const char *space_name, ulint space_id, - unsigned page_no, +void CorruptedPages::add_page_no_lock(const char *space_name, + page_id_t page_id, bool convert_space_name) { - space_info_t &space_info = m_spaces[space_id]; + space_info_t &space_info = m_spaces[page_id.space()]; if (space_info.space_name.empty()) space_info.space_name= convert_space_name ? filename_to_spacename(space_name, strlen(space_name)) : space_name; - (void)space_info.pages.insert(page_no); + (void)space_info.pages.insert(page_id.page_no()); } -void CorruptedPages::add_page(const char *file_name, ulint space_id, - unsigned page_no) +void CorruptedPages::add_page(const char *file_name, page_id_t page_id) { - ut_a(!pthread_mutex_lock(&m_mutex)); - add_page_no_lock(file_name, space_id, page_no, true); - ut_a(!pthread_mutex_unlock(&m_mutex)); + pthread_mutex_lock(&m_mutex); + add_page_no_lock(file_name, page_id, true); + pthread_mutex_unlock(&m_mutex); } -bool CorruptedPages::contains(ulint space_id, unsigned page_no) const +bool CorruptedPages::contains(page_id_t page_id) const { bool result = false; ut_a(!pthread_mutex_lock(&m_mutex)); - container_t::const_iterator space_it= m_spaces.find(space_id); + container_t::const_iterator space_it= m_spaces.find(page_id.space()); if (space_it != m_spaces.end()) - result = space_it->second.pages.count(page_no); + result = space_it->second.pages.count(page_id.page_no()); ut_a(!pthread_mutex_unlock(&m_mutex)); return result; } -void CorruptedPages::drop_space(ulint space_id) +void CorruptedPages::drop_space(uint32_t space_id) { ut_a(!pthread_mutex_lock(&m_mutex)); m_spaces.erase(space_id); ut_a(!pthread_mutex_unlock(&m_mutex)); } -void CorruptedPages::rename_space(ulint space_id, const std::string &new_name) +void CorruptedPages::rename_space(uint32_t space_id, + const std::string &new_name) { ut_a(!pthread_mutex_lock(&m_mutex)); container_t::iterator space_it = m_spaces.find(space_id); @@ -468,7 +468,7 @@ void CorruptedPages::read_from_file(const char *file_name) strerror(errno)); std::string line; std::string space_name; - ulint space_id; + uint32_t space_id; ulint line_number= 0; while (std::getline(infile, line)) { @@ -488,7 +488,7 @@ void CorruptedPages::read_from_file(const char *file_name) std::istringstream iss(line); unsigned page_no; while ((iss >> page_no)) - add_page_no_lock(space_name.c_str(), space_id, page_no, false); + add_page_no_lock(space_name.c_str(), {space_id, page_no}, false); if (!iss.eof()) die("Corrupted pages file parse error on line number " ULINTPF, line_number); @@ -506,7 +506,7 @@ bool CorruptedPages::empty() const static void xb_load_single_table_tablespace(const std::string &space_name, bool set_size, - ulint defer_space_id=0); + uint32_t defer_space_id=0); static void xb_data_files_close(); static fil_space_t* fil_space_get_by_name(const char* name); @@ -521,7 +521,7 @@ void CorruptedPages::zero_out_free_pages() for (container_t::const_iterator space_it= m_spaces.begin(); space_it != m_spaces.end(); ++space_it) { - ulint space_id = space_it->first; + uint32_t space_id = space_it->first; const std::string &space_name = space_it->second.space_name; // There is no need to close tablespaces explixitly as they will be closed // in innodb_shutdown(). @@ -584,7 +584,7 @@ typedef void (*process_single_tablespace_func_t)(const char *dirname, const char *filname, bool is_remote, bool skip_node_page0, - ulint defer_space_id); + uint32_t defer_space_id); static dberr_t enumerate_ibd_files(process_single_tablespace_func_t callback); /* ======== Datafiles iterator ======== */ @@ -774,7 +774,7 @@ static std::string filename_to_spacename(const void *filename, size_t len) @param[in] len length of name, in bytes @param[in] new_name new file name (NULL if not rename) @param[in] new_len length of new_name, in bytes (0 if NULL) */ -static void backup_file_op(ulint space_id, bool create, +static void backup_file_op(uint32_t space_id, bool create, const byte* name, ulint len, const byte* new_name, ulint new_len) { @@ -787,15 +787,15 @@ static void backup_file_op(ulint space_id, bool create, if (create) { ddl_tracker.id_to_name[space_id] = filename_to_spacename(name, len); - msg("DDL tracking : create %zu \"%.*s\"", space_id, int(len), name); + msg("DDL tracking : create %u \"%.*s\"", space_id, int(len), name); } else if (new_name) { ddl_tracker.id_to_name[space_id] = filename_to_spacename(new_name, new_len); - msg("DDL tracking : rename %zu \"%.*s\",\"%.*s\"", + msg("DDL tracking : rename %u \"%.*s\",\"%.*s\"", space_id, int(len), name, int(new_len), new_name); } else { ddl_tracker.drops.insert(space_id); - msg("DDL tracking : delete %zu \"%.*s\"", space_id, int(len), name); + msg("DDL tracking : delete %u \"%.*s\"", space_id, int(len), name); } pthread_mutex_unlock(&backup_mutex); } @@ -810,19 +810,19 @@ static void backup_file_op(ulint space_id, bool create, We will abort backup in this case. */ -static void backup_file_op_fail(ulint space_id, bool create, +static void backup_file_op_fail(uint32_t space_id, bool create, const byte* name, ulint len, const byte* new_name, ulint new_len) { bool fail; if (create) { - msg("DDL tracking : create %zu \"%.*s\"", + msg("DDL tracking : create %u \"%.*s\"", space_id, int(len), name); std::string spacename = filename_to_spacename(name, len); fail = !check_if_skip_table(spacename.c_str()); } else if (new_name) { - msg("DDL tracking : rename %zu \"%.*s\",\"%.*s\"", + msg("DDL tracking : rename %u \"%.*s\",\"%.*s\"", space_id, int(len), name, int(new_len), new_name); std::string spacename = filename_to_spacename(name, len); std::string new_spacename = filename_to_spacename(new_name, new_len); @@ -831,7 +831,7 @@ static void backup_file_op_fail(ulint space_id, bool create, else { std::string spacename = filename_to_spacename(name, len); fail = !check_if_skip_table(spacename.c_str()); - msg("DDL tracking : delete %zu \"%.*s\"", space_id, int(len), name); + msg("DDL tracking : delete %u \"%.*s\"", space_id, int(len), name); } if (fail) { ut_a(opt_no_lock); @@ -1541,7 +1541,7 @@ struct my_option xb_server_options[] = {"innodb_undo_tablespaces", OPT_INNODB_UNDO_TABLESPACES, "Number of undo tablespaces to use.", (G_PTR*)&srv_undo_tablespaces, (G_PTR*)&srv_undo_tablespaces, - 0, GET_ULONG, REQUIRED_ARG, 0, 0, 126, 0, 1, 0}, + 0, GET_UINT, REQUIRED_ARG, 0, 0, 126, 0, 1, 0}, {"innodb_compression_level", OPT_INNODB_COMPRESSION_LEVEL, "Compression level used for zlib compression.", @@ -1612,7 +1612,7 @@ static std::set<std::string> tables_for_export; static void append_export_table(const char *dbname, const char *tablename, bool is_remote, bool skip_node_page0, - ulint defer_space_id) + uint32_t defer_space_id) { if(dbname && tablename && !is_remote) { @@ -1948,7 +1948,7 @@ static bool innodb_init_param() size_t n_shift = get_bit_shift(size_t(innobase_page_size)); if (n_shift >= 12 && n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX) { - srv_page_size_shift = ulong(n_shift); + srv_page_size_shift = uint32_t(n_shift); srv_page_size = 1U << n_shift; msg("InnoDB: The universal page size of the " "database is set to %lu.", srv_page_size); @@ -2298,7 +2298,7 @@ xb_read_delta_metadata(const char *filepath, xb_delta_info_t *info) /* set defaults */ ulint page_size = ULINT_UNDEFINED, zip_size = 0; - info->space_id = ULINT_UNDEFINED; + info->space_id = UINT32_MAX; fp = fopen(filepath, "r"); if (!fp) { @@ -2313,7 +2313,8 @@ xb_read_delta_metadata(const char *filepath, xb_delta_info_t *info) } else if (strcmp(key, "zip_size") == 0) { zip_size = strtoul(value, NULL, 10); } else if (strcmp(key, "space_id") == 0) { - info->space_id = strtoul(value, NULL, 10); + info->space_id = static_cast<uint32_t> + (strtoul(value, NULL, 10)); } } } @@ -2327,7 +2328,7 @@ xb_read_delta_metadata(const char *filepath, xb_delta_info_t *info) info->page_size = zip_size ? zip_size : page_size; } - if (info->space_id == ULINT_UNDEFINED) { + if (info->space_id == UINT32_MAX) { msg("mariabackup: Warning: This backup was taken with XtraBackup 2.0.1 " "or earlier, some DDL operations between full and incremental " "backups may be handled incorrectly"); @@ -2351,7 +2352,7 @@ xb_write_delta_metadata(const char *filename, const xb_delta_info_t *info) snprintf(buf, sizeof(buf), "page_size = " ULINTPF "\n" "zip_size = " ULINTPF " \n" - "space_id = " ULINTPF "\n", + "space_id = %u\n", info->page_size, info->zip_size, info->space_id); @@ -3216,7 +3217,7 @@ static void xb_load_single_table_tablespace(const char *dirname, const char *filname, bool is_remote, bool skip_node_page0, - ulint defer_space_id) + uint32_t defer_space_id) { ut_ad(srv_operation == SRV_OPERATION_BACKUP || srv_operation == SRV_OPERATION_RESTORE_DELTA @@ -3328,7 +3329,7 @@ static void xb_load_single_table_tablespace(const char *dirname, static void xb_load_single_table_tablespace(const std::string &space_name, bool skip_node_page0, - ulint defer_space_id) + uint32_t defer_space_id) { std::string name(space_name); bool is_remote= access((name + ".ibd").c_str(), R_OK) != 0; @@ -3707,9 +3708,9 @@ static dberr_t xb_assign_undo_space_start() pfs_os_file_t file; bool ret; dberr_t error = DB_SUCCESS; - ulint space; + uint32_t space; + uint32_t fsp_flags; int n_retries = 5; - ulint fsp_flags; if (srv_undo_tablespaces == 0) { return error; @@ -3734,7 +3735,7 @@ static dberr_t xb_assign_undo_space_start() } fsp_flags = mach_read_from_4( - page + FSP_HEADER_OFFSET + FSP_SPACE_FLAGS); + page + FSP_HEADER_OFFSET + FSP_SPACE_FLAGS); retry: if (os_file_read(IORequestRead, file, page, TRX_SYS_PAGE_NO << srv_page_size_shift, @@ -4766,7 +4767,7 @@ void backup_fix_ddl(CorruptedPages &corrupted_pages) iter++) { const std::string name = iter->second; - ulint id = iter->first; + uint32_t id = iter->first; if (ddl_tracker.drops.find(id) != ddl_tracker.drops.end()) { dropped_tables.insert(name); @@ -4792,7 +4793,7 @@ void backup_fix_ddl(CorruptedPages &corrupted_pages) iter != ddl_tracker.id_to_name.end(); iter++) { - ulint id = iter->first; + uint32_t id = iter->first; std::string name = iter->second; if (ddl_tracker.tables_in_backup.find(id) != ddl_tracker.tables_in_backup.end()) { @@ -4903,8 +4904,8 @@ bool xb_space_create_file( /*==================*/ const char* path, /*!<in: path to tablespace */ - ulint space_id, /*!<in: space id */ - ulint flags, /*!<in: tablespace flags */ + uint32_t space_id, /*!<in: space id */ + uint32_t flags, /*!<in: tablespace flags */ pfs_os_file_t* file) /*!<out: file handle */ { bool ret; @@ -4967,7 +4968,7 @@ xb_delta_open_matching_space( ut_a(dbname != NULL || !fil_is_user_tablespace_id(info.space_id) || - info.space_id == ULINT_UNDEFINED); + info.space_id == UINT32_MAX); *success = false; @@ -5043,14 +5044,14 @@ exit: if (fil_space != NULL) { if (fil_space->id == info.space_id - || info.space_id == ULINT_UNDEFINED) { + || info.space_id == UINT32_MAX) { /* we found matching space */ goto found; } else { char tmpname[FN_REFLEN]; - snprintf(tmpname, FN_REFLEN, "%s/xtrabackup_tmp_#" ULINTPF, + snprintf(tmpname, FN_REFLEN, "%s/xtrabackup_tmp_#%u", dbname, fil_space->id); msg("mariabackup: Renaming %s to %s.ibd", @@ -5064,7 +5065,7 @@ exit: } } - if (info.space_id == ULINT_UNDEFINED) + if (info.space_id == UINT32_MAX) { die("Can't handle DDL operation on tablespace " "%s\n", dest_space_name); @@ -5090,7 +5091,7 @@ exit: } /* No matching space found. create the new one. */ - const ulint flags = info.zip_size + const uint32_t flags = info.zip_size ? get_bit_shift(info.page_size >> (UNIV_ZIP_SIZE_SHIFT_MIN - 1)) << FSP_FLAGS_POS_ZIP_SSIZE diff --git a/extra/mariabackup/xtrabackup.h b/extra/mariabackup/xtrabackup.h index 37cc54e5abb..f2d76ff4103 100644 --- a/extra/mariabackup/xtrabackup.h +++ b/extra/mariabackup/xtrabackup.h @@ -29,12 +29,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA struct xb_delta_info_t { - xb_delta_info_t(ulint page_size, ulint zip_size, ulint space_id) + xb_delta_info_t(ulint page_size, ulint zip_size, uint32_t space_id) : page_size(page_size), zip_size(zip_size), space_id(space_id) {} ulint page_size; ulint zip_size; - ulint space_id; + uint32_t space_id; }; class CorruptedPages @@ -42,23 +42,23 @@ class CorruptedPages public: CorruptedPages(); ~CorruptedPages(); - void add_page(const char *file_name, ulint space_id, unsigned page_no); - bool contains(ulint space_id, unsigned page_no) const; - void drop_space(ulint space_id); - void rename_space(ulint space_id, const std::string &new_name); + void add_page(const char *file_name, page_id_t page_id); + bool contains(page_id_t page_id) const; + void drop_space(uint32_t space_id); + void rename_space(uint32_t space_id, const std::string &new_name); bool print_to_file(const char *file_name) const; void read_from_file(const char *file_name); bool empty() const; void zero_out_free_pages(); private: - void add_page_no_lock(const char *space_name, ulint space_id, - unsigned page_no, bool convert_space_name); + void add_page_no_lock(const char *space_name, page_id_t page_id, + bool convert_space_name); struct space_info_t { std::string space_name; - std::set<unsigned> pages; + std::set<uint32_t> pages; }; - typedef std::map<ulint, space_info_t> container_t; + typedef std::map<uint32_t, space_info_t> container_t; mutable pthread_mutex_t m_mutex; container_t m_spaces; }; diff --git a/include/json_lib.h b/include/json_lib.h index bb649928eaa..6d802860cff 100644 --- a/include/json_lib.h +++ b/include/json_lib.h @@ -1,6 +1,8 @@ #ifndef JSON_LIB_INCLUDED #define JSON_LIB_INCLUDED +#include <my_sys.h> + #ifdef __cplusplus extern "C" { #endif @@ -172,7 +174,7 @@ enum json_states { enum json_value_types { - JSON_VALUE_UNINITALIZED=0, + JSON_VALUE_UNINITIALIZED=0, JSON_VALUE_OBJECT=1, JSON_VALUE_ARRAY=2, JSON_VALUE_STRING=3, @@ -431,6 +433,9 @@ int json_locate_key(const char *js, const char *js_end, const char **key_start, const char **key_end, int *comma_pos); +int json_normalize(DYNAMIC_STRING *result, + const char *s, size_t size, CHARSET_INFO *cs); + #ifdef __cplusplus } #endif diff --git a/include/my_alloc.h b/include/my_alloc.h index 181f637c093..3001c4efcec 100644 --- a/include/my_alloc.h +++ b/include/my_alloc.h @@ -50,11 +50,12 @@ typedef struct st_mem_root first free block in queue test counter (if it exceed MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list) */ - unsigned int first_block_usage; + unsigned short first_block_usage; + unsigned short flags; void (*error_handler)(void); - PSI_memory_key m_psi_key; + PSI_memory_key psi_key; } MEM_ROOT; #ifdef __cplusplus diff --git a/include/my_bitmap.h b/include/my_bitmap.h index f19254404c1..f88a6fe8d9d 100644 --- a/include/my_bitmap.h +++ b/include/my_bitmap.h @@ -28,12 +28,6 @@ typedef struct st_bitmap { my_bitmap_map *bitmap; my_bitmap_map *last_word_ptr; - /* - mutex will be acquired for the duration of each bitmap operation if - thread_safe flag in bitmap_init was set. Otherwise, we optimize by not - acquiring the mutex - */ - mysql_mutex_t *mutex; my_bitmap_map last_word_mask; uint32 n_bits; /* number of bits occupied by the above */ } MY_BITMAP; @@ -42,15 +36,11 @@ typedef struct st_bitmap extern "C" { #endif -/* compatibility functions */ -#define bitmap_init(A,B,C,D) my_bitmap_init(A,B,C,D) -#define bitmap_free(A) my_bitmap_free(A) /* Reset memory. Faster then doing a full bzero */ #define my_bitmap_clear(A) ((A)->bitmap= 0) extern void create_last_word_mask(MY_BITMAP *map); -extern my_bool my_bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits, - my_bool thread_safe); +extern my_bool my_bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits); extern my_bool bitmap_is_clear_all(const MY_BITMAP *map); extern my_bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size); extern my_bool bitmap_is_set_all(const MY_BITMAP *map); @@ -82,8 +72,6 @@ extern void bitmap_xor(MY_BITMAP *map, const MY_BITMAP *map2); extern void bitmap_invert(MY_BITMAP *map); extern void bitmap_copy(MY_BITMAP *map, const MY_BITMAP *map2); -extern uint bitmap_lock_set_next(MY_BITMAP *map); -extern void bitmap_lock_clear_bit(MY_BITMAP *map, uint bitmap_bit); /* Fast, not thread safe, bitmap functions */ #define bitmap_buffer_size(bits) (((bits)+31)/32)*4 #define no_bytes_in_map(map) (((map)->n_bits + 7)/8) diff --git a/include/my_sys.h b/include/my_sys.h index f5cd3e7a461..dae4777db11 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -94,6 +94,7 @@ C_MODE_START #define MY_SYNC_DIR 32768U /* my_create/delete/rename: sync directory */ #define MY_SYNC_FILESIZE 65536U /* my_sync(): safe sync when file is extended */ #define MY_THREAD_SPECIFIC 0x10000U /* my_malloc(): thread specific */ +#define MY_ROOT_USE_MPROTECT 0x20000U /* init_alloc_root: read only segments */ /* Tree that should delete things automatically */ #define MY_TREE_WITH_DELETE 0x40000U @@ -284,6 +285,7 @@ extern my_bool my_disable_async_io, extern my_bool my_disable_sync, my_disable_copystat_in_redel; extern char wild_many,wild_one,wild_prefix; extern const char *charsets_dir; +extern size_t my_system_page_size; enum cache_type { @@ -887,7 +889,6 @@ extern void my_free_lock(void *ptr); #define my_free_lock(A) my_free((A)) #endif #define alloc_root_inited(A) ((A)->min_malloc != 0) -#define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8) #define clear_alloc_root(A) do { (A)->free= (A)->used= (A)->pre_alloc= 0; (A)->min_malloc=0;} while(0) extern void init_alloc_root(PSI_memory_key key, MEM_ROOT *mem_root, size_t block_size, size_t pre_alloc_size, @@ -898,6 +899,7 @@ extern void free_root(MEM_ROOT *root, myf MyFLAGS); extern void set_prealloc_root(MEM_ROOT *root, char *ptr); extern void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size, size_t prealloc_size); +extern void protect_root(MEM_ROOT *root, int prot); extern char *strdup_root(MEM_ROOT *root,const char *str); static inline char *safe_strdup_root(MEM_ROOT *root, const char *str) { diff --git a/include/mysql.h.pp b/include/mysql.h.pp index 584276a7a08..4ffc271a644 100644 --- a/include/mysql.h.pp +++ b/include/mysql.h.pp @@ -259,9 +259,10 @@ typedef struct st_mem_root size_t min_malloc; size_t block_size; unsigned int block_num; - unsigned int first_block_usage; + unsigned short first_block_usage; + unsigned short flags; void (*error_handler)(void); - PSI_memory_key m_psi_key; + PSI_memory_key psi_key; } MEM_ROOT; } typedef struct st_typelib { diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index c8e75c897b9..d2cbb9a85ee 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -86,7 +86,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc ../sql/select_handler.cc ../sql/sql_show.cc ../sql/sql_state.c ../sql/sql_statistics.cc ../sql/sql_string.cc - ../sql/sql_tablespace.cc ../sql/sql_table.cc ../sql/sql_test.cc + ../sql/sql_table.cc ../sql/sql_test.cc ../sql/ddl_log.cc ../sql/sql_trigger.cc ../sql/sql_udf.cc ../sql/sql_union.cc ../sql/sql_update.cc ../sql/sql_view.cc ../sql/sql_profile.cc diff --git a/mysql-test/include/ctype_ascii_order.inc b/mysql-test/include/ctype_ascii_order.inc index 93127a7195f..b85cab687ae 100644 --- a/mysql-test/include/ctype_ascii_order.inc +++ b/mysql-test/include/ctype_ascii_order.inc @@ -4,11 +4,16 @@ drop table if exists t1; create table t1 select repeat('a',10) as c1; delete from t1; +insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); -SELECT GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM t1 GROUP BY c1; +create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1; +select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1'; +SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1; drop table t1; +drop view v1; diff --git a/mysql-test/include/show_slave_status.inc b/mysql-test/include/show_slave_status.inc index ba2e1b0c48a..429ed8a5abd 100644 --- a/mysql-test/include/show_slave_status.inc +++ b/mysql-test/include/show_slave_status.inc @@ -102,6 +102,10 @@ if ($all_slaves_status) if ($slave_name) { --let $_show_query=SHOW SLAVE $slave_name STATUS + if ($for_channel) + { + --let $_show_query=SHOW SLAVE STATUS for channel $slave_name + } } diff --git a/mysql-test/include/wait_for_sql_thread_read_all.inc b/mysql-test/include/wait_for_sql_thread_read_all.inc index 1bbb006f3a8..1829591c5d1 100644 --- a/mysql-test/include/wait_for_sql_thread_read_all.inc +++ b/mysql-test/include/wait_for_sql_thread_read_all.inc @@ -1,6 +1,12 @@ +# This script ensures that a slave has executed everything in the relay log +# files. This can be used to ensure slave is in a predicate place after +# a FLUSH RELAY LOGS command. +# Note that this script does not guarantee that the slave has read everything +# from the master(s). If this is needed on should use the sync_with_master +# command or the sync_with_master script. + --let $show_statement = show all slaves status --let $field = Slave_SQL_State --let $condition = = 'Slave has read all relay log; waiting for more updates' --let $wait_for_all = 1 --source include/wait_show_condition.inc - diff --git a/mysql-test/main/count_distinct.result b/mysql-test/main/count_distinct.result index 760b2710586..037674aa66a 100644 --- a/mysql-test/main/count_distinct.result +++ b/mysql-test/main/count_distinct.result @@ -1,4 +1,3 @@ -drop table if exists t1,t2,t3; create table t1 (libname varchar(21) not null, city text, primary key (libname)); create table t2 (isbn varchar(21) not null, author text, title text, primary key (isbn)); create table t3 (isbn varchar(21) not null, libname varchar(21) not null, quantity int ,primary key (isbn,libname)); @@ -131,3 +130,16 @@ count(distinct a) 10 drop table t1; set @@tmp_table_size = default; +# +# End of 5.5 tests +# +# +# MDEV-26452 SIGSEGV in Item::cleanup from Item::cleanup_processor +# +create table t (a int,b date,primary key(a,b)); +select b,count(distinct a) from t group by b having b is null; +b count(distinct a) +drop table t; +# +# End of 10.7 tests +# diff --git a/mysql-test/main/count_distinct.test b/mysql-test/main/count_distinct.test index 86045e862e7..9f682af3d63 100644 --- a/mysql-test/main/count_distinct.test +++ b/mysql-test/main/count_distinct.test @@ -2,10 +2,6 @@ # Problem with count(distinct) # ---disable_warnings -drop table if exists t1,t2,t3; ---enable_warnings - create table t1 (libname varchar(21) not null, city text, primary key (libname)); create table t2 (isbn varchar(21) not null, author text, title text, primary key (isbn)); create table t3 (isbn varchar(21) not null, libname varchar(21) not null, quantity int ,primary key (isbn,libname)); @@ -149,6 +145,17 @@ select count(distinct a) from t1; drop table t1; set @@tmp_table_size = default; -# -# End of 5.5 tests -# +--echo # +--echo # End of 5.5 tests +--echo # + +--echo # +--echo # MDEV-26452 SIGSEGV in Item::cleanup from Item::cleanup_processor +--echo # +create table t (a int,b date,primary key(a,b)); +select b,count(distinct a) from t group by b having b is null; +drop table t; + +--echo # +--echo # End of 10.7 tests +--echo # diff --git a/mysql-test/main/ctype_big5.result b/mysql-test/main/ctype_big5.result index 66d4bb54023..2bea9cd2619 100644 --- a/mysql-test/main/ctype_big5.result +++ b/mysql-test/main/ctype_big5.result @@ -246,14 +246,53 @@ DROP TABLE t1; drop table if exists t1; create table t1 select repeat('a',10) as c1; delete from t1; +insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); -SELECT GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM t1 GROUP BY c1; -GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1; +select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1'; +column_name collation_name +c1 big5_chinese_ci +name big5_chinese_ci +SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1; +GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +<00> 00 +<01> 01 +<02> 02 +<03> 03 +<04> 04 +<05> 05 +<06> 06 +<07> 07 +<08> 08 +<09> 09 +<0A> 0A +<0B> 0B +<0C> 0C +<0D> 0D +<0E> 0E +<0F> 0F +<10> 10 +<11> 11 +<12> 12 +<13> 13 +<14> 14 +<15> 15 +<16> 16 +<17> 17 +<18> 18 +<19> 19 +<1A> 1A +<1B> 1B +<1C> 1C +<1D> 1D +<1E> 1E +<1F> 1F 20 ! 21 " 22 @@ -321,8 +360,9 @@ _ 5F { 7B | 7C } 7D - 7F +<7F> 7F drop table t1; +drop view v1; SELECT strcmp('a','a '), strcmp('a ','a'); strcmp('a','a ') strcmp('a ','a') 0 0 @@ -479,6 +519,154 @@ a hex(b) c 3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL 4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL DROP TABLE t1; +drop table if exists t1; +create table t1 select repeat('a',10) as c1; +delete from t1; +insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1; +select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1'; +column_name collation_name +c1 big5_bin +name big5_bin +SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1; +GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +<00> 00 +<01> 01 +<02> 02 +<03> 03 +<04> 04 +<05> 05 +<06> 06 +<07> 07 +<08> 08 +<09> 09 +<0A> 0A +<0B> 0B +<0C> 0C +<0D> 0D +<0E> 0E +<0F> 0F +<10> 10 +<11> 11 +<12> 12 +<13> 13 +<14> 14 +<15> 15 +<16> 16 +<17> 17 +<18> 18 +<19> 19 +<1A> 1A +<1B> 1B +<1C> 1C +<1D> 1D +<1E> 1E +<1F> 1F + 20 +! 21 +" 22 +# 23 +$ 24 +% 25 +& 26 +' 27 +( 28 +) 29 +* 2A ++ 2B +, 2C +- 2D +. 2E +/ 2F +0 30 +1 31 +2 32 +3 33 +4 34 +5 35 +6 36 +7 37 +8 38 +9 39 +: 3A +; 3B +< 3C += 3D +> 3E +? 3F +@ 40 +A 41 +B 42 +C 43 +D 44 +E 45 +F 46 +G 47 +H 48 +I 49 +J 4A +K 4B +L 4C +M 4D +N 4E +O 4F +P 50 +Q 51 +R 52 +S 53 +T 54 +U 55 +V 56 +W 57 +X 58 +Y 59 +Z 5A +[ 5B +\ 5C +] 5D +^ 5E +_ 5F +` 60 +a 61 +b 62 +c 63 +d 64 +e 65 +f 66 +g 67 +h 68 +i 69 +j 6A +k 6B +l 6C +m 6D +n 6E +o 6F +p 70 +q 71 +r 72 +s 73 +t 74 +u 75 +v 76 +w 77 +x 78 +y 79 +z 7A +{ 7B +| 7C +} 7D +~ 7E +<7F> 7F +drop table t1; +drop view v1; SELECT strcmp('a','a '), strcmp('a ','a'); strcmp('a','a ') strcmp('a ','a') 0 0 diff --git a/mysql-test/main/ctype_big5.test b/mysql-test/main/ctype_big5.test index 41991258886..385f1c21439 100644 --- a/mysql-test/main/ctype_big5.test +++ b/mysql-test/main/ctype_big5.test @@ -24,6 +24,7 @@ SET collation_connection='big5_bin'; -- source include/ctype_innodb_like.inc -- source include/ctype_like_escape.inc -- source include/ctype_like_range_f1f2.inc +-- source include/ctype_ascii_order.inc -- source include/ctype_pad_space.inc # diff --git a/mysql-test/main/ctype_cp932.result b/mysql-test/main/ctype_cp932.result index 952130cf11c..ff1dd814970 100644 --- a/mysql-test/main/ctype_cp932.result +++ b/mysql-test/main/ctype_cp932.result @@ -598,6 +598,281 @@ SET DEFAULT_STORAGE_ENGINE=Default; # End of 10.2 tests # # +# General tests +# +SET NAMES cp932; +drop table if exists t1; +create table t1 select repeat('a',10) as c1; +delete from t1; +insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1; +select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1'; +column_name collation_name +c1 cp932_japanese_ci +name cp932_japanese_ci +SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1; +GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +<00> 00 +<01> 01 +<02> 02 +<03> 03 +<04> 04 +<05> 05 +<06> 06 +<07> 07 +<08> 08 +<09> 09 +<0A> 0A +<0B> 0B +<0C> 0C +<0D> 0D +<0E> 0E +<0F> 0F +<10> 10 +<11> 11 +<12> 12 +<13> 13 +<14> 14 +<15> 15 +<16> 16 +<17> 17 +<18> 18 +<19> 19 +<1A> 1A +<1B> 1B +<1C> 1C +<1D> 1D +<1E> 1E +<1F> 1F + 20 +! 21 +" 22 +# 23 +$ 24 +% 25 +& 26 +' 27 +( 28 +) 29 +* 2A ++ 2B +, 2C +- 2D +. 2E +/ 2F +0 30 +1 31 +2 32 +3 33 +4 34 +5 35 +6 36 +7 37 +8 38 +9 39 +: 3A +; 3B +< 3C += 3D +> 3E +? 3F +@ 40 +Aa 41,61 +Bb 42,62 +Cc 43,63 +Dd 44,64 +Ee 45,65 +Ff 46,66 +Gg 47,67 +Hh 48,68 +Ii 49,69 +Jj 4A,6A +Kk 4B,6B +Ll 4C,6C +Mm 4D,6D +Nn 4E,6E +Oo 4F,6F +Pp 50,70 +Qq 51,71 +Rr 52,72 +Ss 53,73 +Tt 54,74 +Uu 55,75 +Vv 56,76 +Ww 57,77 +Xx 58,78 +Yy 59,79 +Zz 5A,7A +[ 5B +\ 5C +] 5D +^ 5E +_ 5F +` 60 +{ 7B +| 7C +} 7D +~ 7E +<7F> 7F +drop table t1; +drop view v1; +SET NAMES cp932 COLLATE cp932_bin; +drop table if exists t1; +create table t1 select repeat('a',10) as c1; +delete from t1; +insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1; +select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1'; +column_name collation_name +c1 cp932_bin +name cp932_bin +SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1; +GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +<00> 00 +<01> 01 +<02> 02 +<03> 03 +<04> 04 +<05> 05 +<06> 06 +<07> 07 +<08> 08 +<09> 09 +<0A> 0A +<0B> 0B +<0C> 0C +<0D> 0D +<0E> 0E +<0F> 0F +<10> 10 +<11> 11 +<12> 12 +<13> 13 +<14> 14 +<15> 15 +<16> 16 +<17> 17 +<18> 18 +<19> 19 +<1A> 1A +<1B> 1B +<1C> 1C +<1D> 1D +<1E> 1E +<1F> 1F + 20 +! 21 +" 22 +# 23 +$ 24 +% 25 +& 26 +' 27 +( 28 +) 29 +* 2A ++ 2B +, 2C +- 2D +. 2E +/ 2F +0 30 +1 31 +2 32 +3 33 +4 34 +5 35 +6 36 +7 37 +8 38 +9 39 +: 3A +; 3B +< 3C += 3D +> 3E +? 3F +@ 40 +A 41 +B 42 +C 43 +D 44 +E 45 +F 46 +G 47 +H 48 +I 49 +J 4A +K 4B +L 4C +M 4D +N 4E +O 4F +P 50 +Q 51 +R 52 +S 53 +T 54 +U 55 +V 56 +W 57 +X 58 +Y 59 +Z 5A +[ 5B +\ 5C +] 5D +^ 5E +_ 5F +` 60 +a 61 +b 62 +c 63 +d 64 +e 65 +f 66 +g 67 +h 68 +i 69 +j 6A +k 6B +l 6C +m 6D +n 6E +o 6F +p 70 +q 71 +r 72 +s 73 +t 74 +u 75 +v 76 +w 77 +x 78 +y 79 +z 7A +{ 7B +| 7C +} 7D +~ 7E +<7F> 7F +drop table t1; +drop view v1; +# # Start of 10.5 tests # # diff --git a/mysql-test/main/ctype_cp932.test b/mysql-test/main/ctype_cp932.test index 0f5ff437d33..2ccbe8f1582 100644 --- a/mysql-test/main/ctype_cp932.test +++ b/mysql-test/main/ctype_cp932.test @@ -50,6 +50,15 @@ let $coll_pad='cp932_bin'; --echo # +--echo # General tests +--echo # +SET NAMES cp932; +-- source include/ctype_ascii_order.inc +SET NAMES cp932 COLLATE cp932_bin; +-- source include/ctype_ascii_order.inc + + +--echo # --echo # Start of 10.5 tests --echo # diff --git a/mysql-test/main/ctype_eucjpms.result b/mysql-test/main/ctype_eucjpms.result index db445838102..a7688be6ad0 100644 --- a/mysql-test/main/ctype_eucjpms.result +++ b/mysql-test/main/ctype_eucjpms.result @@ -2,6 +2,281 @@ drop table if exists t1; drop table if exists t2; drop table if exists t3; drop table if exists t4; +# +# General tests +# +SET NAMES eucjpms; +drop table if exists t1; +create table t1 select repeat('a',10) as c1; +delete from t1; +insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1; +select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1'; +column_name collation_name +c1 eucjpms_japanese_ci +name eucjpms_japanese_ci +SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1; +GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +<00> 00 +<01> 01 +<02> 02 +<03> 03 +<04> 04 +<05> 05 +<06> 06 +<07> 07 +<08> 08 +<09> 09 +<0A> 0A +<0B> 0B +<0C> 0C +<0D> 0D +<0E> 0E +<0F> 0F +<10> 10 +<11> 11 +<12> 12 +<13> 13 +<14> 14 +<15> 15 +<16> 16 +<17> 17 +<18> 18 +<19> 19 +<1A> 1A +<1B> 1B +<1C> 1C +<1D> 1D +<1E> 1E +<1F> 1F + 20 +! 21 +" 22 +# 23 +$ 24 +% 25 +& 26 +' 27 +( 28 +) 29 +* 2A ++ 2B +, 2C +- 2D +. 2E +/ 2F +0 30 +1 31 +2 32 +3 33 +4 34 +5 35 +6 36 +7 37 +8 38 +9 39 +: 3A +; 3B +< 3C += 3D +> 3E +? 3F +@ 40 +Aa 41,61 +Bb 42,62 +Cc 43,63 +Dd 44,64 +Ee 45,65 +Ff 46,66 +Gg 47,67 +Hh 48,68 +Ii 49,69 +Jj 4A,6A +Kk 4B,6B +Ll 4C,6C +Mm 4D,6D +Nn 4E,6E +Oo 4F,6F +Pp 50,70 +Qq 51,71 +Rr 52,72 +Ss 53,73 +Tt 54,74 +Uu 55,75 +Vv 56,76 +Ww 57,77 +Xx 58,78 +Yy 59,79 +Zz 5A,7A +[ 5B +\ 5C +] 5D +^ 5E +_ 5F +` 60 +{ 7B +| 7C +} 7D +~ 7E +<7F> 7F +drop table t1; +drop view v1; +SET NAMES eucjpms COLLATE eucjpms_bin; +drop table if exists t1; +create table t1 select repeat('a',10) as c1; +delete from t1; +insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1; +select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1'; +column_name collation_name +c1 eucjpms_bin +name eucjpms_bin +SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1; +GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +<00> 00 +<01> 01 +<02> 02 +<03> 03 +<04> 04 +<05> 05 +<06> 06 +<07> 07 +<08> 08 +<09> 09 +<0A> 0A +<0B> 0B +<0C> 0C +<0D> 0D +<0E> 0E +<0F> 0F +<10> 10 +<11> 11 +<12> 12 +<13> 13 +<14> 14 +<15> 15 +<16> 16 +<17> 17 +<18> 18 +<19> 19 +<1A> 1A +<1B> 1B +<1C> 1C +<1D> 1D +<1E> 1E +<1F> 1F + 20 +! 21 +" 22 +# 23 +$ 24 +% 25 +& 26 +' 27 +( 28 +) 29 +* 2A ++ 2B +, 2C +- 2D +. 2E +/ 2F +0 30 +1 31 +2 32 +3 33 +4 34 +5 35 +6 36 +7 37 +8 38 +9 39 +: 3A +; 3B +< 3C += 3D +> 3E +? 3F +@ 40 +A 41 +B 42 +C 43 +D 44 +E 45 +F 46 +G 47 +H 48 +I 49 +J 4A +K 4B +L 4C +M 4D +N 4E +O 4F +P 50 +Q 51 +R 52 +S 53 +T 54 +U 55 +V 56 +W 57 +X 58 +Y 59 +Z 5A +[ 5B +\ 5C +] 5D +^ 5E +_ 5F +` 60 +a 61 +b 62 +c 63 +d 64 +e 65 +f 66 +g 67 +h 68 +i 69 +j 6A +k 6B +l 6C +m 6D +n 6E +o 6F +p 70 +q 71 +r 72 +s 73 +t 74 +u 75 +v 76 +w 77 +x 78 +y 79 +z 7A +{ 7B +| 7C +} 7D +~ 7E +<7F> 7F +drop table t1; +drop view v1; set names eucjpms; set character_set_database = eucjpms; CREATE TABLE t1(c1 CHAR(1)) DEFAULT CHARACTER SET = eucjpms; diff --git a/mysql-test/main/ctype_eucjpms.test b/mysql-test/main/ctype_eucjpms.test index 6af72270853..393534182dc 100644 --- a/mysql-test/main/ctype_eucjpms.test +++ b/mysql-test/main/ctype_eucjpms.test @@ -8,6 +8,14 @@ drop table if exists t3; drop table if exists t4; --enable_warnings +--echo # +--echo # General tests +--echo # +SET NAMES eucjpms; +-- source include/ctype_ascii_order.inc +SET NAMES eucjpms COLLATE eucjpms_bin; +-- source include/ctype_ascii_order.inc + set names eucjpms; set character_set_database = eucjpms; diff --git a/mysql-test/main/ctype_euckr.result b/mysql-test/main/ctype_euckr.result index 37b7e86543f..f349b9c25e0 100644 --- a/mysql-test/main/ctype_euckr.result +++ b/mysql-test/main/ctype_euckr.result @@ -243,6 +243,128 @@ a hex(b) c 3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL 4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL DROP TABLE t1; +drop table if exists t1; +create table t1 select repeat('a',10) as c1; +delete from t1; +insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1; +select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1'; +column_name collation_name +c1 euckr_korean_ci +name euckr_korean_ci +SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1; +GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +<00> 00 +<01> 01 +<02> 02 +<03> 03 +<04> 04 +<05> 05 +<06> 06 +<07> 07 +<08> 08 +<09> 09 +<0A> 0A +<0B> 0B +<0C> 0C +<0D> 0D +<0E> 0E +<0F> 0F +<10> 10 +<11> 11 +<12> 12 +<13> 13 +<14> 14 +<15> 15 +<16> 16 +<17> 17 +<18> 18 +<19> 19 +<1A> 1A +<1B> 1B +<1C> 1C +<1D> 1D +<1E> 1E +<1F> 1F + 20 +! 21 +" 22 +# 23 +$ 24 +% 25 +& 26 +' 27 +( 28 +) 29 +* 2A ++ 2B +, 2C +- 2D +. 2E +/ 2F +0 30 +1 31 +2 32 +3 33 +4 34 +5 35 +6 36 +7 37 +8 38 +9 39 +: 3A +; 3B +< 3C += 3D +> 3E +? 3F +@ 40 +Aa 41,61 +Bb 42,62 +Cc 43,63 +Dd 44,64 +Ee 45,65 +Ff 46,66 +Gg 47,67 +Hh 48,68 +Ii 49,69 +Jj 4A,6A +Kk 4B,6B +Ll 4C,6C +Mm 4D,6D +Nn 4E,6E +Oo 4F,6F +Pp 50,70 +Qq 51,71 +Rr 52,72 +Ss 53,73 +Tt 54,74 +Uu 55,75 +Vv 56,76 +Ww 57,77 +Xx 58,78 +Yy 59,79 +Zz 5A,7A +[ 5B +\ 5C +] 5D +^ 5E +_ 5F +` 60 +{ 7B +| 7C +} 7D +~ 7E +<7F> 7F +drop table t1; +drop view v1; SET collation_connection='euckr_bin'; create table t1 select repeat('a',4000) a; delete from t1; @@ -384,6 +506,154 @@ a hex(b) c 3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL 4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL DROP TABLE t1; +drop table if exists t1; +create table t1 select repeat('a',10) as c1; +delete from t1; +insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1; +select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1'; +column_name collation_name +c1 euckr_bin +name euckr_bin +SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1; +GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +<00> 00 +<01> 01 +<02> 02 +<03> 03 +<04> 04 +<05> 05 +<06> 06 +<07> 07 +<08> 08 +<09> 09 +<0A> 0A +<0B> 0B +<0C> 0C +<0D> 0D +<0E> 0E +<0F> 0F +<10> 10 +<11> 11 +<12> 12 +<13> 13 +<14> 14 +<15> 15 +<16> 16 +<17> 17 +<18> 18 +<19> 19 +<1A> 1A +<1B> 1B +<1C> 1C +<1D> 1D +<1E> 1E +<1F> 1F + 20 +! 21 +" 22 +# 23 +$ 24 +% 25 +& 26 +' 27 +( 28 +) 29 +* 2A ++ 2B +, 2C +- 2D +. 2E +/ 2F +0 30 +1 31 +2 32 +3 33 +4 34 +5 35 +6 36 +7 37 +8 38 +9 39 +: 3A +; 3B +< 3C += 3D +> 3E +? 3F +@ 40 +A 41 +B 42 +C 43 +D 44 +E 45 +F 46 +G 47 +H 48 +I 49 +J 4A +K 4B +L 4C +M 4D +N 4E +O 4F +P 50 +Q 51 +R 52 +S 53 +T 54 +U 55 +V 56 +W 57 +X 58 +Y 59 +Z 5A +[ 5B +\ 5C +] 5D +^ 5E +_ 5F +` 60 +a 61 +b 62 +c 63 +d 64 +e 65 +f 66 +g 67 +h 68 +i 69 +j 6A +k 6B +l 6C +m 6D +n 6E +o 6F +p 70 +q 71 +r 72 +s 73 +t 74 +u 75 +v 76 +w 77 +x 78 +y 79 +z 7A +{ 7B +| 7C +} 7D +~ 7E +<7F> 7F +drop table t1; +drop view v1; SET NAMES euckr; CREATE TABLE t1 (a text) character set euckr; INSERT INTO t1 VALUES (0xA2E6),(0xFEF7); diff --git a/mysql-test/main/ctype_euckr.test b/mysql-test/main/ctype_euckr.test index 1154047fdb0..e4f07081dba 100644 --- a/mysql-test/main/ctype_euckr.test +++ b/mysql-test/main/ctype_euckr.test @@ -17,11 +17,13 @@ SET collation_connection='euckr_korean_ci'; -- source include/ctype_innodb_like.inc -- source include/ctype_like_escape.inc -- source include/ctype_like_range_f1f2.inc +-- source include/ctype_ascii_order.inc SET collation_connection='euckr_bin'; -- source include/ctype_filesort.inc -- source include/ctype_innodb_like.inc -- source include/ctype_like_escape.inc -- source include/ctype_like_range_f1f2.inc +-- source include/ctype_ascii_order.inc # # Bug#15377 Valid multibyte sequences are truncated on INSERT diff --git a/mysql-test/main/ctype_gb2312.result b/mysql-test/main/ctype_gb2312.result index 42a837b37e1..cdfe6370784 100644 --- a/mysql-test/main/ctype_gb2312.result +++ b/mysql-test/main/ctype_gb2312.result @@ -246,14 +246,53 @@ DROP TABLE t1; drop table if exists t1; create table t1 select repeat('a',10) as c1; delete from t1; +insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); -SELECT GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM t1 GROUP BY c1; -GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1; +select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1'; +column_name collation_name +c1 gb2312_chinese_ci +name gb2312_chinese_ci +SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1; +GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +<00> 00 +<01> 01 +<02> 02 +<03> 03 +<04> 04 +<05> 05 +<06> 06 +<07> 07 +<08> 08 +<09> 09 +<0A> 0A +<0B> 0B +<0C> 0C +<0D> 0D +<0E> 0E +<0F> 0F +<10> 10 +<11> 11 +<12> 12 +<13> 13 +<14> 14 +<15> 15 +<16> 16 +<17> 17 +<18> 18 +<19> 19 +<1A> 1A +<1B> 1B +<1C> 1C +<1D> 1D +<1E> 1E +<1F> 1F 20 ! 21 " 22 @@ -322,8 +361,9 @@ _ 5F { 7B | 7C } 7D - 7F +<7F> 7F drop table t1; +drop view v1; SET collation_connection='gb2312_bin'; create table t1 select repeat('a',4000) a; delete from t1; @@ -465,6 +505,154 @@ a hex(b) c 3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL 4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL DROP TABLE t1; +drop table if exists t1; +create table t1 select repeat('a',10) as c1; +delete from t1; +insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1; +select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1'; +column_name collation_name +c1 gb2312_bin +name gb2312_bin +SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1; +GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +<00> 00 +<01> 01 +<02> 02 +<03> 03 +<04> 04 +<05> 05 +<06> 06 +<07> 07 +<08> 08 +<09> 09 +<0A> 0A +<0B> 0B +<0C> 0C +<0D> 0D +<0E> 0E +<0F> 0F +<10> 10 +<11> 11 +<12> 12 +<13> 13 +<14> 14 +<15> 15 +<16> 16 +<17> 17 +<18> 18 +<19> 19 +<1A> 1A +<1B> 1B +<1C> 1C +<1D> 1D +<1E> 1E +<1F> 1F + 20 +! 21 +" 22 +# 23 +$ 24 +% 25 +& 26 +' 27 +( 28 +) 29 +* 2A ++ 2B +, 2C +- 2D +. 2E +/ 2F +0 30 +1 31 +2 32 +3 33 +4 34 +5 35 +6 36 +7 37 +8 38 +9 39 +: 3A +; 3B +< 3C += 3D +> 3E +? 3F +@ 40 +A 41 +B 42 +C 43 +D 44 +E 45 +F 46 +G 47 +H 48 +I 49 +J 4A +K 4B +L 4C +M 4D +N 4E +O 4F +P 50 +Q 51 +R 52 +S 53 +T 54 +U 55 +V 56 +W 57 +X 58 +Y 59 +Z 5A +[ 5B +\ 5C +] 5D +^ 5E +_ 5F +` 60 +a 61 +b 62 +c 63 +d 64 +e 65 +f 66 +g 67 +h 68 +i 69 +j 6A +k 6B +l 6C +m 6D +n 6E +o 6F +p 70 +q 71 +r 72 +s 73 +t 74 +u 75 +v 76 +w 77 +x 78 +y 79 +z 7A +{ 7B +| 7C +} 7D +~ 7E +<7F> 7F +drop table t1; +drop view v1; SET NAMES gb2312; CREATE TABLE t1 (a text) character set gb2312; INSERT INTO t1 VALUES (0xA2A1),(0xD7FE); diff --git a/mysql-test/main/ctype_gb2312.test b/mysql-test/main/ctype_gb2312.test index 07460116ade..6224b8c1cf1 100644 --- a/mysql-test/main/ctype_gb2312.test +++ b/mysql-test/main/ctype_gb2312.test @@ -23,6 +23,7 @@ SET collation_connection='gb2312_bin'; -- source include/ctype_innodb_like.inc -- source include/ctype_like_escape.inc -- source include/ctype_like_range_f1f2.inc +-- source include/ctype_ascii_order.inc # # Bug#15377 Valid multibyte sequences are truncated on INSERT diff --git a/mysql-test/main/ctype_gbk.result b/mysql-test/main/ctype_gbk.result index 23ca646da9a..39c31882387 100644 --- a/mysql-test/main/ctype_gbk.result +++ b/mysql-test/main/ctype_gbk.result @@ -246,14 +246,53 @@ DROP TABLE t1; drop table if exists t1; create table t1 select repeat('a',10) as c1; delete from t1; +insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); -SELECT GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM t1 GROUP BY c1; -GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1; +select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1'; +column_name collation_name +c1 gbk_chinese_ci +name gbk_chinese_ci +SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1; +GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +<00> 00 +<01> 01 +<02> 02 +<03> 03 +<04> 04 +<05> 05 +<06> 06 +<07> 07 +<08> 08 +<09> 09 +<0A> 0A +<0B> 0B +<0C> 0C +<0D> 0D +<0E> 0E +<0F> 0F +<10> 10 +<11> 11 +<12> 12 +<13> 13 +<14> 14 +<15> 15 +<16> 16 +<17> 17 +<18> 18 +<19> 19 +<1A> 1A +<1B> 1B +<1C> 1C +<1D> 1D +<1E> 1E +<1F> 1F 20 ! 21 " 22 @@ -322,8 +361,9 @@ _ 5F { 7B | 7C } 7D - 7F +<7F> 7F drop table t1; +drop view v1; SET collation_connection='gbk_bin'; create table t1 select repeat('a',4000) a; delete from t1; @@ -465,6 +505,154 @@ a hex(b) c 3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL 4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL DROP TABLE t1; +drop table if exists t1; +create table t1 select repeat('a',10) as c1; +delete from t1; +insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1; +select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1'; +column_name collation_name +c1 gbk_bin +name gbk_bin +SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1; +GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +<00> 00 +<01> 01 +<02> 02 +<03> 03 +<04> 04 +<05> 05 +<06> 06 +<07> 07 +<08> 08 +<09> 09 +<0A> 0A +<0B> 0B +<0C> 0C +<0D> 0D +<0E> 0E +<0F> 0F +<10> 10 +<11> 11 +<12> 12 +<13> 13 +<14> 14 +<15> 15 +<16> 16 +<17> 17 +<18> 18 +<19> 19 +<1A> 1A +<1B> 1B +<1C> 1C +<1D> 1D +<1E> 1E +<1F> 1F + 20 +! 21 +" 22 +# 23 +$ 24 +% 25 +& 26 +' 27 +( 28 +) 29 +* 2A ++ 2B +, 2C +- 2D +. 2E +/ 2F +0 30 +1 31 +2 32 +3 33 +4 34 +5 35 +6 36 +7 37 +8 38 +9 39 +: 3A +; 3B +< 3C += 3D +> 3E +? 3F +@ 40 +A 41 +B 42 +C 43 +D 44 +E 45 +F 46 +G 47 +H 48 +I 49 +J 4A +K 4B +L 4C +M 4D +N 4E +O 4F +P 50 +Q 51 +R 52 +S 53 +T 54 +U 55 +V 56 +W 57 +X 58 +Y 59 +Z 5A +[ 5B +\ 5C +] 5D +^ 5E +_ 5F +` 60 +a 61 +b 62 +c 63 +d 64 +e 65 +f 66 +g 67 +h 68 +i 69 +j 6A +k 6B +l 6C +m 6D +n 6E +o 6F +p 70 +q 71 +r 72 +s 73 +t 74 +u 75 +v 76 +w 77 +x 78 +y 79 +z 7A +{ 7B +| 7C +} 7D +~ 7E +<7F> 7F +drop table t1; +drop view v1; SET NAMES gbk; CREATE TABLE t1 (a text) character set gbk; INSERT INTO t1 VALUES (0xA3A0),(0xA1A1); diff --git a/mysql-test/main/ctype_gbk.test b/mysql-test/main/ctype_gbk.test index d68b78f847c..808bea53e42 100644 --- a/mysql-test/main/ctype_gbk.test +++ b/mysql-test/main/ctype_gbk.test @@ -23,6 +23,7 @@ SET collation_connection='gbk_bin'; -- source include/ctype_innodb_like.inc -- source include/ctype_like_escape.inc -- source include/ctype_like_range_f1f2.inc +-- source include/ctype_ascii_order.inc # # Bug#11987 mysql will truncate the text when diff --git a/mysql-test/main/ctype_sjis.result b/mysql-test/main/ctype_sjis.result index 36411914e86..8f21e87c507 100644 --- a/mysql-test/main/ctype_sjis.result +++ b/mysql-test/main/ctype_sjis.result @@ -231,6 +231,128 @@ SELECT HEX(subject),HEX(pattern),STR_TO_DATE(subject, pattern) FROM t1; HEX(subject) HEX(pattern) STR_TO_DATE(subject, pattern) 323030318180303181803031 25598180256D81802564 2001-01-01 00:00:00.000000 DROP TABLE t1; +drop table if exists t1; +create table t1 select repeat('a',10) as c1; +delete from t1; +insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1; +select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1'; +column_name collation_name +c1 sjis_japanese_ci +name sjis_japanese_ci +SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1; +GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +<00> 00 +<01> 01 +<02> 02 +<03> 03 +<04> 04 +<05> 05 +<06> 06 +<07> 07 +<08> 08 +<09> 09 +<0A> 0A +<0B> 0B +<0C> 0C +<0D> 0D +<0E> 0E +<0F> 0F +<10> 10 +<11> 11 +<12> 12 +<13> 13 +<14> 14 +<15> 15 +<16> 16 +<17> 17 +<18> 18 +<19> 19 +<1A> 1A +<1B> 1B +<1C> 1C +<1D> 1D +<1E> 1E +<1F> 1F + 20 +! 21 +" 22 +# 23 +$ 24 +% 25 +& 26 +' 27 +( 28 +) 29 +* 2A ++ 2B +, 2C +- 2D +. 2E +/ 2F +0 30 +1 31 +2 32 +3 33 +4 34 +5 35 +6 36 +7 37 +8 38 +9 39 +: 3A +; 3B +< 3C += 3D +> 3E +? 3F +@ 40 +Aa 41,61 +Bb 42,62 +Cc 43,63 +Dd 44,64 +Ee 45,65 +Ff 46,66 +Gg 47,67 +Hh 48,68 +Ii 49,69 +Jj 4A,6A +Kk 4B,6B +Ll 4C,6C +Mm 4D,6D +Nn 4E,6E +Oo 4F,6F +Pp 50,70 +Qq 51,71 +Rr 52,72 +Ss 53,73 +Tt 54,74 +Uu 55,75 +Vv 56,76 +Ww 57,77 +Xx 58,78 +Yy 59,79 +Zz 5A,7A +[ 5B +\ 5C +] 5D +^ 5E +_ 5F +` 60 +{ 7B +| 7C +} 7D +~ 7E +<7F> 7F +drop table t1; +drop view v1; SET collation_connection='sjis_bin'; create table t1 select repeat('a',4000) a; delete from t1; @@ -372,6 +494,154 @@ a hex(b) c 3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL 4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL DROP TABLE t1; +drop table if exists t1; +create table t1 select repeat('a',10) as c1; +delete from t1; +insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1; +select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1'; +column_name collation_name +c1 sjis_bin +name sjis_bin +SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1; +GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +<00> 00 +<01> 01 +<02> 02 +<03> 03 +<04> 04 +<05> 05 +<06> 06 +<07> 07 +<08> 08 +<09> 09 +<0A> 0A +<0B> 0B +<0C> 0C +<0D> 0D +<0E> 0E +<0F> 0F +<10> 10 +<11> 11 +<12> 12 +<13> 13 +<14> 14 +<15> 15 +<16> 16 +<17> 17 +<18> 18 +<19> 19 +<1A> 1A +<1B> 1B +<1C> 1C +<1D> 1D +<1E> 1E +<1F> 1F + 20 +! 21 +" 22 +# 23 +$ 24 +% 25 +& 26 +' 27 +( 28 +) 29 +* 2A ++ 2B +, 2C +- 2D +. 2E +/ 2F +0 30 +1 31 +2 32 +3 33 +4 34 +5 35 +6 36 +7 37 +8 38 +9 39 +: 3A +; 3B +< 3C += 3D +> 3E +? 3F +@ 40 +A 41 +B 42 +C 43 +D 44 +E 45 +F 46 +G 47 +H 48 +I 49 +J 4A +K 4B +L 4C +M 4D +N 4E +O 4F +P 50 +Q 51 +R 52 +S 53 +T 54 +U 55 +V 56 +W 57 +X 58 +Y 59 +Z 5A +[ 5B +\ 5C +] 5D +^ 5E +_ 5F +` 60 +a 61 +b 62 +c 63 +d 64 +e 65 +f 66 +g 67 +h 68 +i 69 +j 6A +k 6B +l 6C +m 6D +n 6E +o 6F +p 70 +q 71 +r 72 +s 73 +t 74 +u 75 +v 76 +w 77 +x 78 +y 79 +z 7A +{ 7B +| 7C +} 7D +~ 7E +<7F> 7F +drop table t1; +drop view v1; SET NAMES sjis; SELECT HEX('²“‘@Œ\') FROM DUAL; HEX('²“‘@Œ\') diff --git a/mysql-test/main/ctype_sjis.test b/mysql-test/main/ctype_sjis.test index 8ca423bb7c1..d255b6267fd 100644 --- a/mysql-test/main/ctype_sjis.test +++ b/mysql-test/main/ctype_sjis.test @@ -70,11 +70,13 @@ SET collation_connection='sjis_japanese_ci'; -- source include/ctype_like_escape.inc -- source include/ctype_like_range_f1f2.inc -- source include/ctype_str_to_date.inc +-- source include/ctype_ascii_order.inc SET collation_connection='sjis_bin'; -- source include/ctype_filesort.inc -- source include/ctype_innodb_like.inc -- source include/ctype_like_escape.inc -- source include/ctype_like_range_f1f2.inc +-- source include/ctype_ascii_order.inc # Check parsing of string literals in SJIS with multibyte characters that # have an embedded \ in them. (Bug #8303) diff --git a/mysql-test/main/ctype_tis620.result b/mysql-test/main/ctype_tis620.result index 7e0c255c756..ff1d5927651 100644 --- a/mysql-test/main/ctype_tis620.result +++ b/mysql-test/main/ctype_tis620.result @@ -3042,15 +3042,54 @@ SELECT '\%b' LIKE '%\%'; drop table if exists t1; create table t1 select repeat('a',10) as c1; delete from t1; +insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); -SELECT GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM t1 GROUP BY c1; -GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1; +select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1'; +column_name collation_name +c1 tis620_thai_ci +name tis620_thai_ci +SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1; +GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +<01> 01 +<02> 02 +<03> 03 +<04> 04 +<05> 05 +<06> 06 +<07> 07 +<08> 08 +<09> 09 +<0A> 0A +<0B> 0B +<0C> 0C +<0D> 0D +<0E> 0E +<0F> 0F +<10> 10 +<11> 11 +<12> 12 +<13> 13 +<14> 14 +<15> 15 +<16> 16 +<17> 17 +<18> 18 +<19> 19 +<1A> 1A +<1B> 1B +<1C> 1C +<1D> 1D +<1E> 1E +<1F> 1F 20 +<00> 00 ! 21 " 22 # 23 @@ -3119,8 +3158,9 @@ Zz 5A,7A | 7C } 7D ~ 7E - 7F +<7F> 7F drop table t1; +drop view v1; # # MDEV-7149 Constant condition propagation erroneously applied for LIKE # diff --git a/mysql-test/main/ctype_ujis.result b/mysql-test/main/ctype_ujis.result index 8895770191d..bebe962fca4 100644 --- a/mysql-test/main/ctype_ujis.result +++ b/mysql-test/main/ctype_ujis.result @@ -1,5 +1,281 @@ drop table if exists t1; set names ujis; +# +# General tests +# +SET NAMES ujis; +drop table if exists t1; +create table t1 select repeat('a',10) as c1; +delete from t1; +insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1; +select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1'; +column_name collation_name +c1 ujis_japanese_ci +name ujis_japanese_ci +SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1; +GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +<00> 00 +<01> 01 +<02> 02 +<03> 03 +<04> 04 +<05> 05 +<06> 06 +<07> 07 +<08> 08 +<09> 09 +<0A> 0A +<0B> 0B +<0C> 0C +<0D> 0D +<0E> 0E +<0F> 0F +<10> 10 +<11> 11 +<12> 12 +<13> 13 +<14> 14 +<15> 15 +<16> 16 +<17> 17 +<18> 18 +<19> 19 +<1A> 1A +<1B> 1B +<1C> 1C +<1D> 1D +<1E> 1E +<1F> 1F + 20 +! 21 +" 22 +# 23 +$ 24 +% 25 +& 26 +' 27 +( 28 +) 29 +* 2A ++ 2B +, 2C +- 2D +. 2E +/ 2F +0 30 +1 31 +2 32 +3 33 +4 34 +5 35 +6 36 +7 37 +8 38 +9 39 +: 3A +; 3B +< 3C += 3D +> 3E +? 3F +@ 40 +Aa 41,61 +Bb 42,62 +Cc 43,63 +Dd 44,64 +Ee 45,65 +Ff 46,66 +Gg 47,67 +Hh 48,68 +Ii 49,69 +Jj 4A,6A +Kk 4B,6B +Ll 4C,6C +Mm 4D,6D +Nn 4E,6E +Oo 4F,6F +Pp 50,70 +Qq 51,71 +Rr 52,72 +Ss 53,73 +Tt 54,74 +Uu 55,75 +Vv 56,76 +Ww 57,77 +Xx 58,78 +Yy 59,79 +Zz 5A,7A +[ 5B +\ 5C +] 5D +^ 5E +_ 5F +` 60 +{ 7B +| 7C +} 7D +~ 7E +<7F> 7F +drop table t1; +drop view v1; +SET NAMES ujis COLLATE ujis_bin; +drop table if exists t1; +create table t1 select repeat('a',10) as c1; +delete from t1; +insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1; +select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1'; +column_name collation_name +c1 ujis_bin +name ujis_bin +SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1; +GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) +<00> 00 +<01> 01 +<02> 02 +<03> 03 +<04> 04 +<05> 05 +<06> 06 +<07> 07 +<08> 08 +<09> 09 +<0A> 0A +<0B> 0B +<0C> 0C +<0D> 0D +<0E> 0E +<0F> 0F +<10> 10 +<11> 11 +<12> 12 +<13> 13 +<14> 14 +<15> 15 +<16> 16 +<17> 17 +<18> 18 +<19> 19 +<1A> 1A +<1B> 1B +<1C> 1C +<1D> 1D +<1E> 1E +<1F> 1F + 20 +! 21 +" 22 +# 23 +$ 24 +% 25 +& 26 +' 27 +( 28 +) 29 +* 2A ++ 2B +, 2C +- 2D +. 2E +/ 2F +0 30 +1 31 +2 32 +3 33 +4 34 +5 35 +6 36 +7 37 +8 38 +9 39 +: 3A +; 3B +< 3C += 3D +> 3E +? 3F +@ 40 +A 41 +B 42 +C 43 +D 44 +E 45 +F 46 +G 47 +H 48 +I 49 +J 4A +K 4B +L 4C +M 4D +N 4E +O 4F +P 50 +Q 51 +R 52 +S 53 +T 54 +U 55 +V 56 +W 57 +X 58 +Y 59 +Z 5A +[ 5B +\ 5C +] 5D +^ 5E +_ 5F +` 60 +a 61 +b 62 +c 63 +d 64 +e 65 +f 66 +g 67 +h 68 +i 69 +j 6A +k 6B +l 6C +m 6D +n 6E +o 6F +p 70 +q 71 +r 72 +s 73 +t 74 +u 75 +v 76 +w 77 +x 78 +y 79 +z 7A +{ 7B +| 7C +} 7D +~ 7E +<7F> 7F +drop table t1; +drop view v1; +SET NAMES ujis; create table t1 (c text character set ujis); insert into t1 values (0xa4a2),(0xa4a3); select hex(left(c,1)) from t1 group by c; diff --git a/mysql-test/main/ctype_ujis.test b/mysql-test/main/ctype_ujis.test index 72a609edf39..7b77232738b 100644 --- a/mysql-test/main/ctype_ujis.test +++ b/mysql-test/main/ctype_ujis.test @@ -9,10 +9,20 @@ drop table if exists t1; set names ujis; +--echo # +--echo # General tests +--echo # + +SET NAMES ujis; +-- source include/ctype_ascii_order.inc +SET NAMES ujis COLLATE ujis_bin; +-- source include/ctype_ascii_order.inc + # # Test problem with LEFT() # +SET NAMES ujis; create table t1 (c text character set ujis); insert into t1 values (0xa4a2),(0xa4a3); select hex(left(c,1)) from t1 group by c; diff --git a/mysql-test/main/ddl_i18n_koi8r.result b/mysql-test/main/ddl_i18n_koi8r.result index d2cc13bf58f..074fb4c6fd8 100644 --- a/mysql-test/main/ddl_i18n_koi8r.result +++ b/mysql-test/main/ddl_i18n_koi8r.result @@ -1739,7 +1739,10 @@ CREATE TABLE `t1` ( `c` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t1` VALUES (1),(0),(1); +INSERT INTO `t1` VALUES +(1), +(0), +(1); ALTER DATABASE `mysqltest1` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -1818,7 +1821,10 @@ CREATE TABLE `t1` ( `c` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t1` VALUES (1),(0),(1); +INSERT INTO `t1` VALUES +(1), +(0), +(1); ALTER DATABASE `mysqltest2` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; diff --git a/mysql-test/main/ddl_i18n_utf8.result b/mysql-test/main/ddl_i18n_utf8.result index d1cec7c0690..53190dcc22e 100644 --- a/mysql-test/main/ddl_i18n_utf8.result +++ b/mysql-test/main/ddl_i18n_utf8.result @@ -1739,7 +1739,10 @@ CREATE TABLE `t1` ( `c` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t1` VALUES (1),(0),(1); +INSERT INTO `t1` VALUES +(1), +(0), +(1); ALTER DATABASE `mysqltest1` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -1818,7 +1821,10 @@ CREATE TABLE `t1` ( `c` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t1` VALUES (1),(0),(1); +INSERT INTO `t1` VALUES +(1), +(0), +(1); ALTER DATABASE `mysqltest2` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; diff --git a/mysql-test/main/flush_read_lock_kill.test b/mysql-test/main/flush_read_lock_kill.test index bd3efd7bdc4..8b76c065227 100644 --- a/mysql-test/main/flush_read_lock_kill.test +++ b/mysql-test/main/flush_read_lock_kill.test @@ -7,6 +7,7 @@ --source include/not_embedded.inc --source include/have_debug.inc +--source include/have_debug_sync.inc # This test needs transactional engine as otherwise COMMIT # won't block FLUSH TABLES WITH GLOBAL READ LOCK. diff --git a/mysql-test/main/get_diagnostics.result b/mysql-test/main/get_diagnostics.result index fbd25dc603c..fb7598ae043 100644 --- a/mysql-test/main/get_diagnostics.result +++ b/mysql-test/main/get_diagnostics.result @@ -789,3 +789,766 @@ GET DIAGNOSTICS @var1 = NUMBER; SHOW STATUS LIKE 'Com%get_diagnostics'; Variable_name Value Com_get_diagnostics 1 +# +# MDEV-10075: Provide index of error causing error in array INSERT +# +# +# INSERT STATEMENT +# +CREATE TABLE t1(id1 INT PRIMARY KEY, val1 VARCHAR(10), d1 DOUBLE); +CREATE TABLE t2(id2 INT PRIMARY KEY, val2 VARCHAR(10), d2 DOUBLE, p2 POINT); +# Simple INSERT statement +INSERT INTO t1 VALUES(1,'a',1.00101), (2,'b',1.00102), (3,'c',1.00103); +INSERT INTO t1 VALUES (4,'d',1.00104),(1,'a',1.00101),(2,'b',1.00102); +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +GET DIAGNOSTICS CONDITION 1 @var1= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var2= ROW_NUMBER; +Warnings: +Error 1062 Duplicate entry '1' for key 'PRIMARY' +Error 1758 Invalid condition number +SELECT @var1, @var2; +@var1 @var2 +2 +INSERT INTO t1 VALUES (5,'e',1.00105),(6,'f',1.79769313486232e+308); +ERROR 22007: Illegal double '1.79769313486232e+308' value found during parsing +GET DIAGNOSTICS CONDITION 1 @var3= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var4= ROW_NUMBER; +Warnings: +Error 1367 Illegal double '1.79769313486232e+308' value found during parsing +Error 1758 Invalid condition number +SELECT @var3, @var4; +@var3 @var4 +2 NULL +INSERT INTO t1 VALUES (7,'g',1.00107),(8,'h',1.00108),(9,'i'),(10,'j'); +ERROR 21S01: Column count doesn't match value count at row 3 +GET DIAGNOSTICS CONDITION 1 @var5= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var6= ROW_NUMBER; +Warnings: +Error 1136 Column count doesn't match value count at row 3 +Error 1758 Invalid condition number +SELECT @var5, @var6; +@var5 @var6 +3 NULL +INSERT INTO t1 VALUES (9,CAST(123 AS CHAR(1)),1.00109); +ERROR 22007: Truncated incorrect CHAR(1) value: '123' +GET DIAGNOSTICS CONDITION 1 @var7= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var8= ROW_NUMBER; +Warnings: +Error 1292 Truncated incorrect CHAR(1) value: '123' +Error 1758 Invalid condition number +SELECT @var7, @var8; +@var7 @var8 +1 NULL +INSERT INTO t1 VALUES ('x','foo',1.0203); +ERROR 22007: Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 1 +GET DIAGNOSTICS CONDITION 1 @var9= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var10= ROW_NUMBER; +Warnings: +Error 1366 Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 1 +Error 1758 Invalid condition number +SELECT @var9, @var10; +@var9 @var10 +1 NULL +INSERT INTO t1 VALUES ((13,'m',1.0113)); +ERROR 21000: Operand should contain 1 column(s) +GET DIAGNOSTICS CONDITION 1 @var11= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var12= ROW_NUMBER; +Warnings: +Error 1241 Operand should contain 1 column(s) +Error 1758 Invalid condition number +SELECT @var11, @var12; +@var11 @var12 +1 NULL +INSERT INTO t1 VALUES (14,'n',1.0114), (15,'o',1.0115), (16/0,'p',1.0116); +Warnings: +Warning 1365 Division by 0 +Warning 1048 Column 'id1' cannot be null +GET DIAGNOSTICS CONDITION 1 @var13= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var14= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 3 @var15= ROW_NUMBER; +Warnings: +Warning 1365 Division by 0 +Warning 1048 Column 'id1' cannot be null +Error 1758 Invalid condition number +SELECT @var13, @var14, @var15; +@var13 @var14 @var15 +3 3 NULL +TRUNCATE TABLE t1; +# INSERT ... IGNORE +INSERT IGNORE INTO t1 VALUES(1,'a',1.00101), (2,'b',1.00102), (3,'c',1.00103); +INSERT IGNORE INTO t1 VALUES (4,'d',1.00104),(1,'a',1.00101),(2,'b',1.00102); +Warnings: +Warning 1062 Duplicate entry '1' for key 'PRIMARY' +Warning 1062 Duplicate entry '2' for key 'PRIMARY' +GET DIAGNOSTICS CONDITION 1 @var16= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var17= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 3 @var18= ROW_NUMBER; +Warnings: +Warning 1062 Duplicate entry '1' for key 'PRIMARY' +Warning 1062 Duplicate entry '2' for key 'PRIMARY' +Error 1758 Invalid condition number +SELECT @var16, @var17, @var18; +@var16 @var17 @var18 +2 3 NULL +INSERT IGNORE INTO t1 VALUES (5,'e',1.00105),(6,'f',1.79769313486232e+308); +ERROR 22007: Illegal double '1.79769313486232e+308' value found during parsing +GET DIAGNOSTICS CONDITION 1 @var19= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var20= ROW_NUMBER; +Warnings: +Error 1367 Illegal double '1.79769313486232e+308' value found during parsing +Error 1758 Invalid condition number +SELECT @var19, @var20; +@var19 @var20 +2 NULL +INSERT IGNORE INTO t1 VALUES (7,'g',1.00107),(8,'h',1.00108),(9,'i'),(10,'j'); +ERROR 21S01: Column count doesn't match value count at row 3 +GET DIAGNOSTICS CONDITION 1 @var21= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var22= ROW_NUMBER; +Warnings: +Error 1136 Column count doesn't match value count at row 3 +Error 1758 Invalid condition number +SELECT @var21, @var22; +@var21 @var22 +3 NULL +INSERT IGNORE INTO t1 VALUES (9,CAST(123 AS CHAR(1)),1.00109); +Warnings: +Warning 1292 Truncated incorrect CHAR(1) value: '123' +GET DIAGNOSTICS CONDITION 1 @var23= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var24= ROW_NUMBER; +Warnings: +Warning 1292 Truncated incorrect CHAR(1) value: '123' +Error 1758 Invalid condition number +SELECT @var23, @var24; +@var23 @var24 +1 NULL +INSERT IGNORE INTO t1 VALUES ('x','foo',1.0203); +Warnings: +Warning 1366 Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 1 +GET DIAGNOSTICS CONDITION 1 @var25= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var26= ROW_NUMBER; +Warnings: +Warning 1366 Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 1 +Error 1758 Invalid condition number +SELECT @var25, @var26; +@var25 @var26 +1 NULL +INSERT IGNORE INTO t1 VALUES ((13,'m',1.0113)); +ERROR 21000: Operand should contain 1 column(s) +GET DIAGNOSTICS CONDITION 1 @var27= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var28= ROW_NUMBER; +Warnings: +Error 1241 Operand should contain 1 column(s) +Error 1758 Invalid condition number +SELECT @var27, @var28; +@var27 @var28 +1 NULL +INSERT IGNORE INTO t1 VALUES (14,'n',1.0114), (15,'o',1.0115), +(16/0,'p',1.0116); +Warnings: +Warning 1365 Division by 0 +Warning 1048 Column 'id1' cannot be null +Warning 1062 Duplicate entry '0' for key 'PRIMARY' +GET DIAGNOSTICS CONDITION 1 @var29= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var30= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 3 @var31= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 4 @var32= ROW_NUMBER; +Warnings: +Warning 1365 Division by 0 +Warning 1048 Column 'id1' cannot be null +Warning 1062 Duplicate entry '0' for key 'PRIMARY' +Error 1758 Invalid condition number +SELECT @var29, @var30, @var31, @var32; +@var29 @var30 @var31 @var32 +3 3 3 NULL +TRUNCATE TABLE t1; +# INSERT ... SET +INSERT INTO t1 SET id1=1, val1='a', d1=1.00101; +INSERT INTO t1 SET id1=2, val1='b', d1=1.00102; +INSERT INTO t1 SET id1=3, val1='c', d1=1.00103; +INSERT INTO t1 SET id1=1, val1='a', d1=1.00101; +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +GET DIAGNOSTICS CONDITION 1 @var33= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var34= ROW_NUMBER; +Warnings: +Error 1062 Duplicate entry '1' for key 'PRIMARY' +Error 1758 Invalid condition number +SELECT @var33, @var34; +@var33 @var34 +1 NULL +INSERT INTO t1 SET id1=6, val1='f', d1=1.79769313486232e+308); +ERROR 22007: Illegal double '1.79769313486232e+308' value found during parsing +GET DIAGNOSTICS CONDITION 1 @var35= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var36= ROW_NUMBER; +Warnings: +Error 1367 Illegal double '1.79769313486232e+308' value found during parsing +Error 1758 Invalid condition number +SELECT @var35, @var36; +@var35 @var36 +1 NULL +INSERT INTO t1 SET id1=9, val1=CAST(123 AS CHAR(1)), d1=1.00109; +ERROR 22007: Truncated incorrect CHAR(1) value: '123' +GET DIAGNOSTICS CONDITION 1 @var37= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var38= ROW_NUMBER; +Warnings: +Error 1292 Truncated incorrect CHAR(1) value: '123' +Error 1758 Invalid condition number +SELECT @var37, @var38; +@var37 @var38 +1 NULL +INSERT INTO t1 SET id1='x', val1='foo', d1=1.0203; +ERROR 22007: Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 1 +GET DIAGNOSTICS CONDITION 1 @var39= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var40= ROW_NUMBER; +Warnings: +Error 1366 Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 1 +Error 1758 Invalid condition number +SELECT @var39, @var40; +@var39 @var40 +1 NULL +INSERT INTO t1 SET id1=3/0, val1='p', d1=1.0116; +ERROR 22012: Division by 0 +GET DIAGNOSTICS CONDITION 1 @var41= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var42= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 3 @var43= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 4 @var44= ROW_NUMBER; +Warnings: +Error 1365 Division by 0 +Error 1048 Column 'id1' cannot be null +Error 1105 Unknown error +Error 1758 Invalid condition number +SELECT @var41, @var42, @var43, @var44; +@var41 @var42 @var43 @var44 +1 1 1 NULL +TRUNCATE TABLE t1; +# INSERT ... ON DUPLICATE KEY UPDATE +INSERT INTO t1 VALUES(1,'a',1.00101), (2,'b',1.00102), (3,'c',1.00103); +INSERT INTO t1 VALUES (4,'d',1.00104),(1,'a',1.00101) +ON DUPLICATE KEY UPDATE val1='a', d1=1.00101; +GET DIAGNOSTICS CONDITION 1 @var45= ROW_NUMBER; +Warnings: +Error 1758 Invalid condition number +GET DIAGNOSTICS CONDITION 2 @var46= ROW_NUMBER; +Warnings: +Error 1758 Invalid condition number +Error 1758 Invalid condition number +SELECT @var45, @var46; +@var45 @var46 +NULL NULL +INSERT INTO t1 VALUES (5,'e',1.00105),(3,'f',1.79769313486232e+308) +ON DUPLICATE KEY UPDATE val1='c'; +ERROR 22007: Illegal double '1.79769313486232e+308' value found during parsing +GET DIAGNOSTICS CONDITION 1 @var47= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var48= ROW_NUMBER; +Warnings: +Error 1367 Illegal double '1.79769313486232e+308' value found during parsing +Error 1758 Invalid condition number +SELECT @var47, @var48; +@var47 @var48 +2 NULL +INSERT INTO t1 VALUES (5,'e',1.00105), (3,'i') +ON DUPLICATE KEY UPDATE val1='c'; +ERROR 21S01: Column count doesn't match value count at row 2 +GET DIAGNOSTICS CONDITION 1 @var49= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var50= ROW_NUMBER; +Warnings: +Error 1136 Column count doesn't match value count at row 2 +Error 1758 Invalid condition number +SELECT @var49, @var50; +@var49 @var50 +2 NULL +INSERT INTO t1 VALUES (3, CAST(123 AS CHAR(1)), 1.00103) +ON DUPLICATE KEY UPDATE val1='c'; +ERROR 22007: Truncated incorrect CHAR(1) value: '123' +GET DIAGNOSTICS CONDITION 1 @var51= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var52= ROW_NUMBER; +Warnings: +Error 1292 Truncated incorrect CHAR(1) value: '123' +Error 1758 Invalid condition number +SELECT @var51, @var52; +@var51 @var52 +1 NULL +INSERT INTO t1 VALUES ('x','foo',1.0203) +ON DUPLICATE KEY UPDATE val1='c'; +ERROR 22007: Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 1 +GET DIAGNOSTICS CONDITION 1 @var53= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var54= ROW_NUMBER; +Warnings: +Error 1366 Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 1 +Error 1758 Invalid condition number +SELECT @var53, @var54; +@var53 @var54 +1 NULL +INSERT INTO t1 VALUES ((13,'m',1.0113)) ON DUPLICATE KEY UPDATE val1='c'; +ERROR 21000: Operand should contain 1 column(s) +GET DIAGNOSTICS CONDITION 1 @var55= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var56= ROW_NUMBER; +Warnings: +Error 1241 Operand should contain 1 column(s) +Error 1758 Invalid condition number +SELECT @var55, @var56; +@var55 @var56 +1 NULL +INSERT INTO t1 VALUES (14,'n',1.0114), (15,'o',1.0115), (2/0,'p',1.00102) +ON DUPLICATE KEY UPDATE val1='b'; +Warnings: +Warning 1365 Division by 0 +Warning 1048 Column 'id1' cannot be null +GET DIAGNOSTICS CONDITION 1 @var57= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var58= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 3 @var59= ROW_NUMBER; +Warnings: +Warning 1365 Division by 0 +Warning 1048 Column 'id1' cannot be null +Error 1758 Invalid condition number +SELECT @var57, @var58, @var59; +@var57 @var58 @var59 +3 3 NULL +INSERT INTO t1 VALUES (1,'e',1.0),(5,'e',1.0),(5,'f',1.7) +ON DUPLICATE KEY UPDATE id1='1'; +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +GET DIAGNOSTICS CONDITION 1 @var60= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var61= ROW_NUMBER; +Warnings: +Error 1062 Duplicate entry '1' for key 'PRIMARY' +Error 1758 Invalid condition number +SELECT @var60, @var61; +@var60 @var61 +3 NULL +TRUNCATE TABLE t1; +DROP TABLE t1; +DROP TABLE t2; +INSERT ... SELECT +CREATE TABLE t1(id1 INT PRIMARY KEY, val1 VARCHAR(10), d1 DOUBLE); +CREATE TABLE t2(id2 INT PRIMARY KEY, val2 VARCHAR(10), d2 DOUBLE, p2 POINT); +INSERT INTO t2 VALUES(1,'a',1.00101,PointFromText('POINT(20 10)')), +(2,'b',1.00102,PointFromText('POINT(20 10)')), +(3,'c',1.00103,PointFromText('POINT(20 10)')); +INSERT INTO t1 SELECT id2, val2, d2 FROM t2; +INSERT INTO t1 SELECT id2, val2, d2 FROM t2 WHERE id2=1; +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +GET DIAGNOSTICS CONDITION 1 @var62= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var63= ROW_NUMBER; +Warnings: +Error 1062 Duplicate entry '1' for key 'PRIMARY' +Error 1758 Invalid condition number +SELECT @var62, @var63; +@var62 @var63 +1 NULL +INSERT INTO t1 SELECT id2, val2, p2 from t2; +ERROR 22007: Incorrect double value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x004@\x00\x00\x00\x00\x00\x00$@' for column `test`.`t1`.`d1` at row 1 +GET DIAGNOSTICS CONDITION 1 @var64= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var65= ROW_NUMBER; +Warnings: +Error 1366 Incorrect double value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x004@\x00\x00\x00\x00\x00\x00$@' for column `test`.`t1`.`d1` at row 1 +Error 1758 Invalid condition number +SELECT @var64, @var65; +@var64 @var65 +1 NULL +INSERT INTO t1 SELECT id2, val2 FROM t2; +ERROR 21S01: Column count doesn't match value count at row 1 +GET DIAGNOSTICS CONDITION 1 @var66= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var67= ROW_NUMBER; +Warnings: +Error 1136 Column count doesn't match value count at row 1 +Error 1758 Invalid condition number +SELECT @var66, @var67; +@var66 @var67 +1 NULL +INSERT INTO t2 VALUES(4,'a',1.00101,PointFromText('POINT(20 10)')); +INSERT INTO t1 SELECT id2, CAST(123 AS CHAR(1)), d2 FROM t2 WHERE id2=4; +ERROR 22007: Truncated incorrect CHAR(1) value: '123' +GET DIAGNOSTICS CONDITION 1 @var68= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var69= ROW_NUMBER; +Warnings: +Error 1292 Truncated incorrect CHAR(1) value: '123' +Error 1758 Invalid condition number +SELECT @var68, @var69; +@var68 @var69 +1 NULL +INSERT INTO t1 SELECT id2, val2, 1.79769313486232e+308 FROM t2; +ERROR 22007: Illegal double '1.79769313486232e+308' value found during parsing +GET DIAGNOSTICS CONDITION 1 @var70= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var71= ROW_NUMBER; +Warnings: +Error 1367 Illegal double '1.79769313486232e+308' value found during parsing +Error 1758 Invalid condition number +SELECT @var70, @var71; +@var70 @var71 +1 NULL +INSERT INTO t1 SELECT id2/0, val2, d2 FROM t2; +ERROR 22012: Division by 0 +GET DIAGNOSTICS CONDITION 1 @var72= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var73= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 3 @var74= ROW_NUMBER; +Warnings: +Error 1365 Division by 0 +Error 1048 Column 'id1' cannot be null +Error 1758 Invalid condition number +SELECT @var72, @var73, @var74; +@var72 @var73 @var74 +1 1 NULL +DROP TABLE t1,t2; +# Checking ROW_NUMBER in STORED PROCEDURE for INSERT +CREATE TABLE t1(id1 INT PRIMARY KEY); +CREATE PROCEDURE proc1 () +BEGIN +DECLARE var75 INT; +DECLARE var76 INT; +INSERT INTO t1 VALUES (1),(2); +INSERT IGNORE INTO t1 VALUES(2); +GET DIAGNOSTICS CONDITION 1 var75= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 var76= ROW_NUMBER; +SELECT var75, var76; +END; +| +CALL proc1(); +var75 var76 +1 NULL +Warnings: +Warning 1062 Duplicate entry '2' for key 'PRIMARY' +Error 1758 Invalid condition number +TRUNCATE TABLE t1; +# Checking ROW_NUMBER in PREPARED STATEMENTS for INSERT +INSERT INTO t1 VALUES (1), (2), (3); +INSERT IGNORE INTO t1 VALUES(2),(3),(4); +Warnings: +Warning 1062 Duplicate entry '2' for key 'PRIMARY' +Warning 1062 Duplicate entry '3' for key 'PRIMARY' +PREPARE stmt1 FROM "GET DIAGNOSTICS CONDITION 2 @var77= ROW_NUMBER"; +EXECUTE stmt1; +SELECT @var77; +@var77 +2 +DROP PROCEDURE proc1; +DROP PREPARE stmt1; +DROP TABLE t1; +# +# REPLACE STATEMENT +# +CREATE TABLE t1(id1 INT PRIMARY KEY, val1 VARCHAR(10), d1 DOUBLE); +CREATE TABLE t2(id2 INT PRIMARY KEY, val2 VARCHAR(10), d2 DOUBLE); +# Simple REPLACE statement +REPLACE INTO t1 VALUES(1,'a',1.00101), (2,'b',1.00102), (3,'c',1.00103); +REPLACE INTO t1 VALUES (4,'d',1.00104),(1,'a',1.00101),(2,'b',1.00102); +GET DIAGNOSTICS CONDITION 1 @var78= ROW_NUMBER; +Warnings: +Error 1758 Invalid condition number +SELECT @var78; +@var78 +NULL +REPLACE INTO t1 VALUES (5,'e',1.00105),(6,'f',1.79769313486232e+308); +ERROR 22007: Illegal double '1.79769313486232e+308' value found during parsing +GET DIAGNOSTICS CONDITION 1 @var79= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var80= ROW_NUMBER; +Warnings: +Error 1367 Illegal double '1.79769313486232e+308' value found during parsing +Error 1758 Invalid condition number +SELECT @var79, @var80; +@var79 @var80 +2 NULL +REPLACE INTO t1 VALUES (7,'g',1.00107),(8,'h',1.00108),(9,'i'),(10,'j'); +ERROR 21S01: Column count doesn't match value count at row 3 +GET DIAGNOSTICS CONDITION 1 @var81= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var82= ROW_NUMBER; +Warnings: +Error 1136 Column count doesn't match value count at row 3 +Error 1758 Invalid condition number +SELECT @var81, @var82; +@var81 @var82 +3 NULL +REPLACE INTO t1 VALUES (9,CAST(123 AS CHAR(1)),1.00109); +ERROR 22007: Truncated incorrect CHAR(1) value: '123' +GET DIAGNOSTICS CONDITION 1 @var83= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var84= ROW_NUMBER; +Warnings: +Error 1292 Truncated incorrect CHAR(1) value: '123' +Error 1758 Invalid condition number +SELECT @var83, @var84; +@var83 @var84 +1 NULL +REPLACE INTO t1 VALUES ('x','foo',1.0203); +ERROR 22007: Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 1 +GET DIAGNOSTICS CONDITION 1 @var85= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var86= ROW_NUMBER; +Warnings: +Error 1366 Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 1 +Error 1758 Invalid condition number +SELECT @var85, @var86; +@var85 @var86 +1 NULL +REPLACE INTO t1 VALUES ((13,'m',1.0113)); +ERROR 21000: Operand should contain 1 column(s) +GET DIAGNOSTICS CONDITION 1 @var87= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var88= ROW_NUMBER; +Warnings: +Error 1241 Operand should contain 1 column(s) +Error 1758 Invalid condition number +SELECT @var87, @var88; +@var87 @var88 +1 NULL +REPLACE INTO t1 VALUES (14,'n',1.0114), (15,'o',1.0115), (16/0,'p',1.0116); +Warnings: +Warning 1365 Division by 0 +Warning 1048 Column 'id1' cannot be null +GET DIAGNOSTICS CONDITION 1 @var89= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var90= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 3 @var91= ROW_NUMBER; +Warnings: +Warning 1365 Division by 0 +Warning 1048 Column 'id1' cannot be null +Error 1758 Invalid condition number +SELECT @var89, @var90, @var91; +@var89 @var90 @var91 +3 3 NULL +TRUNCATE TABLE t1; +# REPLACE ... SET +REPLACE INTO t1 SET id1=1, val1='a', d1=1.00101; +REPLACE INTO t1 SET id1=2, val1='b', d1=1.00102; +REPLACE INTO t1 SET id1=3, val1='c', d1=1.00103; +REPLACE INTO t1 SET id1=1, val1='a', d1=1.00101; +GET DIAGNOSTICS CONDITION 1 @var92= ROW_NUMBER; +Warnings: +Error 1758 Invalid condition number +SELECT @var92; +@var92 +NULL +REPLACE INTO t1 SET id1=6, val1='f', d1=1.79769313486232e+308); +ERROR 22007: Illegal double '1.79769313486232e+308' value found during parsing +GET DIAGNOSTICS CONDITION 1 @var93= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var94= ROW_NUMBER; +Warnings: +Error 1367 Illegal double '1.79769313486232e+308' value found during parsing +Error 1758 Invalid condition number +SELECT @var93, @var94; +@var93 @var94 +1 NULL +REPLACE INTO t1 SET id1=9, val1=CAST(123 AS CHAR(1)), d1=1.00109; +ERROR 22007: Truncated incorrect CHAR(1) value: '123' +GET DIAGNOSTICS CONDITION 1 @var95= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var96= ROW_NUMBER; +Warnings: +Error 1292 Truncated incorrect CHAR(1) value: '123' +Error 1758 Invalid condition number +SELECT @var95, @var96; +@var95 @var96 +1 NULL +REPLACE INTO t1 SET id1='x', val1='foo', d1=1.0203; +ERROR 22007: Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 1 +GET DIAGNOSTICS CONDITION 1 @var97= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var98= ROW_NUMBER; +Warnings: +Error 1366 Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 1 +Error 1758 Invalid condition number +SELECT @var97, @var98; +@var97 @var98 +1 NULL +REPLACE INTO t1 SET id1=3/0, val1='p', d1=1.0116; +ERROR 22012: Division by 0 +GET DIAGNOSTICS CONDITION 1 @var99= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var100= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 3 @var101= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 4 @var102= ROW_NUMBER; +Warnings: +Error 1365 Division by 0 +Error 1048 Column 'id1' cannot be null +Error 1105 Unknown error +Error 1758 Invalid condition number +SELECT @var99, @var100, @var101, @var102; +@var99 @var100 @var101 @var102 +1 1 1 NULL +TRUNCATE TABLE t1; +DROP TABLE t1; +DROP TABLE t2; +# REPLACE ... SELECT +CREATE TABLE t1(id1 INT PRIMARY KEY, val1 VARCHAR(10), d1 DOUBLE); +CREATE TABLE t2(id2 INT PRIMARY KEY, val2 VARCHAR(10), d2 DOUBLE, p2 POINT); +INSERT INTO t2 VALUES(1,'a',1.00101,PointFromText('POINT(20 10)')), +(2,'b',1.00102,PointFromText('POINT(20 10)')), +(3,'c',1.00103,PointFromText('POINT(20 10)')); +INSERT INTO t1 SELECT id2, val2, d2 FROM t2; +INSERT INTO t1 SELECT id2, val2, d2 FROM t2 WHERE id2=1; +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +GET DIAGNOSTICS CONDITION 1 @var103= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var104= ROW_NUMBER; +Warnings: +Error 1062 Duplicate entry '1' for key 'PRIMARY' +Error 1758 Invalid condition number +SELECT @var103, @var104; +@var103 @var104 +1 NULL +INSERT INTO t1 SELECT id2, val2, p2 from t2; +ERROR 22007: Incorrect double value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x004@\x00\x00\x00\x00\x00\x00$@' for column `test`.`t1`.`d1` at row 1 +GET DIAGNOSTICS CONDITION 1 @var105= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var106= ROW_NUMBER; +Warnings: +Error 1366 Incorrect double value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x004@\x00\x00\x00\x00\x00\x00$@' for column `test`.`t1`.`d1` at row 1 +Error 1758 Invalid condition number +SELECT @var105, @var106; +@var105 @var106 +1 NULL +INSERT INTO t1 SELECT id2, val2 FROM t2; +ERROR 21S01: Column count doesn't match value count at row 1 +GET DIAGNOSTICS CONDITION 1 @var107= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var108= ROW_NUMBER; +Warnings: +Error 1136 Column count doesn't match value count at row 1 +Error 1758 Invalid condition number +SELECT @var107, @var108; +@var107 @var108 +1 NULL +INSERT INTO t2 VALUES(4,'a',1.00101,PointFromText('POINT(20 10)')); +INSERT INTO t1 SELECT id2, CAST(123 AS CHAR(1)), d2 FROM t2 WHERE id2=4; +ERROR 22007: Truncated incorrect CHAR(1) value: '123' +GET DIAGNOSTICS CONDITION 1 @var109= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var110= ROW_NUMBER; +Warnings: +Error 1292 Truncated incorrect CHAR(1) value: '123' +Error 1758 Invalid condition number +SELECT @var109, @var110; +@var109 @var110 +1 NULL +INSERT INTO t1 SELECT id2, val2, 1.79769313486232e+308 FROM t2; +ERROR 22007: Illegal double '1.79769313486232e+308' value found during parsing +GET DIAGNOSTICS CONDITION 1 @var111= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var112= ROW_NUMBER; +Warnings: +Error 1367 Illegal double '1.79769313486232e+308' value found during parsing +Error 1758 Invalid condition number +SELECT @var111, @var112; +@var111 @var112 +1 NULL +INSERT INTO t1 SELECT id2/0, val2, d2 FROM t2; +ERROR 22012: Division by 0 +GET DIAGNOSTICS CONDITION 1 @var113= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var114= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 3 @var115= ROW_NUMBER; +Warnings: +Error 1365 Division by 0 +Error 1048 Column 'id1' cannot be null +Error 1758 Invalid condition number +SELECT @var113, @var114, @var115; +@var113 @var114 @var115 +1 1 NULL +DROP TABLE t1,t2; +# Checking ROW_NUMBER in STORED PROCEDURE +CREATE TABLE t1(id1 INT PRIMARY KEY); +CREATE PROCEDURE proc1 () +BEGIN +DECLARE var116 INT; +REPLACE INTO t1 VALUES (1),(2); +GET DIAGNOSTICS CONDITION 1 var116= ROW_NUMBER; +SELECT var116; +END; +| +CALL proc1(); +var116 +NULL +Warnings: +Error 1758 Invalid condition number +TRUNCATE TABLE t1; +# Checking ROW_NUMBER in PREPARED STATEMENTS +REPLACE INTO t1 VALUES (1), (2), (3); +PREPARE stmt1 FROM "GET DIAGNOSTICS CONDITION 2 @var117= ROW_NUMBER"; +EXECUTE stmt1; +Warnings: +Error 1758 Invalid condition number +SELECT @var117; +@var117 +NULL +DROP PROCEDURE proc1; +DROP PREPARE stmt1; +DROP TABLE t1; +# +# Checking that ROW_NUMBER is only for errors with rows/values +# +# INSERT STATEMENT +CREATE TABLE t1(id1 INT); +CREATE TABLE t2(id2 INT); +CREATE VIEW v AS SELECT t1.id1 AS A, t2.id2 AS b FROM t1,t2; +INSERT INTO t1(id1, id1) VALUES (1,1); +ERROR 42000: Column 'id1' specified twice +GET DIAGNOSTICS CONDITION 1 @var118= ROW_NUMBER; +SELECT @var118; +@var118 +1 +CREATE FUNCTION f1() RETURNS INT +BEGIN +INSERT INTO t1 VALUES (1); +RETURN 1; +END | +INSERT INTO t1 VALUES (1), (f1()); +ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger +GET DIAGNOSTICS CONDITION 1 @var119= ROW_NUMBER; +SELECT @var119; +@var119 +2 +INSERT INTO t1 VALUES (1) RETURNING id2; +ERROR 42S22: Unknown column 'id2' in 'field list' +GET DIAGNOSTICS CONDITION 1 @var120= ROW_NUMBER; +SELECT @var120; +@var120 +1 +INSERT INTO t1(id2) VALUES(1); +ERROR 42S22: Unknown column 'id2' in 'field list' +GET DIAGNOSTICS CONDITION 1 @var121= ROW_NUMBER; +SELECT @var121; +@var121 +1 +INSERT INTO v VALUES(1,2); +ERROR HY000: Can not insert into join view 'test.v' without fields list +GET DIAGNOSTICS CONDITION 1 @var122= ROW_NUMBER; +SELECT @var122; +@var122 +1 +INSERT INTO v(a,b) VALUES (1,2); +ERROR HY000: Can not modify more than one base table through a join view 'test.v' +GET DIAGNOSTICS CONDITION 1 @var123= ROW_NUMBER; +SELECT @var123; +@var123 +1 +# REPLACE STATEMENT +REPLACE INTO t1(id1, id1) VALUES (1,1); +ERROR 42000: Column 'id1' specified twice +GET DIAGNOSTICS CONDITION 1 @var124= ROW_NUMBER; +SELECT @var124; +@var124 +1 +CREATE FUNCTION f2() RETURNS INT +BEGIN +REPLACE INTO t1 VALUES (1); +RETURN 1; +END | +REPLACE INTO t1 VALUES (1), (f2()); +ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger +GET DIAGNOSTICS CONDITION 1 @var125= ROW_NUMBER; +SELECT @var125; +@var125 +2 +REPLACE INTO t1 VALUES (1) RETURNING id2; +ERROR 42S22: Unknown column 'id2' in 'field list' +GET DIAGNOSTICS CONDITION 1 @var126= ROW_NUMBER; +SELECT @var126; +@var126 +1 +REPLACE INTO t1(id2) VALUES(1); +ERROR 42S22: Unknown column 'id2' in 'field list' +GET DIAGNOSTICS CONDITION 1 @var127= ROW_NUMBER; +SELECT @var127; +@var127 +1 +REPLACE INTO v VALUES(1,2); +ERROR HY000: Can not insert into join view 'test.v' without fields list +GET DIAGNOSTICS CONDITION 1 @var128= ROW_NUMBER; +SELECT @var128; +@var128 +1 +REPLACE INTO v(a,b) VALUES (1,2); +ERROR HY000: Can not modify more than one base table through a join view 'test.v' +GET DIAGNOSTICS CONDITION 1 @var129= ROW_NUMBER; +SELECT @var129; +@var129 +1 +DROP TABLE t1,t2; +DROP FUNCTION f1; +DROP FUNCTION f2; +DROP VIEW v; diff --git a/mysql-test/main/get_diagnostics.test b/mysql-test/main/get_diagnostics.test index d9faf184a62..0ff67f8ae75 100644 --- a/mysql-test/main/get_diagnostics.test +++ b/mysql-test/main/get_diagnostics.test @@ -851,3 +851,582 @@ FLUSH STATUS; SHOW STATUS LIKE 'Com%get_diagnostics'; GET DIAGNOSTICS @var1 = NUMBER; SHOW STATUS LIKE 'Com%get_diagnostics'; + +--echo # +--echo # MDEV-10075: Provide index of error causing error in array INSERT +--echo # + +--echo # +--echo # INSERT STATEMENT +--echo # + +CREATE TABLE t1(id1 INT PRIMARY KEY, val1 VARCHAR(10), d1 DOUBLE); +CREATE TABLE t2(id2 INT PRIMARY KEY, val2 VARCHAR(10), d2 DOUBLE, p2 POINT); + + +--echo # Simple INSERT statement + +INSERT INTO t1 VALUES(1,'a',1.00101), (2,'b',1.00102), (3,'c',1.00103); +--error ER_DUP_ENTRY +INSERT INTO t1 VALUES (4,'d',1.00104),(1,'a',1.00101),(2,'b',1.00102); +GET DIAGNOSTICS CONDITION 1 @var1= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var2= ROW_NUMBER; +SELECT @var1, @var2; + +--error ER_ILLEGAL_VALUE_FOR_TYPE +INSERT INTO t1 VALUES (5,'e',1.00105),(6,'f',1.79769313486232e+308); +GET DIAGNOSTICS CONDITION 1 @var3= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var4= ROW_NUMBER; +SELECT @var3, @var4; + +--error ER_WRONG_VALUE_COUNT_ON_ROW +INSERT INTO t1 VALUES (7,'g',1.00107),(8,'h',1.00108),(9,'i'),(10,'j'); +GET DIAGNOSTICS CONDITION 1 @var5= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var6= ROW_NUMBER; +SELECT @var5, @var6; + +--error ER_TRUNCATED_WRONG_VALUE +INSERT INTO t1 VALUES (9,CAST(123 AS CHAR(1)),1.00109); +GET DIAGNOSTICS CONDITION 1 @var7= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var8= ROW_NUMBER; +SELECT @var7, @var8; + +--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD +INSERT INTO t1 VALUES ('x','foo',1.0203); +GET DIAGNOSTICS CONDITION 1 @var9= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var10= ROW_NUMBER; +SELECT @var9, @var10; + +--error ER_OPERAND_COLUMNS +INSERT INTO t1 VALUES ((13,'m',1.0113)); +GET DIAGNOSTICS CONDITION 1 @var11= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var12= ROW_NUMBER; +SELECT @var11, @var12; + +INSERT INTO t1 VALUES (14,'n',1.0114), (15,'o',1.0115), (16/0,'p',1.0116); +GET DIAGNOSTICS CONDITION 1 @var13= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var14= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 3 @var15= ROW_NUMBER; +SELECT @var13, @var14, @var15; + +TRUNCATE TABLE t1; + +--echo # INSERT ... IGNORE + +INSERT IGNORE INTO t1 VALUES(1,'a',1.00101), (2,'b',1.00102), (3,'c',1.00103); +INSERT IGNORE INTO t1 VALUES (4,'d',1.00104),(1,'a',1.00101),(2,'b',1.00102); +GET DIAGNOSTICS CONDITION 1 @var16= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var17= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 3 @var18= ROW_NUMBER; +SELECT @var16, @var17, @var18; + +--error ER_ILLEGAL_VALUE_FOR_TYPE +INSERT IGNORE INTO t1 VALUES (5,'e',1.00105),(6,'f',1.79769313486232e+308); +GET DIAGNOSTICS CONDITION 1 @var19= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var20= ROW_NUMBER; +SELECT @var19, @var20; + +--error ER_WRONG_VALUE_COUNT_ON_ROW +INSERT IGNORE INTO t1 VALUES (7,'g',1.00107),(8,'h',1.00108),(9,'i'),(10,'j'); +GET DIAGNOSTICS CONDITION 1 @var21= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var22= ROW_NUMBER; +SELECT @var21, @var22; + +INSERT IGNORE INTO t1 VALUES (9,CAST(123 AS CHAR(1)),1.00109); +GET DIAGNOSTICS CONDITION 1 @var23= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var24= ROW_NUMBER; +SELECT @var23, @var24; + +INSERT IGNORE INTO t1 VALUES ('x','foo',1.0203); +GET DIAGNOSTICS CONDITION 1 @var25= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var26= ROW_NUMBER; +SELECT @var25, @var26; + +--error ER_OPERAND_COLUMNS +INSERT IGNORE INTO t1 VALUES ((13,'m',1.0113)); +GET DIAGNOSTICS CONDITION 1 @var27= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var28= ROW_NUMBER; +SELECT @var27, @var28; + +INSERT IGNORE INTO t1 VALUES (14,'n',1.0114), (15,'o',1.0115), +(16/0,'p',1.0116); +GET DIAGNOSTICS CONDITION 1 @var29= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var30= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 3 @var31= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 4 @var32= ROW_NUMBER; +SELECT @var29, @var30, @var31, @var32; + +TRUNCATE TABLE t1; + +--echo # INSERT ... SET + +INSERT INTO t1 SET id1=1, val1='a', d1=1.00101; +INSERT INTO t1 SET id1=2, val1='b', d1=1.00102; +INSERT INTO t1 SET id1=3, val1='c', d1=1.00103; + +--error ER_DUP_ENTRY +INSERT INTO t1 SET id1=1, val1='a', d1=1.00101; +GET DIAGNOSTICS CONDITION 1 @var33= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var34= ROW_NUMBER; +SELECT @var33, @var34; + +--error ER_ILLEGAL_VALUE_FOR_TYPE +INSERT INTO t1 SET id1=6, val1='f', d1=1.79769313486232e+308); +GET DIAGNOSTICS CONDITION 1 @var35= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var36= ROW_NUMBER; +SELECT @var35, @var36; + + +--error ER_TRUNCATED_WRONG_VALUE +INSERT INTO t1 SET id1=9, val1=CAST(123 AS CHAR(1)), d1=1.00109; +GET DIAGNOSTICS CONDITION 1 @var37= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var38= ROW_NUMBER; +SELECT @var37, @var38; + +--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD +INSERT INTO t1 SET id1='x', val1='foo', d1=1.0203; +GET DIAGNOSTICS CONDITION 1 @var39= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var40= ROW_NUMBER; +SELECT @var39, @var40; + +--error ER_DIVISION_BY_ZERO +INSERT INTO t1 SET id1=3/0, val1='p', d1=1.0116; +GET DIAGNOSTICS CONDITION 1 @var41= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var42= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 3 @var43= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 4 @var44= ROW_NUMBER; +SELECT @var41, @var42, @var43, @var44; + +TRUNCATE TABLE t1; + +--echo # INSERT ... ON DUPLICATE KEY UPDATE + +INSERT INTO t1 VALUES(1,'a',1.00101), (2,'b',1.00102), (3,'c',1.00103); + +INSERT INTO t1 VALUES (4,'d',1.00104),(1,'a',1.00101) +ON DUPLICATE KEY UPDATE val1='a', d1=1.00101; +GET DIAGNOSTICS CONDITION 1 @var45= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var46= ROW_NUMBER; +SELECT @var45, @var46; + +--error ER_ILLEGAL_VALUE_FOR_TYPE +INSERT INTO t1 VALUES (5,'e',1.00105),(3,'f',1.79769313486232e+308) +ON DUPLICATE KEY UPDATE val1='c'; +GET DIAGNOSTICS CONDITION 1 @var47= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var48= ROW_NUMBER; +SELECT @var47, @var48; + +--error ER_WRONG_VALUE_COUNT_ON_ROW +INSERT INTO t1 VALUES (5,'e',1.00105), (3,'i') +ON DUPLICATE KEY UPDATE val1='c'; +GET DIAGNOSTICS CONDITION 1 @var49= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var50= ROW_NUMBER; +SELECT @var49, @var50; + +--error ER_TRUNCATED_WRONG_VALUE +INSERT INTO t1 VALUES (3, CAST(123 AS CHAR(1)), 1.00103) +ON DUPLICATE KEY UPDATE val1='c'; +GET DIAGNOSTICS CONDITION 1 @var51= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var52= ROW_NUMBER; +SELECT @var51, @var52; + +--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD +INSERT INTO t1 VALUES ('x','foo',1.0203) +ON DUPLICATE KEY UPDATE val1='c'; +GET DIAGNOSTICS CONDITION 1 @var53= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var54= ROW_NUMBER; +SELECT @var53, @var54; + +--error ER_OPERAND_COLUMNS +INSERT INTO t1 VALUES ((13,'m',1.0113)) ON DUPLICATE KEY UPDATE val1='c'; +GET DIAGNOSTICS CONDITION 1 @var55= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var56= ROW_NUMBER; +SELECT @var55, @var56; + +INSERT INTO t1 VALUES (14,'n',1.0114), (15,'o',1.0115), (2/0,'p',1.00102) +ON DUPLICATE KEY UPDATE val1='b'; +GET DIAGNOSTICS CONDITION 1 @var57= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var58= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 3 @var59= ROW_NUMBER; +SELECT @var57, @var58, @var59; + +--error ER_DUP_ENTRY +INSERT INTO t1 VALUES (1,'e',1.0),(5,'e',1.0),(5,'f',1.7) +ON DUPLICATE KEY UPDATE id1='1'; +GET DIAGNOSTICS CONDITION 1 @var60= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var61= ROW_NUMBER; +SELECT @var60, @var61; + +TRUNCATE TABLE t1; + +DROP TABLE t1; +DROP TABLE t2; + +--echo INSERT ... SELECT + +CREATE TABLE t1(id1 INT PRIMARY KEY, val1 VARCHAR(10), d1 DOUBLE); +CREATE TABLE t2(id2 INT PRIMARY KEY, val2 VARCHAR(10), d2 DOUBLE, p2 POINT); + +INSERT INTO t2 VALUES(1,'a',1.00101,PointFromText('POINT(20 10)')), + (2,'b',1.00102,PointFromText('POINT(20 10)')), + (3,'c',1.00103,PointFromText('POINT(20 10)')); +INSERT INTO t1 SELECT id2, val2, d2 FROM t2; + +--error ER_DUP_ENTRY +INSERT INTO t1 SELECT id2, val2, d2 FROM t2 WHERE id2=1; +GET DIAGNOSTICS CONDITION 1 @var62= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var63= ROW_NUMBER; +SELECT @var62, @var63; + +--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD +INSERT INTO t1 SELECT id2, val2, p2 from t2; +GET DIAGNOSTICS CONDITION 1 @var64= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var65= ROW_NUMBER; +SELECT @var64, @var65; + +--error ER_WRONG_VALUE_COUNT_ON_ROW +INSERT INTO t1 SELECT id2, val2 FROM t2; +GET DIAGNOSTICS CONDITION 1 @var66= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var67= ROW_NUMBER; +SELECT @var66, @var67; + +INSERT INTO t2 VALUES(4,'a',1.00101,PointFromText('POINT(20 10)')); +--error ER_TRUNCATED_WRONG_VALUE +INSERT INTO t1 SELECT id2, CAST(123 AS CHAR(1)), d2 FROM t2 WHERE id2=4; +GET DIAGNOSTICS CONDITION 1 @var68= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var69= ROW_NUMBER; +SELECT @var68, @var69; + +--error ER_ILLEGAL_VALUE_FOR_TYPE +INSERT INTO t1 SELECT id2, val2, 1.79769313486232e+308 FROM t2; +GET DIAGNOSTICS CONDITION 1 @var70= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var71= ROW_NUMBER; +SELECT @var70, @var71; + + +--error ER_DIVISION_BY_ZERO +INSERT INTO t1 SELECT id2/0, val2, d2 FROM t2; +GET DIAGNOSTICS CONDITION 1 @var72= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var73= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 3 @var74= ROW_NUMBER; +SELECT @var72, @var73, @var74; + +DROP TABLE t1,t2; + +--echo # Checking ROW_NUMBER in STORED PROCEDURE for INSERT + +CREATE TABLE t1(id1 INT PRIMARY KEY); + +DELIMITER |; + +CREATE PROCEDURE proc1 () +BEGIN + + DECLARE var75 INT; + DECLARE var76 INT; + + INSERT INTO t1 VALUES (1),(2); + INSERT IGNORE INTO t1 VALUES(2); + + GET DIAGNOSTICS CONDITION 1 var75= ROW_NUMBER; + GET DIAGNOSTICS CONDITION 2 var76= ROW_NUMBER; + + SELECT var75, var76; + +END; +| + +DELIMITER ;| + +CALL proc1(); +TRUNCATE TABLE t1; + +--echo # Checking ROW_NUMBER in PREPARED STATEMENTS for INSERT + +INSERT INTO t1 VALUES (1), (2), (3); +INSERT IGNORE INTO t1 VALUES(2),(3),(4); + +PREPARE stmt1 FROM "GET DIAGNOSTICS CONDITION 2 @var77= ROW_NUMBER"; +EXECUTE stmt1; +SELECT @var77; + +DROP PROCEDURE proc1; +DROP PREPARE stmt1; +DROP TABLE t1; + +--echo # +--echo # REPLACE STATEMENT +--echo # + +CREATE TABLE t1(id1 INT PRIMARY KEY, val1 VARCHAR(10), d1 DOUBLE); +CREATE TABLE t2(id2 INT PRIMARY KEY, val2 VARCHAR(10), d2 DOUBLE); + + +--echo # Simple REPLACE statement + +REPLACE INTO t1 VALUES(1,'a',1.00101), (2,'b',1.00102), (3,'c',1.00103); +REPLACE INTO t1 VALUES (4,'d',1.00104),(1,'a',1.00101),(2,'b',1.00102); +GET DIAGNOSTICS CONDITION 1 @var78= ROW_NUMBER; +SELECT @var78; + +--error ER_ILLEGAL_VALUE_FOR_TYPE +REPLACE INTO t1 VALUES (5,'e',1.00105),(6,'f',1.79769313486232e+308); +GET DIAGNOSTICS CONDITION 1 @var79= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var80= ROW_NUMBER; +SELECT @var79, @var80; + +--error ER_WRONG_VALUE_COUNT_ON_ROW +REPLACE INTO t1 VALUES (7,'g',1.00107),(8,'h',1.00108),(9,'i'),(10,'j'); +GET DIAGNOSTICS CONDITION 1 @var81= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var82= ROW_NUMBER; +SELECT @var81, @var82; + +--error ER_TRUNCATED_WRONG_VALUE +REPLACE INTO t1 VALUES (9,CAST(123 AS CHAR(1)),1.00109); +GET DIAGNOSTICS CONDITION 1 @var83= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var84= ROW_NUMBER; +SELECT @var83, @var84; + +--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD +REPLACE INTO t1 VALUES ('x','foo',1.0203); +GET DIAGNOSTICS CONDITION 1 @var85= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var86= ROW_NUMBER; +SELECT @var85, @var86; + +--error ER_OPERAND_COLUMNS +REPLACE INTO t1 VALUES ((13,'m',1.0113)); +GET DIAGNOSTICS CONDITION 1 @var87= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var88= ROW_NUMBER; +SELECT @var87, @var88; + +REPLACE INTO t1 VALUES (14,'n',1.0114), (15,'o',1.0115), (16/0,'p',1.0116); +GET DIAGNOSTICS CONDITION 1 @var89= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var90= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 3 @var91= ROW_NUMBER; +SELECT @var89, @var90, @var91; + +TRUNCATE TABLE t1; + +--echo # REPLACE ... SET + +REPLACE INTO t1 SET id1=1, val1='a', d1=1.00101; +REPLACE INTO t1 SET id1=2, val1='b', d1=1.00102; +REPLACE INTO t1 SET id1=3, val1='c', d1=1.00103; + +REPLACE INTO t1 SET id1=1, val1='a', d1=1.00101; +GET DIAGNOSTICS CONDITION 1 @var92= ROW_NUMBER; +SELECT @var92; + +--error ER_ILLEGAL_VALUE_FOR_TYPE +REPLACE INTO t1 SET id1=6, val1='f', d1=1.79769313486232e+308); +GET DIAGNOSTICS CONDITION 1 @var93= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var94= ROW_NUMBER; +SELECT @var93, @var94; + + +--error ER_TRUNCATED_WRONG_VALUE +REPLACE INTO t1 SET id1=9, val1=CAST(123 AS CHAR(1)), d1=1.00109; +GET DIAGNOSTICS CONDITION 1 @var95= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var96= ROW_NUMBER; +SELECT @var95, @var96; + +--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD +REPLACE INTO t1 SET id1='x', val1='foo', d1=1.0203; +GET DIAGNOSTICS CONDITION 1 @var97= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var98= ROW_NUMBER; +SELECT @var97, @var98; + +--error ER_DIVISION_BY_ZERO +REPLACE INTO t1 SET id1=3/0, val1='p', d1=1.0116; +GET DIAGNOSTICS CONDITION 1 @var99= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var100= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 3 @var101= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 4 @var102= ROW_NUMBER; +SELECT @var99, @var100, @var101, @var102; + +TRUNCATE TABLE t1; + +DROP TABLE t1; +DROP TABLE t2; + +--echo # REPLACE ... SELECT + +CREATE TABLE t1(id1 INT PRIMARY KEY, val1 VARCHAR(10), d1 DOUBLE); +CREATE TABLE t2(id2 INT PRIMARY KEY, val2 VARCHAR(10), d2 DOUBLE, p2 POINT); + + +INSERT INTO t2 VALUES(1,'a',1.00101,PointFromText('POINT(20 10)')), + (2,'b',1.00102,PointFromText('POINT(20 10)')), + (3,'c',1.00103,PointFromText('POINT(20 10)')); +INSERT INTO t1 SELECT id2, val2, d2 FROM t2; + +--error ER_DUP_ENTRY +INSERT INTO t1 SELECT id2, val2, d2 FROM t2 WHERE id2=1; +GET DIAGNOSTICS CONDITION 1 @var103= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var104= ROW_NUMBER; +SELECT @var103, @var104; + +--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD +INSERT INTO t1 SELECT id2, val2, p2 from t2; +GET DIAGNOSTICS CONDITION 1 @var105= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var106= ROW_NUMBER; +SELECT @var105, @var106; + +--error ER_WRONG_VALUE_COUNT_ON_ROW +INSERT INTO t1 SELECT id2, val2 FROM t2; +GET DIAGNOSTICS CONDITION 1 @var107= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var108= ROW_NUMBER; +SELECT @var107, @var108; + +INSERT INTO t2 VALUES(4,'a',1.00101,PointFromText('POINT(20 10)')); +--error ER_TRUNCATED_WRONG_VALUE +INSERT INTO t1 SELECT id2, CAST(123 AS CHAR(1)), d2 FROM t2 WHERE id2=4; +GET DIAGNOSTICS CONDITION 1 @var109= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var110= ROW_NUMBER; +SELECT @var109, @var110; + +--error ER_ILLEGAL_VALUE_FOR_TYPE +INSERT INTO t1 SELECT id2, val2, 1.79769313486232e+308 FROM t2; +GET DIAGNOSTICS CONDITION 1 @var111= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var112= ROW_NUMBER; +SELECT @var111, @var112; + + +--error ER_DIVISION_BY_ZERO +INSERT INTO t1 SELECT id2/0, val2, d2 FROM t2; +GET DIAGNOSTICS CONDITION 1 @var113= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 2 @var114= ROW_NUMBER; +GET DIAGNOSTICS CONDITION 3 @var115= ROW_NUMBER; +SELECT @var113, @var114, @var115; + +DROP TABLE t1,t2; + +--echo # Checking ROW_NUMBER in STORED PROCEDURE + +CREATE TABLE t1(id1 INT PRIMARY KEY); + +DELIMITER |; + +CREATE PROCEDURE proc1 () +BEGIN + + DECLARE var116 INT; + + REPLACE INTO t1 VALUES (1),(2); + + GET DIAGNOSTICS CONDITION 1 var116= ROW_NUMBER; + + SELECT var116; + +END; +| + +DELIMITER ;| + +CALL proc1(); +TRUNCATE TABLE t1; + +--echo # Checking ROW_NUMBER in PREPARED STATEMENTS + +REPLACE INTO t1 VALUES (1), (2), (3); + +PREPARE stmt1 FROM "GET DIAGNOSTICS CONDITION 2 @var117= ROW_NUMBER"; +EXECUTE stmt1; +SELECT @var117; + +DROP PROCEDURE proc1; +DROP PREPARE stmt1; +DROP TABLE t1; + +--echo # +--echo # Checking that ROW_NUMBER is only for errors with rows/values +--echo # + +--echo # INSERT STATEMENT + +CREATE TABLE t1(id1 INT); +CREATE TABLE t2(id2 INT); +CREATE VIEW v AS SELECT t1.id1 AS A, t2.id2 AS b FROM t1,t2; + +--error ER_FIELD_SPECIFIED_TWICE +INSERT INTO t1(id1, id1) VALUES (1,1); +GET DIAGNOSTICS CONDITION 1 @var118= ROW_NUMBER; +SELECT @var118; + +delimiter |; +CREATE FUNCTION f1() RETURNS INT +BEGIN + INSERT INTO t1 VALUES (1); + RETURN 1; +END | +delimiter ;| + +--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG +INSERT INTO t1 VALUES (1), (f1()); +GET DIAGNOSTICS CONDITION 1 @var119= ROW_NUMBER; +SELECT @var119; + +--error ER_BAD_FIELD_ERROR +INSERT INTO t1 VALUES (1) RETURNING id2; +GET DIAGNOSTICS CONDITION 1 @var120= ROW_NUMBER; +SELECT @var120; + +--error ER_BAD_FIELD_ERROR +INSERT INTO t1(id2) VALUES(1); +GET DIAGNOSTICS CONDITION 1 @var121= ROW_NUMBER; +SELECT @var121; + +--error ER_VIEW_NO_INSERT_FIELD_LIST +INSERT INTO v VALUES(1,2); +GET DIAGNOSTICS CONDITION 1 @var122= ROW_NUMBER; +SELECT @var122; + +--error ER_VIEW_MULTIUPDATE +INSERT INTO v(a,b) VALUES (1,2); +GET DIAGNOSTICS CONDITION 1 @var123= ROW_NUMBER; +SELECT @var123; + +--echo # REPLACE STATEMENT + +--error ER_FIELD_SPECIFIED_TWICE +REPLACE INTO t1(id1, id1) VALUES (1,1); +GET DIAGNOSTICS CONDITION 1 @var124= ROW_NUMBER; +SELECT @var124; + +delimiter |; +CREATE FUNCTION f2() RETURNS INT +BEGIN + REPLACE INTO t1 VALUES (1); + RETURN 1; +END | +delimiter ;| + +--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG +REPLACE INTO t1 VALUES (1), (f2()); +GET DIAGNOSTICS CONDITION 1 @var125= ROW_NUMBER; +SELECT @var125; + +--error ER_BAD_FIELD_ERROR +REPLACE INTO t1 VALUES (1) RETURNING id2; +GET DIAGNOSTICS CONDITION 1 @var126= ROW_NUMBER; +SELECT @var126; + +--error ER_BAD_FIELD_ERROR +REPLACE INTO t1(id2) VALUES(1); +GET DIAGNOSTICS CONDITION 1 @var127= ROW_NUMBER; +SELECT @var127; + +--error ER_VIEW_NO_INSERT_FIELD_LIST +REPLACE INTO v VALUES(1,2); +GET DIAGNOSTICS CONDITION 1 @var128= ROW_NUMBER; +SELECT @var128; + +--error ER_VIEW_MULTIUPDATE +REPLACE INTO v(a,b) VALUES (1,2); +GET DIAGNOSTICS CONDITION 1 @var129= ROW_NUMBER; +SELECT @var129; + +DROP TABLE t1,t2; +DROP FUNCTION f1; +DROP FUNCTION f2; +DROP VIEW v; diff --git a/mysql-test/main/information_schema_part.result b/mysql-test/main/information_schema_part.result index 4c0bb8908da..374c679789e 100644 --- a/mysql-test/main/information_schema_part.result +++ b/mysql-test/main/information_schema_part.result @@ -7,9 +7,9 @@ partition x3 values in (16, 8, 5+19, 70-43) tablespace ts3); select * from information_schema.partitions where table_schema="test" and table_name="t1"; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -def test t1 x1 NULL 1 NULL LIST NULL `b` * `a` NULL 1 0 0 0 # 1024 0 # # NULL NULL default ts1 -def test t1 x2 NULL 2 NULL LIST NULL `b` * `a` NULL 3,11,5,7 0 0 0 # 1024 0 # # NULL NULL default ts2 -def test t1 x3 NULL 3 NULL LIST NULL `b` * `a` NULL 16,8,24,27 0 0 0 # 1024 0 # # NULL NULL default ts3 +def test t1 x1 NULL 1 NULL LIST NULL `b` * `a` NULL 1 0 0 0 # 1024 0 # # NULL NULL default NULL +def test t1 x2 NULL 2 NULL LIST NULL `b` * `a` NULL 3,11,5,7 0 0 0 # 1024 0 # # NULL NULL default NULL +def test t1 x3 NULL 3 NULL LIST NULL `b` * `a` NULL 16,8,24,27 0 0 0 # 1024 0 # # NULL NULL default NULL create table t2 (a int not null,b int not null,c int not null, primary key(a,b)) partition by range (a) partitions 3 @@ -19,9 +19,9 @@ partition x3 values less than maxvalue tablespace ts3); select * from information_schema.partitions where table_schema="test" and table_name="t2"; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -def test t2 x1 NULL 1 NULL RANGE NULL `a` NULL 5 0 0 0 # 1024 0 # # NULL NULL default ts1 -def test t2 x2 NULL 2 NULL RANGE NULL `a` NULL 10 0 0 0 # 1024 0 # # NULL NULL default ts2 -def test t2 x3 NULL 3 NULL RANGE NULL `a` NULL MAXVALUE 0 0 0 # 1024 0 # # NULL NULL default ts3 +def test t2 x1 NULL 1 NULL RANGE NULL `a` NULL 5 0 0 0 # 1024 0 # # NULL NULL default NULL +def test t2 x2 NULL 2 NULL RANGE NULL `a` NULL 10 0 0 0 # 1024 0 # # NULL NULL default NULL +def test t2 x3 NULL 3 NULL RANGE NULL `a` NULL MAXVALUE 0 0 0 # 1024 0 # # NULL NULL default NULL create table t3 (f1 date) partition by hash(month(f1)) partitions 3; @@ -63,14 +63,14 @@ subpartition x22 tablespace t2) ); select * from information_schema.partitions where table_schema="test" order by table_name, partition_name; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -def test t1 x1 x11 1 1 RANGE HASH `a` `a` + `b` 1 0 0 0 # 1024 0 # # NULL NULL default t1 -def test t1 x1 x12 1 2 RANGE HASH `a` `a` + `b` 1 0 0 0 # 1024 0 # # NULL NULL default t2 -def test t1 x2 x21 2 1 RANGE HASH `a` `a` + `b` 5 0 0 0 # 1024 0 # # NULL NULL default t1 -def test t1 x2 x22 2 2 RANGE HASH `a` `a` + `b` 5 0 0 0 # 1024 0 # # NULL NULL default t2 -def test t2 x1 x11 1 1 RANGE KEY `a` `a` 1 0 0 0 # 1024 0 # # NULL NULL default t1 -def test t2 x1 x12 1 2 RANGE KEY `a` `a` 1 0 0 0 # 1024 0 # # NULL NULL default t2 -def test t2 x2 x21 2 1 RANGE KEY `a` `a` 5 0 0 0 # 1024 0 # # NULL NULL default t1 -def test t2 x2 x22 2 2 RANGE KEY `a` `a` 5 0 0 0 # 1024 0 # # NULL NULL default t2 +def test t1 x1 x11 1 1 RANGE HASH `a` `a` + `b` 1 0 0 0 # 1024 0 # # NULL NULL default NULL +def test t1 x1 x12 1 2 RANGE HASH `a` `a` + `b` 1 0 0 0 # 1024 0 # # NULL NULL default NULL +def test t1 x2 x21 2 1 RANGE HASH `a` `a` + `b` 5 0 0 0 # 1024 0 # # NULL NULL default NULL +def test t1 x2 x22 2 2 RANGE HASH `a` `a` + `b` 5 0 0 0 # 1024 0 # # NULL NULL default NULL +def test t2 x1 x11 1 1 RANGE KEY `a` `a` 1 0 0 0 # 1024 0 # # NULL NULL default NULL +def test t2 x1 x12 1 2 RANGE KEY `a` `a` 1 0 0 0 # 1024 0 # # NULL NULL default NULL +def test t2 x2 x21 2 1 RANGE KEY `a` `a` 5 0 0 0 # 1024 0 # # NULL NULL default NULL +def test t2 x2 x22 2 2 RANGE KEY `a` `a` 5 0 0 0 # 1024 0 # # NULL NULL default NULL drop table t1,t2; create table t1 ( a int not null, @@ -88,10 +88,10 @@ subpartition x22 tablespace t2 nodegroup 1) ); select * from information_schema.partitions where table_schema="test"; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -def test t1 x1 x11 1 1 RANGE HASH `a` `a` + `b` 1 0 0 0 # 1024 0 # # NULL NULL 0 t1 -def test t1 x1 x12 1 2 RANGE HASH `a` `a` + `b` 1 0 0 0 # 1024 0 # # NULL NULL 1 t2 -def test t1 x2 x21 2 1 RANGE HASH `a` `a` + `b` 5 0 0 0 # 1024 0 # # NULL NULL 0 t1 -def test t1 x2 x22 2 2 RANGE HASH `a` `a` + `b` 5 0 0 0 # 1024 0 # # NULL NULL 1 t2 +def test t1 x1 x11 1 1 RANGE HASH `a` `a` + `b` 1 0 0 0 # 1024 0 # # NULL NULL 0 NULL +def test t1 x1 x12 1 2 RANGE HASH `a` `a` + `b` 1 0 0 0 # 1024 0 # # NULL NULL 1 NULL +def test t1 x2 x21 2 1 RANGE HASH `a` `a` + `b` 5 0 0 0 # 1024 0 # # NULL NULL 0 NULL +def test t1 x2 x22 2 2 RANGE HASH `a` `a` + `b` 5 0 0 0 # 1024 0 # # NULL NULL 1 NULL show tables; Tables_in_test t1 diff --git a/mysql-test/main/json_equals.result b/mysql-test/main/json_equals.result new file mode 100644 index 00000000000..1fa13ec2cf8 --- /dev/null +++ b/mysql-test/main/json_equals.result @@ -0,0 +1,98 @@ +select json_equals("{}", "{}"); +json_equals("{}", "{}") +1 +select json_equals("{}", "[]"); +json_equals("{}", "[]") +0 +select json_equals("{}", NULL); +json_equals("{}", NULL) +NULL +select json_equals("", ""); +json_equals("", "") +NULL +select json_equals("", 1); +json_equals("", 1) +NULL +select json_equals(now(), now()); +json_equals(now(), now()) +NULL +select json_equals('{"a":[1, 2, 3]}', '{"a":[1, 2, 3, 4]}'); +json_equals('{"a":[1, 2, 3]}', '{"a":[1, 2, 3, 4]}') +0 +select json_equals('{"a":[1, 2, 3]}', '{"a":[1, 2, 3]}'); +json_equals('{"a":[1, 2, 3]}', '{"a":[1, 2, 3]}') +1 +select json_equals('{"È›anÈ›oÈ™":[1, 2, "È›", {"some uâ߀":"uâßr"}]}', +'{"È›anÈ›oÈ™":[1, 2, "È›", {"some uâ߀":"uâßr"}]}'); +json_equals('{"È›anÈ›oÈ™":[1, 2, "È›", {"some uâ߀":"uâßr"}]}', +'{"È›anÈ›oÈ™":[1, 2, "È›", {"some uâ߀":"uâßr"}]}') +1 +select json_equals('{"a" : [0.123456789123456789], "b" : [1, 2, 3]}', +'{"b" : [1, 2, 3], "a" : [0.123456789123456789]}'); +json_equals('{"a" : [0.123456789123456789], "b" : [1, 2, 3]}', +'{"b" : [1, 2, 3], "a" : [0.123456789123456789]}') +1 +# +# Test max json depth for json_equals. +# +with recursive rec_json (step, obj) as ( +select 1, cast('{"key":"value"}' as varchar(1000)) +union +select r.step + 1, JSON_INSERT('{}', '$.obj', JSON_QUERY(r.obj, '$')) +from rec_json r +where r.step < 10 +) +select step, obj, json_equals(obj, obj) from rec_json; +step obj json_equals(obj, obj) +1 {"key":"value"} 1 +2 {"obj": {"key": "value"}} 1 +3 {"obj": {"obj": {"key": "value"}}} 1 +4 {"obj": {"obj": {"obj": {"key": "value"}}}} 1 +5 {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}} 1 +6 {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}} 1 +7 {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}} 1 +8 {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}} 1 +9 {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}}} 1 +10 {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}}}} 1 +# +# 31 levels of nesting. +# +select json_equals('{"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}', +'{"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}') as 31_levels; +31_levels +1 +# +# 32 Levels of nesting. This should hit max json depth. +# +select json_equals('{"obj":{"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}', +'{"obj":{"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}') as 32_levels; +32_levels +NULL +# +# test values from different charset +# (UTF-8 two-bytes vs. latin1 single high-byte) +# +create table t1 (a varchar(200) character set latin1); +create table t2 (a varchar(200) character set utf8); +insert into t1 values (UNHEX('22CA22')); +set names utf8; +insert into t2 values (UNHEX('22C38A22')); +select a from t1; +a +"Ê" +select hex(a) from t1; +hex(a) +22CA22 +select a from t2; +a +"Ê" +select hex(a) from t2; +hex(a) +22C38A22 +select t1.a, t2.a, t1.a = t2.a, +json_valid(t1.a), json_valid(t2.a), json_equals(t1.a, t2.a) +from t1, t2; +a a t1.a = t2.a json_valid(t1.a) json_valid(t2.a) json_equals(t1.a, t2.a) +"Ê" "Ê" 1 1 1 1 +drop table t1; +drop table t2; diff --git a/mysql-test/main/json_equals.test b/mysql-test/main/json_equals.test new file mode 100644 index 00000000000..904d8a3f67d --- /dev/null +++ b/mysql-test/main/json_equals.test @@ -0,0 +1,69 @@ + +select json_equals("{}", "{}"); + +select json_equals("{}", "[]"); + +select json_equals("{}", NULL); + +select json_equals("", ""); + +select json_equals("", 1); + +select json_equals(now(), now()); + +select json_equals('{"a":[1, 2, 3]}', '{"a":[1, 2, 3, 4]}'); + +select json_equals('{"a":[1, 2, 3]}', '{"a":[1, 2, 3]}'); + +select json_equals('{"È›anÈ›oÈ™":[1, 2, "È›", {"some uâ߀":"uâßr"}]}', + '{"È›anÈ›oÈ™":[1, 2, "È›", {"some uâ߀":"uâßr"}]}'); + +select json_equals('{"a" : [0.123456789123456789], "b" : [1, 2, 3]}', + '{"b" : [1, 2, 3], "a" : [0.123456789123456789]}'); + +--echo # +--echo # Test max json depth for json_equals. +--echo # +with recursive rec_json (step, obj) as ( + select 1, cast('{"key":"value"}' as varchar(1000)) + union + select r.step + 1, JSON_INSERT('{}', '$.obj', JSON_QUERY(r.obj, '$')) + from rec_json r + where r.step < 10 +) +select step, obj, json_equals(obj, obj) from rec_json; + +--echo # +--echo # 31 levels of nesting. +--echo # +select json_equals('{"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}', +'{"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}') as 31_levels; + +--echo # +--echo # 32 Levels of nesting. This should hit max json depth. +--echo # +select json_equals('{"obj":{"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}', +'{"obj":{"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}') as 32_levels; + + +--echo # +--echo # test values from different charset +--echo # (UTF-8 two-bytes vs. latin1 single high-byte) +--echo # +create table t1 (a varchar(200) character set latin1); +create table t2 (a varchar(200) character set utf8); +insert into t1 values (UNHEX('22CA22')); +set names utf8; +insert into t2 values (UNHEX('22C38A22')); + +select a from t1; +select hex(a) from t1; +select a from t2; +select hex(a) from t2; + +select t1.a, t2.a, t1.a = t2.a, + json_valid(t1.a), json_valid(t2.a), json_equals(t1.a, t2.a) +from t1, t2; + +drop table t1; +drop table t2; diff --git a/mysql-test/main/json_normalize.result b/mysql-test/main/json_normalize.result new file mode 100644 index 00000000000..f88cadad189 --- /dev/null +++ b/mysql-test/main/json_normalize.result @@ -0,0 +1,77 @@ +set names utf8; +create table t1 (json json); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`json`)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values +('{ }'), +('[ ]'), +('{ "foo" : "bar" }'), +('{ "foo" : "bar", "baz" : "whatever" }'), +('[ 1.2, 0.0, "text", 0, null, true, false ]'), +('[ "string", { "key" : "val", "a" : "b", "c" : [ 10, 9, 8, "seven", 11 ] }]'), +('{ "ăț€": "val1", "âț€":"val2" }'); +select json, json_normalize(json) from t1 +order by json; +json json_normalize(json) +[ ] [] +[ "string", { "key" : "val", "a" : "b", "c" : [ 10, 9, 8, "seven", 11 ] }] ["string",{"a":"b","c":[1.0E1,9.0E0,8.0E0,"seven",1.1E1],"key":"val"}] +[ 1.2, 0.0, "text", 0, null, true, false ] [1.2E0,0.0E0,"text",0.0E0,null,true,false] +{ } {} +{ "foo" : "bar" } {"foo":"bar"} +{ "foo" : "bar", "baz" : "whatever" } {"baz":"whatever","foo":"bar"} +{ "ăț€": "val1", "âț€":"val2" } {"âț€":"val2","ăț€":"val1"} +create view v1 as (select json, json_normalize(json) norm_json from t1); +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`json` AS `json`,json_normalize(`t1`.`json`) AS `norm_json` from `t1`) utf8mb3 utf8mb3_general_ci +select * from v1 +order by json; +json norm_json +[ ] [] +[ "string", { "key" : "val", "a" : "b", "c" : [ 10, 9, 8, "seven", 11 ] }] ["string",{"a":"b","c":[1.0E1,9.0E0,8.0E0,"seven",1.1E1],"key":"val"}] +[ 1.2, 0.0, "text", 0, null, true, false ] [1.2E0,0.0E0,"text",0.0E0,null,true,false] +{ } {} +{ "foo" : "bar" } {"foo":"bar"} +{ "foo" : "bar", "baz" : "whatever" } {"baz":"whatever","foo":"bar"} +{ "ăț€": "val1", "âț€":"val2" } {"âț€":"val2","ăț€":"val1"} +select json_normalize(NULL); +json_normalize(NULL) +NULL +select json_normalize('{ "invalid": "no_close"'); +json_normalize('{ "invalid": "no_close"') +NULL +drop table t1; +drop view v1; +create table t1 (text varchar(200) character set 'latin1'); +insert into t1 values (unhex('22E522')); +create table t2 (text varchar(200) character set 'utf8mb4'); +insert into t2 SELECT * FROM t1; +select t1.text, hex(t1.text) from t1; +text hex(t1.text) +"Ã¥" 22E522 +select t2.text, hex(t2.text) from t2; +text hex(t2.text) +"Ã¥" 22C3A522 +select t1.text +, t2.text +, replace(json_normalize(t1.text), unhex('C3A5'), unhex('C385')) +, replace(json_normalize(t2.text), unhex('C3A5'), unhex('C385')) +, hex(replace(json_normalize(t1.text), unhex('C3A5'), unhex('C385'))) +, hex(replace(json_normalize(t2.text), unhex('C3A5'), unhex('C385'))) +from t1, t2; +text text replace(json_normalize(t1.text), unhex('C3A5'), unhex('C385')) replace(json_normalize(t2.text), unhex('C3A5'), unhex('C385')) hex(replace(json_normalize(t1.text), unhex('C3A5'), unhex('C385'))) hex(replace(json_normalize(t2.text), unhex('C3A5'), unhex('C385'))) +"Ã¥" "Ã¥" "Ã…" "Ã…" 22C38522 22C38522 +drop table t1; +drop table t2; +create table t1 (text varchar(1)); +insert into t1 values ('0'); +select concat_ws(' ', t1.text, t1.text) from t1; +concat_ws(' ', t1.text, t1.text) +0 0 +select concat_ws(' ', json_normalize(t1.text), json_normalize(t1.text)) from t1; +concat_ws(' ', json_normalize(t1.text), json_normalize(t1.text)) +0.0E0 0.0E0 +drop table t1; diff --git a/mysql-test/main/json_normalize.test b/mysql-test/main/json_normalize.test new file mode 100644 index 00000000000..29faa514cca --- /dev/null +++ b/mysql-test/main/json_normalize.test @@ -0,0 +1,58 @@ +set names utf8; + +create table t1 (json json); +show create table t1; + + +insert into t1 values +('{ }'), +('[ ]'), +('{ "foo" : "bar" }'), +('{ "foo" : "bar", "baz" : "whatever" }'), +('[ 1.2, 0.0, "text", 0, null, true, false ]'), +('[ "string", { "key" : "val", "a" : "b", "c" : [ 10, 9, 8, "seven", 11 ] }]'), +('{ "ăț€": "val1", "âț€":"val2" }'); + +select json, json_normalize(json) from t1 +order by json; + + +create view v1 as (select json, json_normalize(json) norm_json from t1); +show create view v1; + +select * from v1 +order by json; + +select json_normalize(NULL); +select json_normalize('{ "invalid": "no_close"'); + +drop table t1; +drop view v1; + +create table t1 (text varchar(200) character set 'latin1'); +insert into t1 values (unhex('22E522')); + +create table t2 (text varchar(200) character set 'utf8mb4'); +insert into t2 SELECT * FROM t1; + +select t1.text, hex(t1.text) from t1; +select t2.text, hex(t2.text) from t2; + +select t1.text + , t2.text + , replace(json_normalize(t1.text), unhex('C3A5'), unhex('C385')) + , replace(json_normalize(t2.text), unhex('C3A5'), unhex('C385')) + , hex(replace(json_normalize(t1.text), unhex('C3A5'), unhex('C385'))) + , hex(replace(json_normalize(t2.text), unhex('C3A5'), unhex('C385'))) +from t1, t2; + +drop table t1; +drop table t2; + +create table t1 (text varchar(1)); +insert into t1 values ('0'); + +select concat_ws(' ', t1.text, t1.text) from t1; +select concat_ws(' ', json_normalize(t1.text), json_normalize(t1.text)) from t1; + +drop table t1; diff --git a/mysql-test/main/mysql.result b/mysql-test/main/mysql.result index 75b1a01ee4e..70dde06600e 100644 --- a/mysql-test/main/mysql.result +++ b/mysql-test/main/mysql.result @@ -558,7 +558,9 @@ CREATE TABLE `a1\``b1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `a1\``b1` VALUES (1),(2); +INSERT INTO `a1\``b1` VALUES +(1), +(2); insert `a1\``b1` values (4),(5); show create table `a1\``b1`; Table Create Table @@ -587,7 +589,9 @@ CREATE TABLE "a1\""b1" ( "a" int(11) DEFAULT NULL ); /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO "a1\""b1" VALUES (1),(2); +INSERT INTO "a1\""b1" VALUES +(1), +(2); insert "a1\""b1" values (4),(5); show create table "a1\""b1"; Table Create Table @@ -603,11 +607,11 @@ set sql_mode=default; create table t1 (a text); select count(*) from t1; count(*) -41 +43 truncate table t1; select count(*) from t1; count(*) -41 +43 truncate table t1; select count(*) from t1; count(*) @@ -619,7 +623,7 @@ count(*) truncate table t1; select count(*) from t1; count(*) -41 +43 truncate table t1; select count(*) from t1; count(*) diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result index 2a158151528..a8aa461c863 100644 --- a/mysql-test/main/mysqld--help.result +++ b/mysql-test/main/mysqld--help.result @@ -1709,7 +1709,7 @@ performance-schema-max-socket-classes 10 performance-schema-max-socket-instances -1 performance-schema-max-sql-text-length 1024 performance-schema-max-stage-classes 160 -performance-schema-max-statement-classes 222 +performance-schema-max-statement-classes 221 performance-schema-max-statement-stack 10 performance-schema-max-table-handles -1 performance-schema-max-table-instances -1 diff --git a/mysql-test/main/mysqldump-max.result b/mysql-test/main/mysqldump-max.result index c1825814919..2e131d46f9b 100644 --- a/mysql-test/main/mysqldump-max.result +++ b/mysql-test/main/mysqldump-max.result @@ -102,7 +102,12 @@ CREATE TABLE `t1` ( /*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT DELAYED IGNORE INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +INSERT DELAYED IGNORE INTO `t1` VALUES +(1,'first value'), +(2,'first value'), +(3,'first value'), +(4,'first value'), +(5,'first value'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; DROP TABLE IF EXISTS `t2`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -114,7 +119,12 @@ CREATE TABLE `t2` ( /*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t2` DISABLE KEYS */; -INSERT DELAYED IGNORE INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +INSERT DELAYED IGNORE INTO `t2` VALUES +(1,'first value'), +(2,'first value'), +(3,'first value'), +(4,'first value'), +(5,'first value'); /*!40000 ALTER TABLE `t2` ENABLE KEYS */; DROP TABLE IF EXISTS `t3`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -126,7 +136,12 @@ CREATE TABLE `t3` ( /*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t3` DISABLE KEYS */; -INSERT DELAYED IGNORE INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +INSERT DELAYED IGNORE INTO `t3` VALUES +(1,'first value'), +(2,'first value'), +(3,'first value'), +(4,'first value'), +(5,'first value'); /*!40000 ALTER TABLE `t3` ENABLE KEYS */; DROP TABLE IF EXISTS `t4`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -138,7 +153,12 @@ CREATE TABLE `t4` ( /*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t4` DISABLE KEYS */; -INSERT DELAYED IGNORE INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +INSERT DELAYED IGNORE INTO `t4` VALUES +(1,'first value'), +(2,'first value'), +(3,'first value'), +(4,'first value'), +(5,'first value'); /*!40000 ALTER TABLE `t4` ENABLE KEYS */; DROP TABLE IF EXISTS `t5`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -150,7 +170,12 @@ CREATE TABLE `t5` ( /*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t5` DISABLE KEYS */; -INSERT DELAYED IGNORE INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +INSERT DELAYED IGNORE INTO `t5` VALUES +(1,'first value'), +(2,'first value'), +(3,'first value'), +(4,'first value'), +(5,'first value'); /*!40000 ALTER TABLE `t5` ENABLE KEYS */; DROP TABLE IF EXISTS `t6`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -162,7 +187,12 @@ CREATE TABLE `t6` ( /*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t6` DISABLE KEYS */; -INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +INSERT IGNORE INTO `t6` VALUES +(1,'first value'), +(2,'first value'), +(3,'first value'), +(4,'first value'), +(5,'first value'); /*!40000 ALTER TABLE `t6` ENABLE KEYS */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -199,7 +229,12 @@ CREATE TABLE `t1` ( /*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT DELAYED INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +INSERT DELAYED INTO `t1` VALUES +(1,'first value'), +(2,'first value'), +(3,'first value'), +(4,'first value'), +(5,'first value'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; DROP TABLE IF EXISTS `t2`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -211,7 +246,12 @@ CREATE TABLE `t2` ( /*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t2` DISABLE KEYS */; -INSERT DELAYED INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +INSERT DELAYED INTO `t2` VALUES +(1,'first value'), +(2,'first value'), +(3,'first value'), +(4,'first value'), +(5,'first value'); /*!40000 ALTER TABLE `t2` ENABLE KEYS */; DROP TABLE IF EXISTS `t3`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -223,7 +263,12 @@ CREATE TABLE `t3` ( /*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t3` DISABLE KEYS */; -INSERT DELAYED INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +INSERT DELAYED INTO `t3` VALUES +(1,'first value'), +(2,'first value'), +(3,'first value'), +(4,'first value'), +(5,'first value'); /*!40000 ALTER TABLE `t3` ENABLE KEYS */; DROP TABLE IF EXISTS `t4`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -235,7 +280,12 @@ CREATE TABLE `t4` ( /*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t4` DISABLE KEYS */; -INSERT DELAYED INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +INSERT DELAYED INTO `t4` VALUES +(1,'first value'), +(2,'first value'), +(3,'first value'), +(4,'first value'), +(5,'first value'); /*!40000 ALTER TABLE `t4` ENABLE KEYS */; DROP TABLE IF EXISTS `t5`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -247,7 +297,12 @@ CREATE TABLE `t5` ( /*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t5` DISABLE KEYS */; -INSERT DELAYED INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +INSERT DELAYED INTO `t5` VALUES +(1,'first value'), +(2,'first value'), +(3,'first value'), +(4,'first value'), +(5,'first value'); /*!40000 ALTER TABLE `t5` ENABLE KEYS */; DROP TABLE IF EXISTS `t6`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -259,7 +314,12 @@ CREATE TABLE `t6` ( /*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t6` DISABLE KEYS */; -INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +INSERT INTO `t6` VALUES +(1,'first value'), +(2,'first value'), +(3,'first value'), +(4,'first value'), +(5,'first value'); /*!40000 ALTER TABLE `t6` ENABLE KEYS */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; diff --git a/mysql-test/main/mysqldump-utf8mb4.result b/mysql-test/main/mysqldump-utf8mb4.result index 50c23c5efa9..904771302f8 100644 --- a/mysql-test/main/mysqldump-utf8mb4.result +++ b/mysql-test/main/mysqldump-utf8mb4.result @@ -56,7 +56,8 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES ('01f300','🌀','U+1F300 CYCLONE'); +INSERT INTO `t1` VALUES +('01f300','🌀','U+1F300 CYCLONE'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; diff --git a/mysql-test/main/mysqldump.result b/mysql-test/main/mysqldump.result index 0de2c5a111b..eae0e1b03c6 100644 --- a/mysql-test/main/mysqldump.result +++ b/mysql-test/main/mysqldump.result @@ -37,7 +37,9 @@ CREATE TABLE `t1` ( `a` decimal(64,20) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t1` VALUES (1234567890123456789012345678901234567890.00000000000000000000),(987654321098765432109876543210987654321.00000000000000000000); +INSERT INTO `t1` VALUES +(1234567890123456789012345678901234567890.00000000000000000000), +(987654321098765432109876543210987654321.00000000000000000000); DROP TABLE t1; # # Bug#2055 mysqldump should replace "-inf" numeric field values with "NULL" @@ -52,7 +54,8 @@ CREATE TABLE `t1` ( `a` double DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t1` VALUES (-1.7976931348623157e308); +INSERT INTO `t1` VALUES +(-1.7976931348623157e308); DROP TABLE t1; # # Bug#3361 mysqldump quotes DECIMAL values inconsistently @@ -74,7 +77,12 @@ CREATE TABLE `t1` ( `b` float DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t1` VALUES (1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456); +INSERT INTO `t1` VALUES +(1.23450,2.3456), +(1.23450,2.3456), +(1.23450,2.3456), +(1.23450,2.3456), +(1.23450,2.3456); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( @@ -82,7 +90,12 @@ CREATE TABLE `t1` ( `b` float DEFAULT NULL ); /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t1` VALUES (1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456); +INSERT INTO `t1` VALUES +(1.23450,2.3456), +(1.23450,2.3456), +(1.23450,2.3456), +(1.23450,2.3456), +(1.23450,2.3456); /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -105,7 +118,12 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES (1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456); +INSERT INTO `t1` VALUES +(1.23450,2.3456), +(1.23450,2.3456), +(1.23450,2.3456), +(1.23450,2.3456), +(1.23450,2.3456); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -132,7 +150,12 @@ CREATE TABLE `t1` ( ); /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t1` VALUES (1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456); +INSERT INTO `t1` VALUES +(1.23450,2.3456), +(1.23450,2.3456), +(1.23450,2.3456), +(1.23450,2.3456), +(1.23450,2.3456); /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -248,7 +271,9 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES (1),(2); +INSERT INTO `t1` VALUES +(1), +(2); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -271,7 +296,9 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES (1),(2); +INSERT INTO `t1` VALUES +(1), +(2); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -534,7 +561,8 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES ('ÄÖÜß'); +INSERT INTO `t1` VALUES +('ÄÖÜß'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -567,7 +595,8 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES ('Ž™šá'); +INSERT INTO `t1` VALUES +('Ž™šá'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -590,7 +619,8 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES ('Ž™šá'); +INSERT INTO `t1` VALUES +('Ž™šá'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -613,7 +643,8 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES ('ÄÖÜß'); +INSERT INTO `t1` VALUES +('ÄÖÜß'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -652,7 +683,10 @@ CREATE TABLE `t2` ( LOCK TABLES `t2` WRITE; /*!40000 ALTER TABLE `t2` DISABLE KEYS */; -INSERT INTO `t2` VALUES (4),(5),(6); +INSERT INTO `t2` VALUES +(4), +(5), +(6); /*!40000 ALTER TABLE `t2` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -734,7 +768,13 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6); +INSERT IGNORE INTO `t1` VALUES +(1), +(2), +(3), +(4), +(5), +(6); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -767,7 +807,13 @@ CREATE TABLE `t1` ( /*!40101 SET character_set_client = @saved_cs_client */; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT DELAYED IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6); +INSERT DELAYED IGNORE INTO `t1` VALUES +(1), +(2), +(3), +(4), +(5), +(6); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -1512,7 +1558,10 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES (1),(2),(3); +INSERT INTO `t1` VALUES +(1), +(2), +(3); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -1731,13 +1780,20 @@ insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thir LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES (NULL),(10),(20); +INSERT INTO `t1` VALUES +(NULL), +(10), +(20); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `t2` WRITE; /*!40000 ALTER TABLE `t2` DISABLE KEYS */; -INSERT INTO `t2` VALUES (1,NULL,NULL,NULL,NULL,NULL),(2,10,NULL,NULL,NULL,NULL),(3,NULL,'twenty',NULL,NULL,NULL),(4,30,'thirty',NULL,NULL,NULL); +INSERT INTO `t2` VALUES +(1,NULL,NULL,NULL,NULL,NULL), +(2,10,NULL,NULL,NULL,NULL), +(3,NULL,'twenty',NULL,NULL,NULL), +(4,30,'thirty',NULL,NULL,NULL); /*!40000 ALTER TABLE `t2` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -1770,7 +1826,10 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES (NULL),(10),(20); +INSERT INTO `t1` VALUES +(NULL), +(10), +(20); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; DROP TABLE IF EXISTS `t2`; @@ -1789,7 +1848,11 @@ CREATE TABLE `t2` ( LOCK TABLES `t2` WRITE; /*!40000 ALTER TABLE `t2` DISABLE KEYS */; -INSERT INTO `t2` VALUES (1,NULL,NULL,NULL,NULL,NULL),(2,10,NULL,NULL,NULL,NULL),(3,NULL,'twenty',NULL,NULL,NULL),(4,30,'thirty',NULL,NULL,NULL); +INSERT INTO `t2` VALUES +(1,NULL,NULL,NULL,NULL,NULL), +(2,10,NULL,NULL,NULL,NULL), +(3,NULL,'twenty',NULL,NULL,NULL), +(4,30,'thirty',NULL,NULL,NULL); /*!40000 ALTER TABLE `t2` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -1975,7 +2038,8 @@ CREATE TABLE "t1" ( LOCK TABLES "t1" WRITE; /*!40000 ALTER TABLE "t1" DISABLE KEYS */; -INSERT INTO "t1" VALUES (815,4711,2006); +INSERT INTO "t1" VALUES +(815,4711,2006); /*!40000 ALTER TABLE "t1" ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -2009,7 +2073,8 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES (815,4711,2006); +INSERT INTO `t1` VALUES +(815,4711,2006); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -2061,7 +2126,12 @@ CREATE TABLE `t2` ( LOCK TABLES `t2` WRITE; /*!40000 ALTER TABLE `t2` DISABLE KEYS */; -INSERT INTO `t2` VALUES ('alfred'),('angie'),('bingo'),('waffle'),('lemon'); +INSERT INTO `t2` VALUES +('alfred'), +('angie'), +('bingo'), +('waffle'), +('lemon'); /*!40000 ALTER TABLE `t2` ENABLE KEYS */; UNLOCK TABLES; DROP TABLE IF EXISTS `v2`; @@ -2229,7 +2299,12 @@ CREATE TABLE `t2` ( LOCK TABLES `t2` WRITE; /*!40000 ALTER TABLE `t2` DISABLE KEYS */; -INSERT INTO `t2` VALUES ('alfred'),('angie'),('bingo'),('waffle'),('lemon'); +INSERT INTO `t2` VALUES +('alfred'), +('angie'), +('bingo'), +('waffle'), +('lemon'); /*!40000 ALTER TABLE `t2` ENABLE KEYS */; UNLOCK TABLES; DROP TABLE IF EXISTS `v2`; @@ -2295,7 +2370,8 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES ('\''); +INSERT INTO `t1` VALUES +('\''); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -2343,7 +2419,10 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES (1,2,'one'),(2,4,'two'),(3,6,'three'); +INSERT INTO `t1` VALUES +(1,2,'one'), +(2,4,'two'), +(3,6,'three'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; DROP TABLE IF EXISTS `v1`; @@ -2501,7 +2580,11 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES (1,NULL),(2,NULL),(4,NULL),(11,NULL); +INSERT INTO `t1` VALUES +(1,NULL), +(2,NULL), +(4,NULL), +(11,NULL); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!50003 SET @saved_cs_client = @@character_set_client */ ; @@ -2630,7 +2713,11 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES (1,NULL),(2,NULL),(4,NULL),(11,NULL); +INSERT INTO `t1` VALUES +(1,NULL), +(2,NULL), +(4,NULL), +(11,NULL); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; DROP TABLE IF EXISTS `t2`; @@ -2776,7 +2863,12 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES (1),(2),(3),(4),(5); +INSERT INTO `t1` VALUES +(1), +(2), +(3), +(4), +(5); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!50003 DROP FUNCTION IF EXISTS `bug9056_func1` */; @@ -2928,7 +3020,9 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES ('2003-10-25 22:00:00'),('2003-10-25 23:00:00'); +INSERT INTO `t1` VALUES +('2003-10-25 22:00:00'), +('2003-10-25 23:00:00'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -2965,7 +3059,9 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES ('2003-10-26 02:00:00'),('2003-10-26 02:00:00'); +INSERT INTO `t1` VALUES +('2003-10-26 02:00:00'), +('2003-10-26 02:00:00'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; @@ -3017,7 +3113,10 @@ CREATE TABLE "t1 test" ( LOCK TABLES "t1 test" WRITE; /*!40000 ALTER TABLE "t1 test" DISABLE KEYS */; -INSERT INTO "t1 test" VALUES (1),(2),(3); +INSERT INTO "t1 test" VALUES +(1), +(2), +(3); /*!40000 ALTER TABLE "t1 test" ENABLE KEYS */; UNLOCK TABLES; /*!50003 SET @saved_cs_client = @@character_set_client */ ; @@ -3046,7 +3145,10 @@ CREATE TABLE "t2 test" ( LOCK TABLES "t2 test" WRITE; /*!40000 ALTER TABLE "t2 test" DISABLE KEYS */; -INSERT INTO "t2 test" VALUES (1),(2),(3); +INSERT INTO "t2 test" VALUES +(1), +(2), +(3); /*!40000 ALTER TABLE "t2 test" ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -3102,7 +3204,10 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES (1,'first value','xxxx'),(2,'second value','tttt'),(3,'third value','vvv vvv'); +INSERT INTO `t1` VALUES +(1,'first value','xxxx'), +(2,'second value','tttt'), +(3,'third value','vvv vvv'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; DROP TABLE IF EXISTS `v0`; @@ -3326,7 +3431,8 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES (0x00,''); +INSERT INTO `t1` VALUES +(0x00,''); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -3504,7 +3610,11 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES (1232131),(4711),(3231),(815); +INSERT INTO `t1` VALUES +(1232131), +(4711), +(3231), +(815); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; DROP TABLE IF EXISTS `v1`; @@ -3888,7 +3998,8 @@ CREATE TABLE `t1` ( `c2` longblob DEFAULT NULL ); /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t1` VALUES (11,0x7171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171); +INSERT INTO `t1` VALUES +(11,0x7171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171); DROP TABLE t1; # # Bug#28524 mysqldump --skip-add-drop-table is not @@ -4121,7 +4232,11 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -REPLACE INTO `t1` VALUES (1,1),(2,3),(3,4),(4,5); +REPLACE INTO `t1` VALUES +(1,1), +(2,3), +(3,4), +(4,5); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -4395,7 +4510,11 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES (1232131),(4711),(3231),(815); +INSERT INTO `t1` VALUES +(1232131), +(4711), +(3231), +(815); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; DROP TABLE IF EXISTS `v1`; @@ -5487,7 +5606,9 @@ CREATE TABLE `basetable` ( `id` smallint(6) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `basetable` VALUES (5),(6); +INSERT INTO `basetable` VALUES +(5), +(6); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `nonunique_table_name` ( @@ -5511,14 +5632,18 @@ CREATE TABLE `nonunique_table_name` ( UNIQUE KEY `i1` (`i1`) ) ENGINE=MEMORY AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `nonunique_table_name` VALUES (1),(2); +INSERT INTO `nonunique_table_name` VALUES +(1), +(2); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `nonunique_table_view_name` ( `i2` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `nonunique_table_view_name` VALUES (3),(4); +INSERT INTO `nonunique_table_view_name` VALUES +(3), +(4); USE `db1`; /*!50001 DROP TABLE IF EXISTS `nonunique_table_view_name`*/; @@ -5547,14 +5672,18 @@ CREATE TABLE `nonunique_table_name` ( UNIQUE KEY `i1` (`i1`) ) ENGINE=MEMORY AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `nonunique_table_name` VALUES (1),(2); +INSERT INTO `nonunique_table_name` VALUES +(1), +(2); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `nonunique_table_view_name` ( `i2` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `nonunique_table_view_name` VALUES (3),(4); +INSERT INTO `nonunique_table_view_name` VALUES +(3), +(4); ################################################## # --compact --delayed-insert --no-data-med=0 --databases db2 db1 @@ -5569,14 +5698,18 @@ CREATE TABLE `nonunique_table_name` ( UNIQUE KEY `i1` (`i1`) ) ENGINE=MEMORY AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT DELAYED INTO `nonunique_table_name` VALUES (1),(2); +INSERT DELAYED INTO `nonunique_table_name` VALUES +(1), +(2); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `nonunique_table_view_name` ( `i2` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `nonunique_table_view_name` VALUES (3),(4); +INSERT INTO `nonunique_table_view_name` VALUES +(3), +(4); CREATE DATABASE /*!32312 IF NOT EXISTS*/ `db1` /*!40100 DEFAULT CHARACTER SET utf8mb3 */; @@ -5587,14 +5720,18 @@ CREATE TABLE `basetable` ( `id` smallint(6) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT DELAYED INTO `basetable` VALUES (5),(6); +INSERT DELAYED INTO `basetable` VALUES +(5), +(6); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `nonunique_table_name` ( `i3` smallint(6) DEFAULT NULL ) ENGINE=MRG_MyISAM DEFAULT CHARSET=utf8mb3 INSERT_METHOD=LAST UNION=(`basetable`); /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `nonunique_table_name` VALUES (5),(6); +INSERT INTO `nonunique_table_name` VALUES +(5), +(6); SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `nonunique_table_view_name` ( @@ -6060,7 +6197,8 @@ CREATE TABLE `t1` ( `b` int(11) INVISIBLE DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t1` (`a`, `b`) VALUES (1,NULL),(1,2); +INSERT INTO `t1` (`a`, `b`) VALUES (1,NULL), +(1,2); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t2` ( @@ -6068,7 +6206,9 @@ CREATE TABLE `t2` ( `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t2` VALUES (1,2),(1,2); +INSERT INTO `t2` VALUES +(1,2), +(1,2); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t3` ( @@ -6077,14 +6217,18 @@ CREATE TABLE `t3` ( `ds=~!@ \# $% ^ & * ( ) _ - = +` int(11) INVISIBLE DEFAULT 5 ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t3` (`invisible`, `a b c & $!@#$%^&*( )`, `ds=~!@ \# $% ^ & * ( ) _ - = +`) VALUES (1,4,5),(5,4,5),(2,4,5),(1,2,3); +INSERT INTO `t3` (`invisible`, `a b c & $!@#$%^&*( )`, `ds=~!@ \# $% ^ & * ( ) _ - = +`) VALUES (1,4,5), +(5,4,5), +(2,4,5), +(1,2,3); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t4` ( `ËÃÃŒÃÎËÃ1` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t4` VALUES (1); +INSERT INTO `t4` VALUES +(1); #Check side effect on --complete insert /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -6093,7 +6237,8 @@ CREATE TABLE `t1` ( `b` int(11) INVISIBLE DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t1` (`a`, `b`) VALUES (1,NULL),(1,2); +INSERT INTO `t1` (`a`, `b`) VALUES (1,NULL), +(1,2); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t2` ( @@ -6101,7 +6246,8 @@ CREATE TABLE `t2` ( `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t2` (`a`, `b`) VALUES (1,2),(1,2); +INSERT INTO `t2` (`a`, `b`) VALUES (1,2), +(1,2); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t3` ( @@ -6110,7 +6256,10 @@ CREATE TABLE `t3` ( `ds=~!@ \# $% ^ & * ( ) _ - = +` int(11) INVISIBLE DEFAULT 5 ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t3` (`invisible`, `a b c & $!@#$%^&*( )`, `ds=~!@ \# $% ^ & * ( ) _ - = +`) VALUES (1,4,5),(5,4,5),(2,4,5),(1,2,3); +INSERT INTO `t3` (`invisible`, `a b c & $!@#$%^&*( )`, `ds=~!@ \# $% ^ & * ( ) _ - = +`) VALUES (1,4,5), +(5,4,5), +(2,4,5), +(1,2,3); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t4` ( diff --git a/mysql-test/main/openssl_1.result b/mysql-test/main/openssl_1.result index 96b1895d57b..a9264b3ed2c 100644 --- a/mysql-test/main/openssl_1.result +++ b/mysql-test/main/openssl_1.result @@ -98,7 +98,9 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES (1),(2); +INSERT INTO `t1` VALUES +(1), +(2); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -132,7 +134,9 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES (1),(2); +INSERT INTO `t1` VALUES +(1), +(2); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -166,7 +170,9 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -INSERT INTO `t1` VALUES (1),(2); +INSERT INTO `t1` VALUES +(1), +(2); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; diff --git a/mysql-test/main/partition_error.result b/mysql-test/main/partition_error.result index 25c29938f91..f98e940cfda 100644 --- a/mysql-test/main/partition_error.result +++ b/mysql-test/main/partition_error.result @@ -754,7 +754,7 @@ ERROR HY000: Field 'c' is of a not allowed type for this type of partitioning # CREATE TABLE t1 (a INT) PARTITION BY HASH(a); CREATE TEMPORARY TABLE tmp_t1 LIKE t1; -ERROR HY000: Partitioned tables do not support CREATE TEMPORARY TABLE +ERROR HY000: Table storage engine 'partition' does not support the create option 'TEMPORARY' DROP TABLE t1; # # Bug#42954: SQL MODE 'NO_DIR_IN_CREATE' does not work with diff --git a/mysql-test/main/partition_error.test b/mysql-test/main/partition_error.test index 7436bb060d2..25b15578248 100644 --- a/mysql-test/main/partition_error.test +++ b/mysql-test/main/partition_error.test @@ -788,7 +788,7 @@ PARTITION BY HASH (c) PARTITIONS 4; --echo # with temporary table and partitions --echo # CREATE TABLE t1 (a INT) PARTITION BY HASH(a); ---error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING +--error ER_ILLEGAL_HA_CREATE_OPTION CREATE TEMPORARY TABLE tmp_t1 LIKE t1; DROP TABLE t1; --echo # diff --git a/mysql-test/main/partition_exchange.result b/mysql-test/main/partition_exchange.result index b27da5b9b8c..02c9eeb50e9 100644 --- a/mysql-test/main/partition_exchange.result +++ b/mysql-test/main/partition_exchange.result @@ -1306,5 +1306,4 @@ ALTER TABLE t1 ADD PARTITION (PARTITION pm TABLESPACE = `innodb_file_per_table`) CREATE TABLE t2 like t1; ALTER TABLE t2 REMOVE PARTITIONING; ALTER TABLE t1 EXCHANGE PARTITION pm WITH TABLE t2; -ERROR HY000: Non matching attribute 'TABLESPACE' between partition and table DROP TABLE t1, t2; diff --git a/mysql-test/main/partition_exchange.test b/mysql-test/main/partition_exchange.test index e996866b1f9..d865a1e541a 100644 --- a/mysql-test/main/partition_exchange.test +++ b/mysql-test/main/partition_exchange.test @@ -533,7 +533,7 @@ CREATE TABLE t1 (a VARCHAR(200)) PARTITION BY KEY(a) partitions 10; ALTER TABLE t1 ADD PARTITION (PARTITION pm TABLESPACE = `innodb_file_per_table`); CREATE TABLE t2 like t1; ALTER TABLE t2 REMOVE PARTITIONING; ---error ER_PARTITION_EXCHANGE_DIFFERENT_OPTION +# The following works as table spaces are not checked anymore ALTER TABLE t1 EXCHANGE PARTITION pm WITH TABLE t2; DROP TABLE t1, t2; diff --git a/mysql-test/main/partition_range.result b/mysql-test/main/partition_range.result index ac8d34c71a2..7384def5c85 100644 --- a/mysql-test/main/partition_range.result +++ b/mysql-test/main/partition_range.result @@ -294,9 +294,9 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (`a`) -(PARTITION `x1` VALUES LESS THAN (5) TABLESPACE = ts1 ENGINE = MyISAM, - PARTITION `x2` VALUES LESS THAN (10) TABLESPACE = ts2 ENGINE = MyISAM, - PARTITION `x3` VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM) +(PARTITION `x1` VALUES LESS THAN (5) ENGINE = MyISAM, + PARTITION `x2` VALUES LESS THAN (10) ENGINE = MyISAM, + PARTITION `x3` VALUES LESS THAN MAXVALUE ENGINE = MyISAM) ALTER TABLE t1 partition by range (a) partitions 3 @@ -318,9 +318,9 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (`a`) -(PARTITION `x1` VALUES LESS THAN (5) TABLESPACE = ts1 ENGINE = MyISAM, - PARTITION `x2` VALUES LESS THAN (10) TABLESPACE = ts2 ENGINE = MyISAM, - PARTITION `x3` VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM) +(PARTITION `x1` VALUES LESS THAN (5) ENGINE = MyISAM, + PARTITION `x2` VALUES LESS THAN (10) ENGINE = MyISAM, + PARTITION `x3` VALUES LESS THAN MAXVALUE ENGINE = MyISAM) drop table if exists t1; CREATE TABLE t1 ( a int not null, diff --git a/mysql-test/main/partition_sync.test b/mysql-test/main/partition_sync.test index 22ca7df7e62..a07fb6e5c13 100644 --- a/mysql-test/main/partition_sync.test +++ b/mysql-test/main/partition_sync.test @@ -1,5 +1,6 @@ --source include/have_partition.inc --source include/have_debug.inc +--source include/have_debug_sync.inc # Save the initial number of concurrent sessions. --source include/count_sessions.inc diff --git a/mysql-test/main/ps_missed_cmds.result b/mysql-test/main/ps_missed_cmds.result index 1d996141adf..ce3b6acc898 100644 --- a/mysql-test/main/ps_missed_cmds.result +++ b/mysql-test/main/ps_missed_cmds.result @@ -771,27 +771,4 @@ EXECUTE stmt_2; DROP TABLE t1; DEALLOCATE PREPARE stmt_1; DEALLOCATE PREPARE stmt_2; -# Test Test case 25: Check the statements 'CREATE/ALTER/DROP TABLEPSPACE' -# can be executed as a prepared statement -PREPARE stmt_1 FROM "CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd' ENGINE=InnoDB"; -PREPARE stmt_2 FROM "ALTER TABLESPACE ts1 ADD DATAFILE 'ts1_1.ibd' ENGINE=InnoDB"; -PREPARE stmt_3 FROM "DROP TABLESPACE ts1 ENGINE=InnoDB"; -EXECUTE stmt_1; -# Execute the same prepared statement the second time to check that -# no internal structures used for handling the 'CREATE TABLESPACE' -# statement were damaged. -EXECUTE stmt_1; -EXECUTE stmt_2; -# Execute the same prepared statement the second time to check that -# no internal structures used for handling the 'ALTER TABLESPACE' -# statement were damaged. -EXECUTE stmt_2; -EXECUTE stmt_3; -# Execute the same prepared statement the second time to check that -# no internal structures used for handling the 'DROP TABLESPACE' -# statement were damaged. -EXECUTE stmt_3; -DEALLOCATE PREPARE stmt_1; -DEALLOCATE PREPARE stmt_2; -DEALLOCATE PREPARE stmt_3; SET default_storage_engine= @save_storage_engine; diff --git a/mysql-test/main/ps_missed_cmds.test b/mysql-test/main/ps_missed_cmds.test index 1546b064d89..632457209f2 100644 --- a/mysql-test/main/ps_missed_cmds.test +++ b/mysql-test/main/ps_missed_cmds.test @@ -585,50 +585,5 @@ DROP TABLE t1; DEALLOCATE PREPARE stmt_1; DEALLOCATE PREPARE stmt_2; ---echo # Test Test case 25: Check the statements 'CREATE/ALTER/DROP TABLEPSPACE' ---echo # can be executed as a prepared statement - -PREPARE stmt_1 FROM "CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd' ENGINE=InnoDB"; -PREPARE stmt_2 FROM "ALTER TABLESPACE ts1 ADD DATAFILE 'ts1_1.ibd' ENGINE=InnoDB"; -PREPARE stmt_3 FROM "DROP TABLESPACE ts1 ENGINE=InnoDB"; - -# Since MariaDB supports for tablespaces only on syntax level disable warnings -# before run CREATE/ALTER/DROP TABLESPACE statements in order to exclude -# the following in result output -# Warning 1478 Table storage engine 'InnoDB' does not support the create option 'TABLESPACE ---disable_warnings - -EXECUTE stmt_1; ---echo # Execute the same prepared statement the second time to check that ---echo # no internal structures used for handling the 'CREATE TABLESPACE' ---echo # statement were damaged. -# Since the 'CREATE TABLESPACE' statement is supported by MariaDB on syntax -# level only the second invocation of the CREATE TABLESPACE statement for -# the same tablespace name doesn't lead to error. -EXECUTE stmt_1; - -EXECUTE stmt_2; ---echo # Execute the same prepared statement the second time to check that ---echo # no internal structures used for handling the 'ALTER TABLESPACE' ---echo # statement were damaged. -EXECUTE stmt_2; - -EXECUTE stmt_3; ---echo # Execute the same prepared statement the second time to check that ---echo # no internal structures used for handling the 'DROP TABLESPACE' ---echo # statement were damaged. - -# Since the 'DROP TABLESPACE' statement is supported by MariaDB on syntax -# level only the second invocation of the DROP TABLESPACE statement for -# the same tablespace name doesn't lead to an error that tablespace -# doesn't exist. -EXECUTE stmt_3; - ---enable_warnings - -DEALLOCATE PREPARE stmt_1; -DEALLOCATE PREPARE stmt_2; -DEALLOCATE PREPARE stmt_3; - --enable_ps_protocol SET default_storage_engine= @save_storage_engine; diff --git a/mysql-test/main/ps_missed_cmds_bin_prot.result b/mysql-test/main/ps_missed_cmds_bin_prot.result index d27159354f5..a56371565a6 100644 --- a/mysql-test/main/ps_missed_cmds_bin_prot.result +++ b/mysql-test/main/ps_missed_cmds_bin_prot.result @@ -236,9 +236,4 @@ SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001, MESSAGE_TEXT='Hello, world!'; ERROR 45000: Hello, world! RESIGNAL SET MESSAGE_TEXT = 'New error message'; ERROR 0K000: RESIGNAL when handler not active -# Test Test case 29: Check the statements 'CREATE/ALTER/DROP TABLEPSPACE' -# can be executed as a prepared statement -CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd' ENGINE=InnoDB; -ALTER TABLESPACE ts1 ADD DATAFILE 'ts1_1.ibd' ENGINE=InnoDB; -DROP TABLESPACE ts1 ENGINE=InnoDB; SET default_storage_engine= @save_storage_engine; diff --git a/mysql-test/main/ps_missed_cmds_bin_prot.test b/mysql-test/main/ps_missed_cmds_bin_prot.test index f36385cc079..f10ee9a3b55 100644 --- a/mysql-test/main/ps_missed_cmds_bin_prot.test +++ b/mysql-test/main/ps_missed_cmds_bin_prot.test @@ -251,19 +251,6 @@ SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001, MESSAGE_TEXT='Hello, world!'; --error ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER RESIGNAL SET MESSAGE_TEXT = 'New error message'; ---echo # Test Test case 29: Check the statements 'CREATE/ALTER/DROP TABLEPSPACE' ---echo # can be executed as a prepared statement - -# Since MariaDB supports for tablespaces only on syntax level disable warnings -# before run CREATE/ALTER/DROP TABLESPACE statements in order to exclude -# the following in result output -# Warning 1478 Table storage engine 'InnoDB' does not support the create option 'TABLESPACE ---disable_warnings - -CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd' ENGINE=InnoDB; -ALTER TABLESPACE ts1 ADD DATAFILE 'ts1_1.ibd' ENGINE=InnoDB; -DROP TABLESPACE ts1 ENGINE=InnoDB; - --enable_warnings SET default_storage_engine= @save_storage_engine; diff --git a/mysql-test/main/show_explain.test b/mysql-test/main/show_explain.test index 415a892c0ec..6cbd92ce44b 100644 --- a/mysql-test/main/show_explain.test +++ b/mysql-test/main/show_explain.test @@ -2,6 +2,7 @@ # Tests for SHOW EXPLAIN FOR functionality # --source include/have_debug.inc +--source include/have_debug_sync.inc --source include/have_innodb.inc # Using valgrind can cause 'reap' to fail. See comment below --source include/not_valgrind.inc diff --git a/mysql-test/main/show_explain_non_select.test b/mysql-test/main/show_explain_non_select.test index 505e9296222..92b3c9788c9 100644 --- a/mysql-test/main/show_explain_non_select.test +++ b/mysql-test/main/show_explain_non_select.test @@ -2,6 +2,7 @@ # SHOW EXPLAIN tests for non-select subqueries # --source include/have_debug.inc +--source include/have_debug_sync.inc --source include/have_innodb.inc --source include/not_embedded.inc diff --git a/mysql-test/main/signal_code.result b/mysql-test/main/signal_code.result index 32192251fe9..2ea3a7e56b2 100644 --- a/mysql-test/main/signal_code.result +++ b/mysql-test/main/signal_code.result @@ -20,16 +20,16 @@ return 0; end $$ show procedure code signal_proc; Pos Instruction -0 stmt 130 "SIGNAL foo" -1 stmt 130 "SIGNAL foo SET MESSAGE_TEXT = "This i..." -2 stmt 131 "RESIGNAL foo" -3 stmt 131 "RESIGNAL foo SET MESSAGE_TEXT = "This..." +0 stmt 129 "SIGNAL foo" +1 stmt 129 "SIGNAL foo SET MESSAGE_TEXT = "This i..." +2 stmt 130 "RESIGNAL foo" +3 stmt 130 "RESIGNAL foo SET MESSAGE_TEXT = "This..." drop procedure signal_proc; show function code signal_func; Pos Instruction -0 stmt 130 "SIGNAL foo" -1 stmt 130 "SIGNAL foo SET MESSAGE_TEXT = "This i..." -2 stmt 131 "RESIGNAL foo" -3 stmt 131 "RESIGNAL foo SET MESSAGE_TEXT = "This..." +0 stmt 129 "SIGNAL foo" +1 stmt 129 "SIGNAL foo SET MESSAGE_TEXT = "This i..." +2 stmt 130 "RESIGNAL foo" +3 stmt 130 "RESIGNAL foo SET MESSAGE_TEXT = "This..." 4 freturn int 0 drop function signal_func; diff --git a/mysql-test/main/truncate_notembedded.result b/mysql-test/main/truncate_notembedded.result index 67beb79707c..cf6498427d0 100644 --- a/mysql-test/main/truncate_notembedded.result +++ b/mysql-test/main/truncate_notembedded.result @@ -5,7 +5,7 @@ CREATE TABLE t1 (a INT) ENGINE=MyISAM; LOCK TABLE t1 READ; connect con1,localhost,root,,test; -SET SESSION max_session_mem_used= 45500; +SET SESSION max_session_mem_used= 8192; LOCK TABLE t1 WRITE; connection default; SELECT * FROM t1; @@ -13,6 +13,7 @@ a UNLOCK TABLES; connection con1; TRUNCATE TABLE t1; +ERROR HY000: The MariaDB server is running with the --max-thread-mem-used=8192 option so it cannot execute this statement disconnect con1; connection default; DROP TABLE t1; diff --git a/mysql-test/main/truncate_notembedded.test b/mysql-test/main/truncate_notembedded.test index c1fab2d3609..8fd5d5dbc86 100644 --- a/mysql-test/main/truncate_notembedded.test +++ b/mysql-test/main/truncate_notembedded.test @@ -9,7 +9,7 @@ CREATE TABLE t1 (a INT) ENGINE=MyISAM; LOCK TABLE t1 READ; --connect (con1,localhost,root,,test) -SET SESSION max_session_mem_used= 45500; +SET SESSION max_session_mem_used= 8192; --send LOCK TABLE t1 WRITE; @@ -19,10 +19,7 @@ UNLOCK TABLES; --connection con1 --reap -# This may work or fail as different servers uses different amount of -# memory and the statement may work or not. What is important is that we -# don't get a crash here! ---error 0,ER_OPTION_PREVENTS_STATEMENT +--error ER_OPTION_PREVENTS_STATEMENT TRUNCATE TABLE t1; --disconnect con1 diff --git a/mysql-test/main/view_debug.test b/mysql-test/main/view_debug.test index 0e448ae2721..bf8074ddeb1 100644 --- a/mysql-test/main/view_debug.test +++ b/mysql-test/main/view_debug.test @@ -1,5 +1,6 @@ --source include/have_debug.inc +--source include/have_debug_sync.inc --echo # --echo #MDEV-8087:Server crashed in Time_and_counter_tracker::incr_loops diff --git a/mysql-test/suite/galera/include/have_wsrep_replicate_myisam.inc b/mysql-test/suite/galera/include/have_wsrep_replicate_myisam.inc deleted file mode 100644 index 726fc6e2b18..00000000000 --- a/mysql-test/suite/galera/include/have_wsrep_replicate_myisam.inc +++ /dev/null @@ -1,4 +0,0 @@ ---require suite/galera/r/have_wsrep_replicate_myisam.require -disable_query_log; -SHOW VARIABLES LIKE 'wsrep_replicate_myisam'; -enable_query_log; diff --git a/mysql-test/suite/galera/r/MW-328A.result b/mysql-test/suite/galera/r/MW-328A.result deleted file mode 100644 index f256558644e..00000000000 --- a/mysql-test/suite/galera/r/MW-328A.result +++ /dev/null @@ -1,47 +0,0 @@ -connection node_2; -connection node_1; -CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB; -INSERT INTO t1 (f1) VALUES (1); -CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB; -CREATE PROCEDURE proc_update () -BEGIN -DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; -SET SESSION wsrep_sync_wait = 0; -WHILE 1 DO -UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4); -END WHILE; -END| -connect node_1X, 127.0.0.1, root, , test, $NODE_MYPORT_1; -connection node_1X; -CALL proc_update();; -connection node_1; -call mtr.add_suppression("WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position"); -connection node_2; -call mtr.add_suppression("WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position"); -SET SESSION wsrep_retry_autocommit = 0; -connection node_1; -connection node_1X; -Got one of the listed errors -connection node_1; -DROP PROCEDURE proc_update; -DROP TABLE t1, t2; -CALL mtr.add_suppression("conflict state ABORTED after post commit"); -connection node_1; -CREATE TABLE t1 (i int primary key, j int) engine=innodb; -INSERT INTO t1 values (1,0); -BEGIN; -UPDATE t1 SET j=1 WHERE i=1; -connection node_2; -UPDATE t1 SET j=2 WHERE i=1; -connection node_1; -COMMIT; -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -SELECT * FROM t1; -i j -1 2 -connection node_2; -SELECT * FROM t1; -i j -1 2 -connection node_1; -DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/MW-328B.result b/mysql-test/suite/galera/r/MW-328B.result deleted file mode 100644 index 93a8685cc9e..00000000000 --- a/mysql-test/suite/galera/r/MW-328B.result +++ /dev/null @@ -1,25 +0,0 @@ -connection node_2; -connection node_1; -CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB; -INSERT INTO t1 (f1) VALUES (1); -CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB; -CREATE PROCEDURE proc_update () -BEGIN -DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; -SET SESSION wsrep_sync_wait = 0; -WHILE 1 DO -UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4); -END WHILE; -END| -connect node_1X, 127.0.0.1, root, , test, $NODE_MYPORT_1; -connection node_1X; -CALL proc_update();; -connection node_2; -SET SESSION wsrep_retry_autocommit = 0; -connection node_1; -connection node_1X; -Got one of the listed errors -connection node_1; -DROP PROCEDURE proc_update; -DROP TABLE t1, t2; -CALL mtr.add_suppression("conflict state ABORTED after post commit"); diff --git a/mysql-test/suite/galera/r/MW-328C.result b/mysql-test/suite/galera/r/MW-328C.result deleted file mode 100644 index 7a00bb718de..00000000000 --- a/mysql-test/suite/galera/r/MW-328C.result +++ /dev/null @@ -1,25 +0,0 @@ -connection node_2; -connection node_1; -CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB; -INSERT INTO t1 (f1) VALUES (1); -CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB; -CREATE PROCEDURE proc_update () -BEGIN -DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; -SET SESSION wsrep_sync_wait = 0; -WHILE 1 DO -UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4); -END WHILE; -END| -connect node_1X, 127.0.0.1, root, , test, $NODE_MYPORT_1; -connection node_1X; -CALL proc_update();; -connection node_2; -SET SESSION wsrep_retry_autocommit = 10000; -connection node_1; -connection node_1X; -Got one of the listed errors -connection node_1; -DROP PROCEDURE proc_update; -DROP TABLE t1, t2; -CALL mtr.add_suppression("conflict state ABORTED after post commit"); diff --git a/mysql-test/suite/galera/r/MW-328D.result b/mysql-test/suite/galera/r/MW-328D.result deleted file mode 100644 index 43e1cefe08f..00000000000 --- a/mysql-test/suite/galera/r/MW-328D.result +++ /dev/null @@ -1,22 +0,0 @@ -connection node_2; -connection node_1; -CREATE TABLE t1 (i INT) ENGINE = InnoDB; -INSERT INTO t1 (i) VALUES(1); -CREATE TABLE t2 (i INT) ENGINE = InnoDB; -connection node_1; -SET AUTOCOMMIT=OFF; -START TRANSACTION; -SELECT * FROM t1 WHERE i = 1 LOCK IN SHARE MODE; -i -1 -connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; -connection node_1a; -SET AUTOCOMMIT=OFF; -START TRANSACTION; -INSERT IGNORE INTO t2 SELECT * FROM t1 WHERE i = 1 FOR UPDATE;; -connection node_1; -DELETE FROM t1 WHERE i = 1; -COMMIT; -connection node_1a; -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -DROP TABLE t1, t2; diff --git a/mysql-test/suite/galera/r/MW-328E.result b/mysql-test/suite/galera/r/MW-328E.result deleted file mode 100644 index 729fdea1a63..00000000000 --- a/mysql-test/suite/galera/r/MW-328E.result +++ /dev/null @@ -1,22 +0,0 @@ -connection node_2; -connection node_1; -create table t1 (i int primary key, j int) engine=innodb; -create table t2 (i int primary key, j int) engine=innodb; -insert into t1 values (1,0); -insert into t2 values (2,0); -set autocommit=off; -start transaction; -update t1 set j=1 where i=1; -connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; -connection node_1a; -set autocommit=off; -start transaction; -begin; -update t2 set j=1 where i=2; -connection node_1; -insert into t1 select * from t2;; -connection node_1a; -insert into t2 select * from t1; -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -connection node_1; -DROP TABLE t1, t2; diff --git a/mysql-test/suite/galera/r/MW-416.result b/mysql-test/suite/galera/r/MW-416.result index ae95b832802..98a72c8d46b 100644 --- a/mysql-test/suite/galera/r/MW-416.result +++ b/mysql-test/suite/galera/r/MW-416.result @@ -10,16 +10,12 @@ ALTER EVENT ev1 RENAME TO ev2; ERROR 42000: Access denied for user 'userMW416'@'localhost' to database 'test' ALTER FUNCTION fun1 COMMENT 'foo'; ERROR 42000: alter routine command denied to user 'userMW416'@'localhost' for routine 'test.fun1' -ALTER LOGFILE GROUP lfg ADD UNDOFILE 'file' ENGINE=InnoDB; -Got one of the listed errors ALTER PROCEDURE proc1 COMMENT 'foo'; Got one of the listed errors ALTER SERVER srv OPTIONS (USER 'sally'); Got one of the listed errors ALTER TABLE tbl DROP COLUMN col; Got one of the listed errors -ALTER TABLESPACE tblspc DROP DATAFILE 'file' ENGINE=innodb; -Got one of the listed errors ALTER VIEW vw AS SELECT 1; Got one of the listed errors CREATE DATABASE db; @@ -34,14 +30,10 @@ CREATE PROCEDURE proc1() BEGIN END; Got one of the listed errors CREATE INDEX idx ON tbl(id); Got one of the listed errors -CREATE LOGFILE GROUP lfg ADD UNDOFILE 'undofile' ENGINE innodb; -Got one of the listed errors CREATE SERVER srv FOREIGN DATA WRAPPER 'fdw' OPTIONS (USER 'user'); Got one of the listed errors CREATE TABLE t (i int); Got one of the listed errors -CREATE TABLESPACE tblspc ADD DATAFILE 'file' ENGINE=innodb; -Got one of the listed errors CREATE TRIGGER trg BEFORE UPDATE ON t FOR EACH ROW BEGIN END; Got one of the listed errors CREATE VIEW vw AS SELECT 1; @@ -54,16 +46,12 @@ DROP FUNCTION fun1; Got one of the listed errors DROP INDEX idx ON t0; Got one of the listed errors -DROP LOGFILE GROUP lfg; -Got one of the listed errors DROP PROCEDURE proc1; Got one of the listed errors DROP SERVEr srv; Got one of the listed errors DROP TABLE t0; Got one of the listed errors -DROP TABLESPACE tblspc; -Got one of the listed errors DROP TRIGGER trg; Got one of the listed errors DROP VIEW vw; diff --git a/mysql-test/suite/galera/r/galera_defaults.result b/mysql-test/suite/galera/r/galera_defaults.result index bc9927b21d9..d6bbcbae680 100644 --- a/mysql-test/suite/galera/r/galera_defaults.result +++ b/mysql-test/suite/galera/r/galera_defaults.result @@ -1,9 +1,9 @@ connection node_2; connection node_1; # Correct Galera library found -SELECT COUNT(*) `expect 51` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%'; -expect 51 -51 +SELECT COUNT(*) `expect 50` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%'; +expect 50 +49 SELECT VARIABLE_NAME, VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%' @@ -47,7 +47,6 @@ WSREP_ON ON WSREP_OSU_METHOD TOI WSREP_RECOVER OFF WSREP_REJECT_QUERIES NONE -WSREP_REPLICATE_MYISAM OFF WSREP_RESTART_SLAVE OFF WSREP_RETRY_AUTOCOMMIT 1 WSREP_SLAVE_FK_CHECKS ON @@ -58,7 +57,6 @@ WSREP_SST_AUTH WSREP_SST_DONOR WSREP_SST_DONOR_REJECTS_QUERIES OFF WSREP_SST_METHOD rsync -WSREP_STRICT_DDL OFF WSREP_SYNC_WAIT 15 WSREP_TRX_FRAGMENT_SIZE 0 WSREP_TRX_FRAGMENT_UNIT bytes diff --git a/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result b/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result index 48625b3ba4a..a15b0c7df69 100644 --- a/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result +++ b/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result @@ -10,31 +10,31 @@ INSERT INTO t1 VALUES (1); INSERT INTO t2 VALUES (1); connection node_2a; SET SESSION wsrep_sync_wait=0; -SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%committing%'; -COUNT(*) = 1 +SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committing%' or STATE = 'Waiting for certification'); +EXPECT_1 1 -SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%'; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 0 FROM t1; -COUNT(*) = 0 -1 -SELECT COUNT(*) = 0 FROM t2; -COUNT(*) = 0 +SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%'; +EXPECT_1 1 +SELECT COUNT(*) AS EXPECT_0 FROM t1; +EXPECT_0 +0 +SELECT COUNT(*) AS EXPECT_0 FROM t2; +EXPECT_0 +0 connection node_2; UNLOCK TABLES; connection node_2a; SET SESSION wsrep_sync_wait = 15;; -SELECT COUNT(*) = 1 FROM t1; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 1 FROM t2; -COUNT(*) = 1 +SELECT COUNT(*) AS EXPECT_1 FROM t1; +EXPECT_1 1 -SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%committed%'; -COUNT(*) = 2 +SELECT COUNT(*) AS EXPECT_1 FROM t2; +EXPECT_1 1 +SELECT COUNT(*) AS EXPECT_2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committed%' or STATE = 'Waiting for certification'); +EXPECT_2 +2 SET GLOBAL wsrep_slave_threads = 1;; DROP TABLE t1; DROP TABLE t2; diff --git a/mysql-test/suite/galera/r/galera_var_wsrep_strict_ddl.result b/mysql-test/suite/galera/r/galera_var_wsrep_strict_ddl.result deleted file mode 100644 index d53708b3504..00000000000 --- a/mysql-test/suite/galera/r/galera_var_wsrep_strict_ddl.result +++ /dev/null @@ -1,26 +0,0 @@ -connection node_2; -connection node_1; -SELECT @@global.wsrep_mode; -@@global.wsrep_mode - -SELECT @@global.wsrep_strict_ddl; -@@global.wsrep_strict_ddl -0 -SET @@global.wsrep_strict_ddl=ON; -Warnings: -Warning 1287 '@@wsrep_strict_ddl' is deprecated and will be removed in a future release. Please use '@@wsrep_mode=STRICT_REPLICATION' instead -SELECT @@global.wsrep_mode; -@@global.wsrep_mode -STRICT_REPLICATION -SELECT @@global.wsrep_strict_ddl; -@@global.wsrep_strict_ddl -1 -SET @@global.wsrep_strict_ddl=OFF; -Warnings: -Warning 1287 '@@wsrep_strict_ddl' is deprecated and will be removed in a future release. Please use '@@wsrep_mode=STRICT_REPLICATION' instead -SELECT @@global.wsrep_mode; -@@global.wsrep_mode - -SELECT @@global.wsrep_strict_ddl; -@@global.wsrep_strict_ddl -0 diff --git a/mysql-test/suite/galera/t/MW-328-footer.inc b/mysql-test/suite/galera/t/MW-328-footer.inc deleted file mode 100644 index 12a4bf12590..00000000000 --- a/mysql-test/suite/galera/t/MW-328-footer.inc +++ /dev/null @@ -1,18 +0,0 @@ -# -# Cleanup for MW-328 tests -# - ---connection node_1 ---disable_query_log ---eval KILL CONNECTION $sp_connection_id ---enable_query_log - ---connection node_1X ---error 2013,1317 ---reap - ---connection node_1 -DROP PROCEDURE proc_update; -DROP TABLE t1, t2; - -CALL mtr.add_suppression("conflict state ABORTED after post commit"); diff --git a/mysql-test/suite/galera/t/MW-328-header.inc b/mysql-test/suite/galera/t/MW-328-header.inc deleted file mode 100644 index f0a6ccaccc6..00000000000 --- a/mysql-test/suite/galera/t/MW-328-header.inc +++ /dev/null @@ -1,29 +0,0 @@ -# -# Initialization for MW-328 tests -# - -CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB; -INSERT INTO t1 (f1) VALUES (1); - -CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB; - -# -# Have some random updates going on against t1 -# - -DELIMITER |; -CREATE PROCEDURE proc_update () -BEGIN - DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; - SET SESSION wsrep_sync_wait = 0; - WHILE 1 DO - UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4); - END WHILE; -END| - -DELIMITER ;| - ---connect node_1X, 127.0.0.1, root, , test, $NODE_MYPORT_1 ---connection node_1X ---let $sp_connection_id = `SELECT CONNECTION_ID()` ---send CALL proc_update(); diff --git a/mysql-test/suite/galera/t/MW-328A.cnf b/mysql-test/suite/galera/t/MW-328A.cnf deleted file mode 100644 index e68f891792c..00000000000 --- a/mysql-test/suite/galera/t/MW-328A.cnf +++ /dev/null @@ -1,7 +0,0 @@ -!include ../galera_2nodes.cnf - -[mysqld.1] -wsrep-debug=SERVER - -[mysqld.2] -wsrep-debug=SERVER diff --git a/mysql-test/suite/galera/t/MW-328A.test b/mysql-test/suite/galera/t/MW-328A.test deleted file mode 100644 index 2435a9e2c2e..00000000000 --- a/mysql-test/suite/galera/t/MW-328A.test +++ /dev/null @@ -1,82 +0,0 @@ -# -# MW-328 Fix unnecessary/silent BF aborts -# - -# -# test phase 1 is not deterministic -# -# Here we attempt to insert into t2 and check if insert actually -# inserted rows if a success was reported. -# -# However, deadlocks may or may not happen in this test execution -# it all depends on timing. -# - ---source include/galera_cluster.inc ---source include/force_restart.inc ---source suite/galera/t/MW-328-header.inc - ---connection node_1 -call mtr.add_suppression("WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position"); - ---connection node_2 -call mtr.add_suppression("WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position"); ---let $count = 100 ---let $successes = 0 ---let $deadlocks = 0 - -SET SESSION wsrep_retry_autocommit = 0; - ---disable_query_log - -while ($count) -{ - TRUNCATE TABLE t2; - - --error 0,ER_LOCK_DEADLOCK - INSERT IGNORE INTO t2 SELECT f2 FROM t1; - if ($mysql_errno != 1213) { - --inc $successes - if (`SELECT COUNT(*) = 0 FROM t2`) { - --die No rows arrived in table t2 - } - } - - if ($mysql_errno == 1213) { - --inc $deadlocks - - } - - --dec $count -} - ---enable_query_log - - ---source suite/galera/t/MW-328-footer.inc - -# -# Test phase 2 is deterministic -# Here we generate a sure conflict in node 1 and verify that -# insert failed in both nodes -# ---connection node_1 -CREATE TABLE t1 (i int primary key, j int) engine=innodb; -INSERT INTO t1 values (1,0); - -BEGIN; -UPDATE t1 SET j=1 WHERE i=1; - ---connection node_2 -UPDATE t1 SET j=2 WHERE i=1; - ---connection node_1 ---error ER_LOCK_DEADLOCK -COMMIT; - -SELECT * FROM t1; ---connection node_2 -SELECT * FROM t1; ---connection node_1 - -DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/MW-328B.cnf b/mysql-test/suite/galera/t/MW-328B.cnf deleted file mode 100644 index e68f891792c..00000000000 --- a/mysql-test/suite/galera/t/MW-328B.cnf +++ /dev/null @@ -1,7 +0,0 @@ -!include ../galera_2nodes.cnf - -[mysqld.1] -wsrep-debug=SERVER - -[mysqld.2] -wsrep-debug=SERVER diff --git a/mysql-test/suite/galera/t/MW-328B.test b/mysql-test/suite/galera/t/MW-328B.test deleted file mode 100644 index 41581d9c239..00000000000 --- a/mysql-test/suite/galera/t/MW-328B.test +++ /dev/null @@ -1,36 +0,0 @@ -# -# MW-328 Fix unnecessary/silent BF aborts -# - -# -# Make sure an unrelated SELECT following a BF-aborted query never -# gets the deadlock error -# - ---source include/galera_cluster.inc ---source include/force_restart.inc ---source suite/galera/t/MW-328-header.inc - ---connection node_2 ---let $count = 100 - -SET SESSION wsrep_retry_autocommit = 0; - ---disable_query_log - -while ($count) -{ - --error 0,1213 - INSERT IGNORE INTO t2 SELECT f2 FROM t1; - - --disable_result_log - --error 0 - SELECT 1 FROM DUAL; - --enable_result_log - - --dec $count -} - ---enable_query_log - ---source suite/galera/t/MW-328-footer.inc diff --git a/mysql-test/suite/galera/t/MW-328C.cnf b/mysql-test/suite/galera/t/MW-328C.cnf deleted file mode 100644 index e68f891792c..00000000000 --- a/mysql-test/suite/galera/t/MW-328C.cnf +++ /dev/null @@ -1,7 +0,0 @@ -!include ../galera_2nodes.cnf - -[mysqld.1] -wsrep-debug=SERVER - -[mysqld.2] -wsrep-debug=SERVER diff --git a/mysql-test/suite/galera/t/MW-328C.test b/mysql-test/suite/galera/t/MW-328C.test deleted file mode 100644 index 7241dfbdbca..00000000000 --- a/mysql-test/suite/galera/t/MW-328C.test +++ /dev/null @@ -1,35 +0,0 @@ -# -# MW-328 Fix unnecessary/silent BF aborts -# - -# -# Make sure that a high value of wsrep_retry_autocommit -# masks all deadlock errors -# - ---source include/galera_cluster.inc ---source suite/galera/t/MW-328-header.inc - ---connection node_2 ---let $count = 100 - -SET SESSION wsrep_retry_autocommit = 10000; - ---disable_query_log - -while ($count) -{ - --error 0 - INSERT IGNORE INTO t2 SELECT f2 FROM t1; - - --disable_result_log - --error 0 - SELECT 1 FROM DUAL; - --enable_result_log - - --dec $count -} - ---enable_query_log - ---source suite/galera/t/MW-328-footer.inc diff --git a/mysql-test/suite/galera/t/MW-328D.cnf b/mysql-test/suite/galera/t/MW-328D.cnf deleted file mode 100644 index e68f891792c..00000000000 --- a/mysql-test/suite/galera/t/MW-328D.cnf +++ /dev/null @@ -1,7 +0,0 @@ -!include ../galera_2nodes.cnf - -[mysqld.1] -wsrep-debug=SERVER - -[mysqld.2] -wsrep-debug=SERVER diff --git a/mysql-test/suite/galera/t/MW-328D.test b/mysql-test/suite/galera/t/MW-328D.test deleted file mode 100644 index e8a22f22a99..00000000000 --- a/mysql-test/suite/galera/t/MW-328D.test +++ /dev/null @@ -1,39 +0,0 @@ -# -# MW-328 Fix unnecessary/silent BF aborts -# - -# -# Test that non-Galera deadlock error still behaves as expected -# - ---source include/galera_cluster.inc - -CREATE TABLE t1 (i INT) ENGINE = InnoDB; -INSERT INTO t1 (i) VALUES(1); - -CREATE TABLE t2 (i INT) ENGINE = InnoDB; - -# Create a deadlock situation - ---connection node_1 -SET AUTOCOMMIT=OFF; -START TRANSACTION; -SELECT * FROM t1 WHERE i = 1 LOCK IN SHARE MODE; - ---connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 ---connection node_1a -SET AUTOCOMMIT=OFF; -START TRANSACTION; ---send INSERT IGNORE INTO t2 SELECT * FROM t1 WHERE i = 1 FOR UPDATE; - ---connection node_1 ---sleep 2 -DELETE FROM t1 WHERE i = 1; -COMMIT; - -# We expect that ER_LOCK_DEADLOCK will be delivered even though it was a INSERT INGORE statement ---connection node_1a ---error ER_LOCK_DEADLOCK ---reap - -DROP TABLE t1, t2; diff --git a/mysql-test/suite/galera/t/MW-328E.cnf b/mysql-test/suite/galera/t/MW-328E.cnf deleted file mode 100644 index e68f891792c..00000000000 --- a/mysql-test/suite/galera/t/MW-328E.cnf +++ /dev/null @@ -1,7 +0,0 @@ -!include ../galera_2nodes.cnf - -[mysqld.1] -wsrep-debug=SERVER - -[mysqld.2] -wsrep-debug=SERVER diff --git a/mysql-test/suite/galera/t/MW-328E.test b/mysql-test/suite/galera/t/MW-328E.test deleted file mode 100644 index 34b17be7b08..00000000000 --- a/mysql-test/suite/galera/t/MW-328E.test +++ /dev/null @@ -1,40 +0,0 @@ -# -# MW-328 Fix unnecessary/silent BF aborts -# - -# -# Test that non-Galera deadlock error still behaves as expected (case #2) -# - ---source include/galera_cluster.inc - -create table t1 (i int primary key, j int) engine=innodb; -create table t2 (i int primary key, j int) engine=innodb; - -insert into t1 values (1,0); -insert into t2 values (2,0); - -set autocommit=off; -start transaction; -update t1 set j=1 where i=1; - ---connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 ---connection node_1a -set autocommit=off; -start transaction; -begin; -update t2 set j=1 where i=2; - ---connection node_1 -# Hang expected here ---send insert into t1 select * from t2; - ---sleep 2 ---connection node_1a ---error ER_LOCK_DEADLOCK -insert into t2 select * from t1; - ---connection node_1 ---reap - -DROP TABLE t1, t2; diff --git a/mysql-test/suite/galera/t/MW-416.test b/mysql-test/suite/galera/t/MW-416.test index f9a1b47e2ff..f86ffcbf512 100644 --- a/mysql-test/suite/galera/t/MW-416.test +++ b/mysql-test/suite/galera/t/MW-416.test @@ -19,16 +19,12 @@ ALTER EVENT ev1 RENAME TO ev2; ALTER FUNCTION fun1 COMMENT 'foo'; #--error 1044,1227 #ALTER INSTANCE ROTATE INNODB MASTER KEY; ---error 1044,1227 -ALTER LOGFILE GROUP lfg ADD UNDOFILE 'file' ENGINE=InnoDB; --error 1044,1227,1370 ALTER PROCEDURE proc1 COMMENT 'foo'; --error 1044,1227,1370 ALTER SERVER srv OPTIONS (USER 'sally'); --error 1044,1142,1227,1370 ALTER TABLE tbl DROP COLUMN col; ---error 1044,1227,1370 -ALTER TABLESPACE tblspc DROP DATAFILE 'file' ENGINE=innodb; --error 1044,1142,1227,1370 ALTER VIEW vw AS SELECT 1; @@ -45,14 +41,10 @@ CREATE PROCEDURE proc1() BEGIN END; --error 1044,1142,1227,1370 CREATE INDEX idx ON tbl(id); --error 1044,1142,1227,1370 -CREATE LOGFILE GROUP lfg ADD UNDOFILE 'undofile' ENGINE innodb; ---error 1044,1142,1227,1370 CREATE SERVER srv FOREIGN DATA WRAPPER 'fdw' OPTIONS (USER 'user'); --error 1044,1142,1227,1370 CREATE TABLE t (i int); --error 1044,1142,1227,1370 -CREATE TABLESPACE tblspc ADD DATAFILE 'file' ENGINE=innodb; ---error 1044,1142,1227,1370 CREATE TRIGGER trg BEFORE UPDATE ON t FOR EACH ROW BEGIN END; --error 1044,1142,1227,1370 CREATE VIEW vw AS SELECT 1; @@ -67,16 +59,12 @@ DROP EVENT ev; DROP FUNCTION fun1; --error 1044,1142,1227,1370 DROP INDEX idx ON t0; ---error 1044,1142,1227,1370,1064 -DROP LOGFILE GROUP lfg; --error 1044,1142,1227,1370 DROP PROCEDURE proc1; --error 1044,1142,1227,1370 DROP SERVEr srv; --error 1044,1142,1227,1370 DROP TABLE t0; ---error 1044,1142,1227,1370,1064 -DROP TABLESPACE tblspc; --error 1044,1142,1227,1360,1370 DROP TRIGGER trg; --error 1044,1142,1227,1370 diff --git a/mysql-test/suite/galera/t/galera_backup_stage.test b/mysql-test/suite/galera/t/galera_backup_stage.test index 31d76816355..20ce6036d0d 100644 --- a/mysql-test/suite/galera/t/galera_backup_stage.test +++ b/mysql-test/suite/galera/t/galera_backup_stage.test @@ -56,7 +56,7 @@ ALTER TABLE t1 ADD COLUMN (f4 int(10)); # reach commit stage. In the unlikely case the interleaving is different, the # result of the test should not change. --connection node_1c ---let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.processlist WHERE State='Commit' AND ID=$insert_id +--let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.processlist WHERE (State='Commit' OR State='Waiting for certification') AND ID=$insert_id --source include/wait_condition.inc --let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.metadata_lock_info WHERE TABLE_NAME='t1' AND THREAD_ID=$insert_id --source include/wait_condition.inc @@ -83,11 +83,11 @@ ALTER TABLE t1 ADD COLUMN (f4 int(10)); # wait for insert to get blocked --connection node_1c ---let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.processlist WHERE State='Commit' AND ID=$insert_id +--let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.processlist WHERE (State='Commit' OR State='Waiting for certification') AND ID=$insert_id --source include/wait_condition.inc --let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.metadata_lock_info WHERE TABLE_NAME='t1' AND THREAD_ID=$insert_id --source include/wait_condition.inc ---let $wait_condition = SELECT COUNT(*)=2 FROM information_schema.processlist WHERE Info like 'INSERT INTO t1 (f1) values("node1%")' AND State = 'Commit' +--let $wait_condition = SELECT COUNT(*)=2 FROM information_schema.processlist WHERE Info like 'INSERT INTO t1 (f1) values("node1%")' AND (State = 'Commit' OR State='Waiting for certification') --source include/wait_condition.inc # nothing after BLOCK_DDL is applied diff --git a/mysql-test/suite/galera/t/galera_defaults.test b/mysql-test/suite/galera/t/galera_defaults.test index 96389e44d3f..6b76473d6a6 100644 --- a/mysql-test/suite/galera/t/galera_defaults.test +++ b/mysql-test/suite/galera/t/galera_defaults.test @@ -18,7 +18,7 @@ source ../wsrep/include/check_galera_version.inc; # Global Variables -SELECT COUNT(*) `expect 51` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%'; +SELECT COUNT(*) `expect 50` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%'; SELECT VARIABLE_NAME, VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES diff --git a/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test b/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test index 5a33c16c86e..2e9f05cb4af 100644 --- a/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test +++ b/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test @@ -32,19 +32,19 @@ INSERT INTO t2 VALUES (1); --connection node_2a --sleep 1 SET SESSION wsrep_sync_wait=0; -SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%committing%'; -SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%'; -SELECT COUNT(*) = 0 FROM t1; -SELECT COUNT(*) = 0 FROM t2; +SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committing%' or STATE = 'Waiting for certification'); +SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%'; +SELECT COUNT(*) AS EXPECT_0 FROM t1; +SELECT COUNT(*) AS EXPECT_0 FROM t2; --connection node_2 UNLOCK TABLES; --connection node_2a --eval SET SESSION wsrep_sync_wait = $wsrep_sync_wait_orig; -SELECT COUNT(*) = 1 FROM t1; -SELECT COUNT(*) = 1 FROM t2; -SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%committed%'; +SELECT COUNT(*) AS EXPECT_1 FROM t1; +SELECT COUNT(*) AS EXPECT_1 FROM t2; +SELECT COUNT(*) AS EXPECT_2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committed%' or STATE = 'Waiting for certification'); --eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig; DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/galera_var_wsrep_strict_ddl.test b/mysql-test/suite/galera/t/galera_var_wsrep_strict_ddl.test deleted file mode 100644 index 2aa76d46f82..00000000000 --- a/mysql-test/suite/galera/t/galera_var_wsrep_strict_ddl.test +++ /dev/null @@ -1,13 +0,0 @@ ---source include/galera_cluster.inc - -SELECT @@global.wsrep_mode; -SELECT @@global.wsrep_strict_ddl; - -SET @@global.wsrep_strict_ddl=ON; -SELECT @@global.wsrep_mode; -SELECT @@global.wsrep_strict_ddl; - -SET @@global.wsrep_strict_ddl=OFF; -SELECT @@global.wsrep_mode; -SELECT @@global.wsrep_strict_ddl; - diff --git a/mysql-test/suite/galera_3nodes/r/GCF-363.result b/mysql-test/suite/galera_3nodes/r/GCF-363.result index afab5012ee5..fbcbac3a398 100644 --- a/mysql-test/suite/galera_3nodes/r/GCF-363.result +++ b/mysql-test/suite/galera_3nodes/r/GCF-363.result @@ -1,5 +1,10 @@ connection node_2; connection node_1; +connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3; +connection node_1; +connection node_2; +connection node_3; +connection node_1; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) ENGINE=InnoDB; connection node_1; SET GLOBAL wsrep_on=OFF; @@ -9,7 +14,6 @@ connection node_2; SET GLOBAL wsrep_on=OFF; INSERT INTO t1 VALUES (1, 'a'); SET GLOBAL wsrep_on=ON; -connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3; connection node_3; INSERT INTO t1 VALUES (1, 'b'); SET SESSION wsrep_sync_wait = 0; diff --git a/mysql-test/suite/galera_3nodes/t/GCF-363.test b/mysql-test/suite/galera_3nodes/t/GCF-363.test index a65c42bcc5a..76be88bc771 100644 --- a/mysql-test/suite/galera_3nodes/t/GCF-363.test +++ b/mysql-test/suite/galera_3nodes/t/GCF-363.test @@ -5,6 +5,15 @@ --source include/galera_cluster.inc --source include/have_innodb.inc +--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 + +# Save original auto_increment_offset values. +--let $node_1=node_1 +--let $node_2=node_2 +--let $node_3=node_3 +--source ../galera/include/auto_increment_offset_save.inc + +--connection node_1 CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) ENGINE=InnoDB; --connection node_1 @@ -20,7 +29,6 @@ SET GLOBAL wsrep_on=OFF; INSERT INTO t1 VALUES (1, 'a'); SET GLOBAL wsrep_on=ON; ---connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 --connection node_3 INSERT INTO t1 VALUES (1, 'b'); SET SESSION wsrep_sync_wait = 0; @@ -63,4 +71,4 @@ CALL mtr.add_suppression("WSREP: Vote 0 \\\(success\\\) on (.*) is inconsistent CALL mtr.add_suppression("WSREP: Inconsistency detected: Inconsistent by consensus on "); CALL mtr.add_suppression("Plugin 'InnoDB' will be forced to shutdown"); - +--source ../galera/include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/multi_source/change_master.result b/mysql-test/suite/multi_source/change_master.result new file mode 100644 index 00000000000..9fd84e51364 --- /dev/null +++ b/mysql-test/suite/multi_source/change_master.result @@ -0,0 +1,8 @@ +RESET MASTER; +connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3; +change master 'abc1' to relay_log_file=''; +ERROR HY000: Failed initializing relay log position: Could not find target log during relay log initialization +change master 'abc1' to relay_log_file=''; +ERROR HY000: Failed initializing relay log position: Could not find target log during relay log initialization +disconnect slave; +connection default; diff --git a/mysql-test/suite/multi_source/change_master.test b/mysql-test/suite/multi_source/change_master.test new file mode 100644 index 00000000000..08e6909694f --- /dev/null +++ b/mysql-test/suite/multi_source/change_master.test @@ -0,0 +1,13 @@ +--source include/not_embedded.inc + +RESET MASTER; + +--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3) + +--error ER_RELAY_LOG_INIT +change master 'abc1' to relay_log_file=''; +--error ER_RELAY_LOG_INIT +change master 'abc1' to relay_log_file=''; +--disconnect slave +--connection default + diff --git a/mysql-test/suite/multi_source/multisource_for_channel.result b/mysql-test/suite/multi_source/multisource_for_channel.result new file mode 100644 index 00000000000..f96a5a93b97 --- /dev/null +++ b/mysql-test/suite/multi_source/multisource_for_channel.result @@ -0,0 +1,366 @@ +RESET MASTER; +connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3; +change master to relay_log_file='' for channel 'abc1'; +ERROR HY000: Failed initializing relay log position: Could not find target log during relay log initialization +change master to master_host='' for channel 'abc2'; +ERROR HY000: Incorrect arguments to MASTER_HOST +change master to +master_port=MYPORT_1, +master_host='127.0.0.1', +master_user='root' +for channel 'master1'; +start slave for channel 'master1'; +set default_master_connection = 'master1'; +include/wait_for_slave_to_start.inc +connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1; +connection slave; +# +# Checking SHOW SLAVE 'master1' STATUS +# +Master_Port = 'MYPORT_1' +Relay_Log_File = 'mysqld-relay-bin-master1.000002' +Slave_IO_Running = 'Yes' +Slave_SQL_Running = 'Yes' +Last_Errno = '0' +Last_SQL_Errno = '0' +# +# Checking SHOW SLAVE STATUS +# +Master_Port = 'MYPORT_1' +Relay_Log_File = 'mysqld-relay-bin-master1.000002' +Slave_IO_Running = 'Yes' +Slave_SQL_Running = 'Yes' +Last_Errno = '0' +Last_SQL_Errno = '0' +# +# Checking SHOW ALL SLAVES STATUS +# +Connection_name = 'master1' +Master_Port = 'MYPORT_1' +Relay_Log_File = 'mysqld-relay-bin-master1.000002' +Slave_IO_Running = 'Yes' +Slave_SQL_Running = 'Yes' +Last_Errno = '0' +Last_SQL_Errno = '0' +Slave_heartbeat_period = '60.000' +# +connection master1; +drop database if exists db1; +create database db1; +use db1; +create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM; +Warnings: +Warning 1280 Name 'pk' ignored for PRIMARY key. +insert into t1 (f1) values ('one'),('two'); +connection slave; +select * from db1.t1; +i f1 +1 one +2 two +# List of relay log files in the datadir +mysqld-relay-bin-master1.000001 +mysqld-relay-bin-master1.000002 +mysqld-relay-bin-master1.index +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-relay-bin-master1.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +mysqld-relay-bin-master1.000001 # Rotate # # mysqld-relay-bin-master1.000002;pos=4 +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-relay-bin-master1.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +mysqld-relay-bin-master1.000002 # Rotate # # master-bin.000001;pos=POS +mysqld-relay-bin-master1.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +mysqld-relay-bin-master1.000002 # Gtid_list # # [] +mysqld-relay-bin-master1.000002 # Binlog_checkpoint # # master-bin.000001 +mysqld-relay-bin-master1.000002 # Gtid # # GTID #-#-# +mysqld-relay-bin-master1.000002 # Query # # drop database if exists db1 +mysqld-relay-bin-master1.000002 # Gtid # # GTID #-#-# +mysqld-relay-bin-master1.000002 # Query # # create database db1 +mysqld-relay-bin-master1.000002 # Gtid # # GTID #-#-# +mysqld-relay-bin-master1.000002 # Query # # use `db1`; create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM +mysqld-relay-bin-master1.000002 # Gtid # # BEGIN GTID #-#-# +mysqld-relay-bin-master1.000002 # Intvar # # INSERT_ID=1 +mysqld-relay-bin-master1.000002 # Query # # use `db1`; insert into t1 (f1) values ('one'),('two') +mysqld-relay-bin-master1.000002 # Query # # COMMIT +change master to +master_port=MYPORT_2, +master_host='127.0.0.1', +master_user='root' +for channel 'master1'; +ERROR HY000: This operation cannot be performed as you have a running slave 'master1'; run STOP SLAVE 'master1' first +change master to +master_port=MYPORT_2, +master_host='127.0.0.1', +master_user='root'; +ERROR HY000: This operation cannot be performed as you have a running slave 'master1'; run STOP SLAVE 'master1' first +change master to +master_port=MYPORT_1, +master_host='127.0.0.1', +master_user='root' for channel 'master2'; +ERROR HY000: Connection 'master2' conflicts with existing connection 'master1' +set default_master_connection = ''; +change master to +master_port=MYPORT_2, +master_host='127.0.0.1', +master_user='root'; +start slave; +include/wait_for_slave_to_start.inc +# +# Checking SHOW ALL SLAVES STATUS +# +Connection_name = '' +Connection_name = 'master1' +Master_Port = 'MYPORT_2' +Master_Port = 'MYPORT_1' +Relay_Log_File = 'mysqld-relay-bin.000002' +Relay_Log_File = 'mysqld-relay-bin-master1.000002' +Slave_IO_Running = 'Yes' +Slave_IO_Running = 'Yes' +Slave_SQL_Running = 'Yes' +Slave_SQL_Running = 'Yes' +Last_Errno = '0' +Last_Errno = '0' +Last_SQL_Errno = '0' +Last_SQL_Errno = '0' +Slave_heartbeat_period = '60.000' +Slave_heartbeat_period = '60.000' +# +connection master1; +insert into t1 (f1) values ('three'); +connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2; +drop database if exists db2; +create database db2; +use db2; +create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB; +begin; +insert into t1 (f1) values (1),(2); +connection slave; +connection master2; +connection slave; +select * from db1.t1; +i f1 +1 one +2 two +3 three +select * from db2.t1; +pk f1 +connection master2; +commit; +connection slave; +select * from db2.t1; +pk f1 +1 1 +2 2 +connection master1; +flush logs; +connection slave; +connection master1; +purge binary logs to 'master-bin.000002'; +show binary logs; +Log_name File_size +master-bin.000002 filesize +insert into t1 (f1) values ('four'); +create table db1.t3 (f1 int) engine=InnoDB; +connection slave; +# +# Checking SHOW ALL SLAVES STATUS +# +Connection_name = '' +Connection_name = 'master1' +Master_Port = 'MYPORT_2' +Master_Port = 'MYPORT_1' +Relay_Log_File = 'mysqld-relay-bin.000002' +Relay_Log_File = 'mysqld-relay-bin-master1.000004' +Slave_IO_Running = 'Yes' +Slave_IO_Running = 'Yes' +Slave_SQL_Running = 'Yes' +Slave_SQL_Running = 'Yes' +Last_Errno = '0' +Last_Errno = '0' +Last_SQL_Errno = '0' +Last_SQL_Errno = '0' +Slave_heartbeat_period = '60.000' +Slave_heartbeat_period = '60.000' +# +# +# MDEV:16437: merge 5.7 P_S replication instrumentation and tables +# +SELECT * FROM performance_schema.replication_applier_status_by_coordinator; +CHANNEL_NAME master1 +THREAD_ID # +SERVICE_STATE ON +LAST_ERROR_NUMBER 0 +LAST_ERROR_MESSAGE +LAST_ERROR_TIMESTAMP 0000-00-00 00:00:00 +LAST_SEEN_TRANSACTION 0-1-7 +LAST_TRANS_RETRY_COUNT 0 +CHANNEL_NAME +THREAD_ID # +SERVICE_STATE ON +LAST_ERROR_NUMBER 0 +LAST_ERROR_MESSAGE +LAST_ERROR_TIMESTAMP 0000-00-00 00:00:00 +LAST_SEEN_TRANSACTION 0-2-4 +LAST_TRANS_RETRY_COUNT 0 +select * from db1.t1; +i f1 +1 one +2 two +3 three +4 four +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-relay-bin.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +mysqld-relay-bin.000001 # Rotate # # mysqld-relay-bin.000002;pos=4 +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +mysqld-relay-bin.000002 # Rotate # # master-bin.000001;pos=POS +mysqld-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +mysqld-relay-bin.000002 # Gtid_list # # [] +mysqld-relay-bin.000002 # Binlog_checkpoint # # master-bin.000001 +mysqld-relay-bin.000002 # Gtid # # GTID #-#-# +mysqld-relay-bin.000002 # Query # # drop database if exists db2 +mysqld-relay-bin.000002 # Gtid # # GTID #-#-# +mysqld-relay-bin.000002 # Query # # create database db2 +mysqld-relay-bin.000002 # Gtid # # GTID #-#-# +mysqld-relay-bin.000002 # Query # # use `db2`; create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB +mysqld-relay-bin.000002 # Gtid # # BEGIN GTID #-#-# +mysqld-relay-bin.000002 # Intvar # # INSERT_ID=1 +mysqld-relay-bin.000002 # Query # # use `db2`; insert into t1 (f1) values (1),(2) +mysqld-relay-bin.000002 # Xid # # COMMIT /* XID */ +disconnect slave; +connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3; +stop slave io_thread; +show status like 'Slave_running'; +Variable_name Value +Slave_running OFF +set default_master_connection = 'master1'; +show status like 'Slave_running'; +Variable_name Value +Slave_running ON + +# +# syntax compatible test +# + +# +# show relaylog events +# +SHOW RELAYLOG EVENTS for channel 'master1'; +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-relay-bin-master1.000003 4 Format_desc 3 256 Server ver: Version +mysqld-relay-bin-master1.000003 256 Rotate 1 1358 master-bin.000002;pos=4 +mysqld-relay-bin-master1.000003 304 Rotate 3 366 mysqld-relay-bin-master1.000004;pos=4 + +show slave status for channel 'master1' +Master_Port = 'MYPORT_1' +Relay_Log_File = 'mysqld-relay-bin-master1.000004' +Slave_IO_Running = 'Yes' +Slave_SQL_Running = 'Yes' +Last_Errno = '0' +Last_SQL_Errno = '0' + +# +# stop slave +# +STOP SLAVE for channel 'master1'; + +show slave status for channel 'master1' +Master_Port = 'MYPORT_1' +Relay_Log_File = 'mysqld-relay-bin-master1.000004' +Slave_IO_Running = 'No' +Slave_SQL_Running = 'No' +Last_Errno = '0' +Last_SQL_Errno = '0' + +# +# start slave +# +START SLAVE for channel 'master1'; +include/wait_for_slave_to_start.inc + +show slave status for channel 'master1' +Master_Port = 'MYPORT_1' +Relay_Log_File = 'mysqld-relay-bin-master1.000005' +Slave_IO_Running = 'Yes' +Slave_SQL_Running = 'Yes' +Last_Errno = '0' +Last_SQL_Errno = '0' + +# +# flush relay logs +# +FLUSH RELAY LOGS for channel 'master1'; + +show slave status for channel 'master1' +Master_Port = 'MYPORT_1' +Relay_Log_File = 'mysqld-relay-bin-master1.000006' +Slave_IO_Running = 'Yes' +Slave_SQL_Running = 'Yes' +Last_Errno = '0' +Last_SQL_Errno = '0' + +# +# stop slave +# +STOP SLAVE for channel 'master1'; + +show slave status for channel 'master1' +Master_Port = 'MYPORT_1' +Relay_Log_File = 'mysqld-relay-bin-master1.000006' +Slave_IO_Running = 'No' +Slave_SQL_Running = 'No' +Last_Errno = '0' +Last_SQL_Errno = '0' + +# +# reset slave +# +RESET SLAVE for channel 'master1'; + +show slave status for channel 'master1' +Master_Port = 'MYPORT_1' +Relay_Log_File = '' +Slave_IO_Running = 'No' +Slave_SQL_Running = 'No' +Last_Errno = '0' +Last_SQL_Errno = '0' + +# +# show relaylog events after reset slave +# +SHOW RELAYLOG EVENTS for channel 'master1'; +Log_name Pos Event_type Server_id End_log_pos Info + +# +# check error syntax +# +RESET SLAVE 'master1' for channel 'mmaster2'; +ERROR HY000: Incorrect arguments to CONNECTION_NAME AND FOR CHANNEL CAN NOT BE SPECIFIED AT THE SAME TIME) +STOP SLAVE 'master1' for channel 'master2'; +ERROR HY000: Incorrect arguments to CONNECTION_NAME AND FOR CHANNEL CAN NOT BE SPECIFIED AT THE SAME TIME) +FLUSH RELAY LOGS 'master1' for channel 'master2'; +ERROR HY000: Incorrect arguments to CONNECTION_NAME AND FOR CHANNEL CAN NOT BE SPECIFIED AT THE SAME TIME) +START SLAVE 'master1' for channel 'master2'; +ERROR HY000: Incorrect arguments to CONNECTION_NAME AND FOR CHANNEL CAN NOT BE SPECIFIED AT THE SAME TIME) +SHOW RELAYLOG 'master1' EVENTS for channel 'master2'; +ERROR HY000: Incorrect arguments to CONNECTION_NAME AND FOR CHANNEL CAN NOT BE SPECIFIED AT THE SAME TIME) +SHOW SLAVE 'master1' STATUS for channel 'master2'; +ERROR HY000: Incorrect arguments to CONNECTION_NAME AND FOR CHANNEL CAN NOT BE SPECIFIED AT THE SAME TIME) + +drop database db1; +drop database db2; +include/reset_master_slave.inc +disconnect slave; +connection master1; +drop database db1; +include/reset_master_slave.inc +disconnect master1; +connection master2; +drop database db2; +include/reset_master_slave.inc +disconnect master2; +connection default; +CREATE TABLE channel (channel int); +DROP TABLE channel; diff --git a/mysql-test/suite/multi_source/multisource_for_channel.test b/mysql-test/suite/multi_source/multisource_for_channel.test new file mode 100644 index 00000000000..9b74ea97742 --- /dev/null +++ b/mysql-test/suite/multi_source/multisource_for_channel.test @@ -0,0 +1,429 @@ +# +# This is the basic test of support mysql syntax "for channel" used for +# multi-source replication +# +# Test basic replication functionality in multi-source setup +# + +--source include/not_embedded.inc +--source include/have_innodb.inc +--source include/have_perfschema.inc +--source include/binlog_start_pos.inc +--let $rpl_server_count= 0 + +RESET MASTER; + +--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3) + +# MDEV-3984: crash/read of freed memory when changing master with named connection +# This fails after adding the new master 'abc1', check we do not free twice. +--error ER_RELAY_LOG_INIT +change master to relay_log_file='' for channel 'abc1'; +# This fails before adding the new master, check that we do free it. +--error ER_WRONG_ARGUMENTS +change master to master_host='' for channel 'abc2'; + +# Start replication from the first master + +--replace_result $SERVER_MYPORT_1 MYPORT_1 +eval change master to +master_port=$SERVER_MYPORT_1, +master_host='127.0.0.1', +master_user='root' +for channel 'master1'; + +start slave for channel 'master1'; +set default_master_connection = 'master1'; +--source include/wait_for_slave_to_start.inc + +--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1) +--save_master_pos + +--connection slave +--sync_with_master 0,'master1' + +# Here and further: add an extra check on SQL thread status +# as the normal sync is not always enough +--source include/wait_for_sql_thread_read_all.inc + +# each of the 3 commands should produce +# 'master1' status + +let $wait_for_all= 1; +let $show_statement= SHOW ALL SLAVES STATUS; +let $field= Slave_IO_State; +let $condition= = 'Waiting for master to send event'; +--source include/wait_show_condition.inc + +--echo # +--echo # Checking SHOW SLAVE 'master1' STATUS +--echo # +--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno +--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ +--let $slave_name= 'master1' +--let for_channel= 1 +--source include/show_slave_status.inc +--let $slave_name= +--let for_channel= + +--echo # +--echo # Checking SHOW SLAVE STATUS +--echo # +--source include/show_slave_status.inc + +--echo # +--echo # Checking SHOW ALL SLAVES STATUS +--echo # +--let $all_slaves_status= 1 +--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period +--source include/show_slave_status.inc +--let $all_slaves_status= +--echo # + + +# Check that replication actually works + +--connection master1 + +--disable_warnings +drop database if exists db1; +--enable_warnings +create database db1; +use db1; +create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM; +insert into t1 (f1) values ('one'),('two'); +--save_master_pos + +--connection slave +--sync_with_master 0,'master1' + +--sorted_result +select * from db1.t1; + +--let $datadir = `SELECT @@datadir` + +--echo # List of relay log files in the datadir +--list_files $datadir mysqld-relay-bin-master1.* + +# Check that relay logs are recognizable + +let binlog_start=4; +let binlog_file=; +source include/show_relaylog_events.inc; +let binlog_file= mysqld-relay-bin-master1.000002; +source include/show_relaylog_events.inc; + +# Try to configure connection with the same name again, +# should get an error because the slave is running + +--replace_result $SERVER_MYPORT_2 MYPORT_2 +--error ER_SLAVE_MUST_STOP +eval change master to +master_port=$SERVER_MYPORT_2, +master_host='127.0.0.1', +master_user='root' +for channel 'master1'; + +# Try to configure using the default connection name +# (which is 'master1' at the moment), +# again, should get an error + +--replace_result $SERVER_MYPORT_2 MYPORT_2 +--error ER_SLAVE_MUST_STOP +eval change master to +master_port=$SERVER_MYPORT_2, +master_host='127.0.0.1', +master_user='root'; + +# Try to configure a connection with the same master +# using a different name, should get a conflict + +--replace_result $SERVER_MYPORT_1 MYPORT_1 +--error ER_CONNECTION_ALREADY_EXISTS +eval change master to +master_port=$SERVER_MYPORT_1, +master_host='127.0.0.1', +master_user='root' for channel 'master2'; + + +# Set up a proper 'default' connection to master2 + +set default_master_connection = ''; + +--replace_result $SERVER_MYPORT_2 MYPORT_2 +eval change master to +master_port=$SERVER_MYPORT_2, +master_host='127.0.0.1', +master_user='root'; + +start slave; +--source include/wait_for_slave_to_start.inc + +--source include/wait_for_sql_thread_read_all.inc + +# See both connections in the same status output + +let $wait_for_all= 1; +let $show_statement= SHOW ALL SLAVES STATUS; +let $field= Slave_IO_State; +let $condition= = 'Waiting for master to send event'; +--source include/wait_show_condition.inc + +--echo # +--echo # Checking SHOW ALL SLAVES STATUS +--echo # +--let $all_slaves_status= 1 +--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period +--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /$SERVER_MYPORT_2/MYPORT_2/ +--source include/show_slave_status.inc +--let $all_slaves_status= +--echo # + +# Check that replication from two servers actually works + +--connection master1 + +insert into t1 (f1) values ('three'); +--save_master_pos + +--connect (master2,127.0.0.1,root,,,$SERVER_MYPORT_2) + +--disable_warnings +drop database if exists db2; +--enable_warnings +create database db2; +use db2; +create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB; +begin; +insert into t1 (f1) values (1),(2); + +--connection slave +--sync_with_master 0,'master1' + +--connection master2 +--save_master_pos + +--connection slave +--sync_with_master 0 +--sorted_result +select * from db1.t1; +select * from db2.t1; + +--connection master2 +commit; +--save_master_pos + +--connection slave +--sync_with_master 0 +--sorted_result +select * from db2.t1; + +# Flush and purge logs on one master, +# make sure slaves don't get confused + +--connection master1 +flush logs; +--source include/wait_for_binlog_checkpoint.inc +--save_master_pos +--connection slave +--sync_with_master 0, 'master1' + +--connection master1 +purge binary logs to 'master-bin.000002'; +# Additional events: 43 (Gtid_list) + 2 x 44 (Binlog_checkpoint) = 131 +let filesize=`select $binlog_start_pos+131`; +--replace_result $filesize filesize +show binary logs; +insert into t1 (f1) values ('four'); +create table db1.t3 (f1 int) engine=InnoDB; +--save_master_pos + +--connection slave +--sync_with_master 0,'master1' + +--source include/wait_for_sql_thread_read_all.inc + +let $wait_for_all= 1; +let $show_statement= SHOW ALL SLAVES STATUS; +let $field= Slave_IO_State; +let $condition= = 'Waiting for master to send event'; +--source include/wait_show_condition.inc + +--echo # +--echo # Checking SHOW ALL SLAVES STATUS +--echo # +--let $all_slaves_status= 1 +--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period +--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /$SERVER_MYPORT_2/MYPORT_2/ +--source include/show_slave_status.inc +--let $all_slaves_status= +--echo # + +--echo # +--echo # MDEV:16437: merge 5.7 P_S replication instrumentation and tables +--echo # +--replace_column 2 # +query_vertical SELECT * FROM performance_schema.replication_applier_status_by_coordinator; + +--sorted_result +select * from db1.t1; + +# This should show relay log events for the default master +# (the one with the empty name) +let binlog_file=; +source include/show_relaylog_events.inc; +let binlog_file= mysqld-relay-bin.000002; +source include/show_relaylog_events.inc; + +# Make sure we don't lose control over replication connections +# after reconnecting to the slave + +--disconnect slave +--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3) + +stop slave io_thread; +show status like 'Slave_running'; +set default_master_connection = 'master1'; +show status like 'Slave_running'; + +--echo +--echo # +--echo # syntax compatible test +--echo # +--echo +--echo # +--echo # show relaylog events +--echo # +--replace_regex /Server ver:.*/Server ver: Version/ +SHOW RELAYLOG EVENTS for channel 'master1'; + +--echo +--echo show slave status for channel 'master1' +--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno +--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ +--let $slave_name= 'master1' +--let $for_channel= 1 +--source include/show_slave_status.inc + +--echo +--echo # +--echo # stop slave +--echo # +STOP SLAVE for channel 'master1'; + +--echo +--echo show slave status for channel 'master1' +--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno +--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ +--let $slave_name= 'master1' +--let $for_channel= 1 +--source include/show_slave_status.inc + +--echo +--echo # +--echo # start slave +--echo # +START SLAVE for channel 'master1'; +--source include/wait_for_slave_to_start.inc + +--echo +--echo show slave status for channel 'master1' +--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno +--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /Preparing/Yes/ +--let $slave_name= 'master1' +--let $for_channel= 1 +--source include/show_slave_status.inc + +--echo +--echo # +--echo # flush relay logs +--echo # +FLUSH RELAY LOGS for channel 'master1'; +--source include/wait_for_sql_thread_read_all.inc + +--echo +--echo show slave status for channel 'master1' +--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno +--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ +--let $slave_name= 'master1' +--let $for_channel= 1 +--source include/show_slave_status.inc + +--echo +--echo # +--echo # stop slave +--echo # +STOP SLAVE for channel 'master1'; + +--echo +--echo show slave status for channel 'master1' +--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno +--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ +--let $slave_name= 'master1' +--let $for_channel= 1 +--source include/show_slave_status.inc + +--echo +--echo # +--echo # reset slave +--echo # +RESET SLAVE for channel 'master1'; + +--echo +--echo show slave status for channel 'master1' +--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno +--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ +--let $slave_name= 'master1' +--let $for_channel= 1 +--source include/show_slave_status.inc + +--echo +--echo # +--echo # show relaylog events after reset slave +--echo # +SHOW RELAYLOG EVENTS for channel 'master1'; + +--let $slave_name= +--let for_channel= + +--echo +--echo # +--echo # check error syntax +--echo # +--error ER_WRONG_ARGUMENTS +RESET SLAVE 'master1' for channel 'mmaster2'; +--error ER_WRONG_ARGUMENTS +STOP SLAVE 'master1' for channel 'master2'; +--error ER_WRONG_ARGUMENTS +FLUSH RELAY LOGS 'master1' for channel 'master2'; +--error ER_WRONG_ARGUMENTS +START SLAVE 'master1' for channel 'master2'; +--error ER_WRONG_ARGUMENTS +SHOW RELAYLOG 'master1' EVENTS for channel 'master2'; +--error ER_WRONG_ARGUMENTS +SHOW SLAVE 'master1' STATUS for channel 'master2'; + +--echo +# Cleanup +drop database db1; +drop database db2; + +--source include/reset_master_slave.inc +--disconnect slave + +--connection master1 +drop database db1; +--source include/reset_master_slave.inc +--disconnect master1 + +--connection master2 +drop database db2; +--source include/reset_master_slave.inc +--disconnect master2 + +# +# Check channel as a keyword +# +--connection default +CREATE TABLE channel (channel int); +DROP TABLE channel; diff --git a/mysql-test/suite/perfschema/r/max_program_zero.result b/mysql-test/suite/perfschema/r/max_program_zero.result index 34d27885ad9..50e2824a105 100644 --- a/mysql-test/suite/perfschema/r/max_program_zero.result +++ b/mysql-test/suite/perfschema/r/max_program_zero.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 1 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/ortho_iter.result b/mysql-test/suite/perfschema/r/ortho_iter.result index 9489c1049e5..4224c3e520d 100644 --- a/mysql-test/suite/perfschema/r/ortho_iter.result +++ b/mysql-test/suite/perfschema/r/ortho_iter.result @@ -255,7 +255,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/privilege_table_io.result b/mysql-test/suite/perfschema/r/privilege_table_io.result index 94cc2b33b49..ab0d18e3227 100644 --- a/mysql-test/suite/perfschema/r/privilege_table_io.result +++ b/mysql-test/suite/perfschema/r/privilege_table_io.result @@ -57,7 +57,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_disable_idle.result b/mysql-test/suite/perfschema/r/start_server_disable_idle.result index bfc49fd3480..fda05bf6df5 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_idle.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_idle.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_disable_stages.result b/mysql-test/suite/perfschema/r/start_server_disable_stages.result index e9f20398467..7db242f237f 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_stages.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_stages.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_disable_statements.result b/mysql-test/suite/perfschema/r/start_server_disable_statements.result index ffb45f4f55f..31ddb4eb3cd 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_statements.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_statements.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_disable_transactions.result b/mysql-test/suite/perfschema/r/start_server_disable_transactions.result index e271d5a10e6..2a2d42f4d51 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_transactions.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_transactions.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_disable_waits.result b/mysql-test/suite/perfschema/r/start_server_disable_waits.result index 833da22583e..2115c747755 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_waits.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_waits.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_innodb.result b/mysql-test/suite/perfschema/r/start_server_innodb.result index e3ff0f514a7..25b8a7b9c1f 100644 --- a/mysql-test/suite/perfschema/r/start_server_innodb.result +++ b/mysql-test/suite/perfschema/r/start_server_innodb.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_low_digest_sql_length.result b/mysql-test/suite/perfschema/r/start_server_low_digest_sql_length.result index 91ae3cb40e1..864374be5af 100644 --- a/mysql-test/suite/perfschema/r/start_server_low_digest_sql_length.result +++ b/mysql-test/suite/perfschema/r/start_server_low_digest_sql_length.result @@ -8,5 +8,5 @@ SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1 #################################### SELECT event_name, digest, digest_text, sql_text FROM events_statements_history_long; event_name digest digest_text sql_text -statement/sql/select cf4e66f3ef1e0c9905538c220053cbda SELECT ? + ? + SELECT ... -statement/sql/truncate f874a3c85ab326928c042dbd544916f9 TRUNCATE TABLE truncat... +statement/sql/select ca9181d6d668396d467dd974f58a9402 SELECT ? + ? + SELECT ... +statement/sql/truncate 460cb5329baea0e4242059cfda01d1d7 TRUNCATE TABLE truncat... diff --git a/mysql-test/suite/perfschema/r/start_server_low_index.result b/mysql-test/suite/perfschema/r/start_server_low_index.result index ffdf9d65b87..b34f86da89f 100644 --- a/mysql-test/suite/perfschema/r/start_server_low_index.result +++ b/mysql-test/suite/perfschema/r/start_server_low_index.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_low_table_lock.result b/mysql-test/suite/perfschema/r/start_server_low_table_lock.result index dbb404f6129..e8bf9f48da8 100644 --- a/mysql-test/suite/perfschema/r/start_server_low_table_lock.result +++ b/mysql-test/suite/perfschema/r/start_server_low_table_lock.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_account.result b/mysql-test/suite/perfschema/r/start_server_no_account.result index f92b0e6bec6..021ff9f9e3d 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_account.result +++ b/mysql-test/suite/perfschema/r/start_server_no_account.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result index fefad55c209..0a7f1c601ef 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result index 0c2f65f6ac9..de4ff2f5a72 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_class.result b/mysql-test/suite/perfschema/r/start_server_no_file_class.result index c3f06b53425..997220d3169 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_file_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_file_class.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result index fd39807d567..de81943afe8 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_host.result b/mysql-test/suite/perfschema/r/start_server_no_host.result index 43111c5ec40..ce156302b22 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_host.result +++ b/mysql-test/suite/perfschema/r/start_server_no_host.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_index.result b/mysql-test/suite/perfschema/r/start_server_no_index.result index 15d1184bcbe..d46095841c2 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_index.result +++ b/mysql-test/suite/perfschema/r/start_server_no_index.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_mdl.result b/mysql-test/suite/perfschema/r/start_server_no_mdl.result index b8de90453ce..c1f7e656dc6 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_mdl.result +++ b/mysql-test/suite/perfschema/r/start_server_no_mdl.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_memory_class.result b/mysql-test/suite/perfschema/r/start_server_no_memory_class.result index 60066264c90..94c8a7da85a 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_memory_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_memory_class.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result index 3353b46bbcb..e44307fdbe6 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result index d41da361733..6647def50c1 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result b/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result index 4919de6bb6c..9b5ad931858 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result +++ b/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result index 02a119bdc68..fdd3fe48bf3 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result index ead01ce2d0e..09faadaa4ce 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result index a99f1c0f9be..2d93be52186 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result +++ b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result index 7c148889412..e9eff67712f 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result +++ b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result index dec0680c511..f5b00a114dd 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 0 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result index 20adf1a9f64..d1b3e14d349 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 0 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result index 044f9475041..136c54885bf 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 0 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result index 350f2c6637d..3e2d7acf4ec 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result +++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result index d2d7063c32f..5db6987834b 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result +++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result index 8bcb3c56a00..69a69986a72 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result +++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result index 2a2bf5d3f7c..2f68483cfae 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result +++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result index ec6e40acc00..3d131f1a2e0 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result +++ b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 0 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result index b3f1e4cbcf2..95f8f226c41 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 0 diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_lock.result b/mysql-test/suite/perfschema/r/start_server_no_table_lock.result index baf9f761358..b54d6c762e1 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_table_lock.result +++ b/mysql-test/suite/perfschema/r/start_server_no_table_lock.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result index cd204f3d811..9182677d8b8 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result index d083484cd7c..ff90c471599 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result b/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result index f5a12e5473d..4535bcd02ed 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result +++ b/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result index 76ae9d5fa4e..f3eefb98a43 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result +++ b/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_user.result b/mysql-test/suite/perfschema/r/start_server_no_user.result index 4bd472a22a9..9ca79837845 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_user.result +++ b/mysql-test/suite/perfschema/r/start_server_no_user.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result index f59b156ce1e..ee22d5b5bed 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result +++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result index cc70572c7ef..adbad8d166f 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result +++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_off.result b/mysql-test/suite/perfschema/r/start_server_off.result index a53d591938c..022f7d1096e 100644 --- a/mysql-test/suite/perfschema/r/start_server_off.result +++ b/mysql-test/suite/perfschema/r/start_server_off.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_on.result b/mysql-test/suite/perfschema/r/start_server_on.result index e3ff0f514a7..25b8a7b9c1f 100644 --- a/mysql-test/suite/perfschema/r/start_server_on.result +++ b/mysql-test/suite/perfschema/r/start_server_on.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/start_server_variables.result b/mysql-test/suite/perfschema/r/start_server_variables.result index 7d1d1e05375..65d3a7b55b5 100644 --- a/mysql-test/suite/perfschema/r/start_server_variables.result +++ b/mysql-test/suite/perfschema/r/start_server_variables.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 10 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/perfschema/r/statement_program_lost_inst.result b/mysql-test/suite/perfschema/r/statement_program_lost_inst.result index 186d2c36316..1ad238128f4 100644 --- a/mysql-test/suite/perfschema/r/statement_program_lost_inst.result +++ b/mysql-test/suite/perfschema/r/statement_program_lost_inst.result @@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_sql_text_length 1024 performance_schema_max_stage_classes 160 -performance_schema_max_statement_classes 222 +performance_schema_max_statement_classes 221 performance_schema_max_statement_stack 2 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 diff --git a/mysql-test/suite/roles/definer.result b/mysql-test/suite/roles/definer.result index ecfa8113220..66c455625aa 100644 --- a/mysql-test/suite/roles/definer.result +++ b/mysql-test/suite/roles/definer.result @@ -326,7 +326,9 @@ CREATE TABLE `t1` ( `c` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t1` VALUES (1,10,100),(2,20,200); +INSERT INTO `t1` VALUES +(1,10,100), +(2,20,200); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t2` ( @@ -335,7 +337,8 @@ CREATE TABLE `t2` ( `c` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t2` VALUES (2,20,200); +INSERT INTO `t2` VALUES +(2,20,200); /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; diff --git a/mysql-test/suite/sql_sequence/mysqldump.result b/mysql-test/suite/sql_sequence/mysqldump.result index fb023cc5e36..7da48a917ca 100644 --- a/mysql-test/suite/sql_sequence/mysqldump.result +++ b/mysql-test/suite/sql_sequence/mysqldump.result @@ -14,7 +14,9 @@ CREATE TABLE `t1` ( KEY `a` (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1024; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t1` VALUES (1),(2); +INSERT INTO `t1` VALUES +(1), +(2); # dump by tables order 1 CREATE SEQUENCE `a1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=Aria; SELECT SETVAL(`a1`, 1, 0); @@ -27,7 +29,9 @@ CREATE TABLE `t1` ( KEY `a` (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1024; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t1` VALUES (1),(2); +INSERT INTO `t1` VALUES +(1), +(2); # dump by tables order 2 CREATE SEQUENCE `a1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=Aria; SELECT SETVAL(`a1`, 1, 0); @@ -40,7 +44,9 @@ CREATE TABLE `t1` ( KEY `a` (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1024; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t1` VALUES (1),(2); +INSERT INTO `t1` VALUES +(1), +(2); # dump by tables only tables /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -49,7 +55,9 @@ CREATE TABLE `t1` ( KEY `a` (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1024; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `t1` VALUES (1),(2); +INSERT INTO `t1` VALUES +(1), +(2); # dump by tables only sequences CREATE SEQUENCE `a1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=Aria; SELECT SETVAL(`a1`, 1, 0); diff --git a/mysql-test/suite/sys_vars/r/default_tmp_storage_engine_rocksdb.result b/mysql-test/suite/sys_vars/r/default_tmp_storage_engine_rocksdb.result new file mode 100644 index 00000000000..a93be903deb --- /dev/null +++ b/mysql-test/suite/sys_vars/r/default_tmp_storage_engine_rocksdb.result @@ -0,0 +1,51 @@ +# +# MDEV-12914: Engine for temporary tables which are implicitly +# created as RocksDB is substitued siliently with MyIsam +SET default_tmp_storage_engine = engine_doesnt_exist; +ERROR 42000: Unknown storage engine 'engine_doesnt_exist' +SET default_tmp_storage_engine = rocksdb; +ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY' +SET default_tmp_storage_engine = CONCAT('rocks','db'); +ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY' +CREATE TABLE t1 (i int) ENGINE = RocksDB; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) DEFAULT NULL +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 +CREATE TEMPORARY TABLE t2 LIKE t1; +ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY' +DROP TABLE t1; +SET default_storage_engine = DEFAULT; +SET default_tmp_storage_engine = DEFAULT; +CREATE TABLE t1 (t int); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `t` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +CREATE TEMPORARY TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TEMPORARY TABLE `t2` ( + `t` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1, t2; +SET default_storage_engine = rocksdb; +SET default_tmp_storage_engine = default; +CREATE TABLE t1 (t int); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `t` int(11) DEFAULT NULL +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 +CREATE TEMPORARY TABLE t2 LIKE t1; +ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY' +CREATE TEMPORARY TABLE t2 (t int); +ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY' +SET default_tmp_storage_engine = aria; +CREATE TEMPORARY TABLE t2 (t int); +DROP TABLE t2; +CREATE TEMPORARY TABLE t2 LIKE t1; +ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY' +DROP TABLE t1; diff --git a/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result b/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result index 2cb697acb6d..68d3d40091a 100644 --- a/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result @@ -6,9 +6,27 @@ SELECT COUNT(@@innodb_purge_threads); COUNT(@@innodb_purge_threads) 1 1 Expected +SET @save_threads = @@GLOBAL.innodb_purge_threads; +SET @@GLOBAL.innodb_purge_threads=-1; +Warnings: +Warning 1292 Truncated incorrect innodb_purge_threads value: '-1' +SELECT @@GLOBAL.innodb_purge_threads; +@@GLOBAL.innodb_purge_threads +1 +SET @@GLOBAL.innodb_purge_threads=0; +Warnings: +Warning 1292 Truncated incorrect innodb_purge_threads value: '0' +SELECT @@GLOBAL.innodb_purge_threads; +@@GLOBAL.innodb_purge_threads +1 +SET @@GLOBAL.innodb_purge_threads=33; +Warnings: +Warning 1292 Truncated incorrect innodb_purge_threads value: '33' +SELECT @@GLOBAL.innodb_purge_threads; +@@GLOBAL.innodb_purge_threads +32 SET @@GLOBAL.innodb_purge_threads=1; -ERROR HY000: Variable 'innodb_purge_threads' is a read only variable -Expected error 'Read-only variable' +SET @@GLOBAL.innodb_purge_threads=32; SELECT innodb_purge_threads = @@SESSION.innodb_purge_threads; ERROR 42S22: Unknown column 'innodb_purge_threads' in 'field list' Expected error 'Read-only variable' @@ -38,4 +56,5 @@ SELECT VARIABLE_NAME, VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'innodb_purge_threads'; VARIABLE_NAME VARIABLE_VALUE -INNODB_PURGE_THREADS 4 +INNODB_PURGE_THREADS 32 +SET GLOBAL innodb_purge_threads = @save_threads; diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff index b0f0b46ded7..65937a4f358 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff @@ -348,12 +348,3 @@ NUMERIC_BLOCK_SIZE 0 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1765,7 +1765,7 @@ - SESSION_VALUE NULL - DEFAULT_VALUE 0 - VARIABLE_SCOPE GLOBAL --VARIABLE_TYPE BIGINT UNSIGNED -+VARIABLE_TYPE INT UNSIGNED - VARIABLE_COMMENT Number of undo tablespaces to use. - NUMERIC_MIN_VALUE 0 - NUMERIC_MAX_VALUE 127 diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index 33df36dfb3b..068ef4da079 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -1387,7 +1387,7 @@ NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 32 NUMERIC_BLOCK_SIZE 0 ENUM_VALUE_LIST NULL -READ_ONLY YES +READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_RANDOM_READ_AHEAD SESSION_VALUE NULL @@ -1741,7 +1741,7 @@ VARIABLE_NAME INNODB_UNDO_TABLESPACES SESSION_VALUE NULL DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL -VARIABLE_TYPE BIGINT UNSIGNED +VARIABLE_TYPE INT UNSIGNED VARIABLE_COMMENT Number of undo tablespaces to use. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 127 diff --git a/mysql-test/suite/sys_vars/r/sysvars_star.result b/mysql-test/suite/sys_vars/r/sysvars_star.result index eede5c17b36..54af0aa3014 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_star.result +++ b/mysql-test/suite/sys_vars/r/sysvars_star.result @@ -60,7 +60,7 @@ VARIABLE_NAME PLUGIN_MATURITY SESSION_VALUE NULL GLOBAL_VALUE alpha GLOBAL_VALUE_ORIGIN CONFIG -DEFAULT_VALUE gamma +DEFAULT_VALUE beta VARIABLE_SCOPE GLOBAL VARIABLE_TYPE ENUM VARIABLE_COMMENT The lowest desirable plugin maturity. Plugins less mature than that will not be installed or loaded diff --git a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result index 6bea1a88caa..bc1f49195b5 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result +++ b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result @@ -526,21 +526,6 @@ ENUM_VALUE_LIST NONE,ALL,ALL_KILL READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL GLOBAL_VALUE_PATH NULL -VARIABLE_NAME WSREP_REPLICATE_MYISAM -SESSION_VALUE NULL -GLOBAL_VALUE OFF -GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE OFF -VARIABLE_SCOPE GLOBAL -VARIABLE_TYPE BOOLEAN -VARIABLE_COMMENT To enable myisam replication -NUMERIC_MIN_VALUE NULL -NUMERIC_MAX_VALUE NULL -NUMERIC_BLOCK_SIZE NULL -ENUM_VALUE_LIST OFF,ON -READ_ONLY NO -COMMAND_LINE_ARGUMENT OPTIONAL -GLOBAL_VALUE_PATH NULL VARIABLE_NAME WSREP_RESTART_SLAVE SESSION_VALUE NULL GLOBAL_VALUE OFF @@ -721,21 +706,6 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED GLOBAL_VALUE_PATH NULL -VARIABLE_NAME WSREP_STRICT_DDL -SESSION_VALUE NULL -GLOBAL_VALUE OFF -GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE OFF -VARIABLE_SCOPE GLOBAL -VARIABLE_TYPE BOOLEAN -VARIABLE_COMMENT If set, reject DDL on affected tables not supporting Galera replication -NUMERIC_MIN_VALUE NULL -NUMERIC_MAX_VALUE NULL -NUMERIC_BLOCK_SIZE NULL -ENUM_VALUE_LIST OFF,ON -READ_ONLY NO -COMMAND_LINE_ARGUMENT OPTIONAL -GLOBAL_VALUE_PATH NULL VARIABLE_NAME WSREP_SYNC_WAIT SESSION_VALUE 0 GLOBAL_VALUE 0 diff --git a/mysql-test/suite/sys_vars/t/default_tmp_storage_engine_rocksdb.test b/mysql-test/suite/sys_vars/t/default_tmp_storage_engine_rocksdb.test new file mode 100644 index 00000000000..a3436059e39 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/default_tmp_storage_engine_rocksdb.test @@ -0,0 +1,52 @@ +--echo # +--echo # MDEV-12914: Engine for temporary tables which are implicitly +--echo # created as RocksDB is substitued siliently with MyIsam + +--source include/have_rocksdb.inc +--source include/not_embedded.inc +--error ER_UNKNOWN_STORAGE_ENGINE +SET default_tmp_storage_engine = engine_doesnt_exist; +--error ER_ILLEGAL_HA_CREATE_OPTION +SET default_tmp_storage_engine = rocksdb; +--error ER_ILLEGAL_HA_CREATE_OPTION +SET default_tmp_storage_engine = CONCAT('rocks','db'); + +CREATE TABLE t1 (i int) ENGINE = RocksDB; +SHOW CREATE TABLE t1; + +--error ER_ILLEGAL_HA_CREATE_OPTION +CREATE TEMPORARY TABLE t2 LIKE t1; + +DROP TABLE t1; + +SET default_storage_engine = DEFAULT; +SET default_tmp_storage_engine = DEFAULT; + +CREATE TABLE t1 (t int); +SHOW CREATE TABLE t1; +CREATE TEMPORARY TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; + +DROP TABLE t1, t2; + +SET default_storage_engine = rocksdb; +# setting default or null for tmp SE should use default SE +SET default_tmp_storage_engine = default; + +CREATE TABLE t1 (t int); +SHOW CREATE TABLE t1; + +--error ER_ILLEGAL_HA_CREATE_OPTION +CREATE TEMPORARY TABLE t2 LIKE t1; + +--error ER_ILLEGAL_HA_CREATE_OPTION +CREATE TEMPORARY TABLE t2 (t int); + +SET default_tmp_storage_engine = aria; +CREATE TEMPORARY TABLE t2 (t int); +DROP TABLE t2; + +--error ER_ILLEGAL_HA_CREATE_OPTION +CREATE TEMPORARY TABLE t2 LIKE t1; + +DROP TABLE t1; diff --git a/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test b/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test index 4d039601e40..1156fa40a4a 100644 --- a/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test @@ -11,9 +11,17 @@ SELECT COUNT(@@GLOBAL.innodb_purge_threads); SELECT COUNT(@@innodb_purge_threads); --echo 1 Expected ---error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @save_threads = @@GLOBAL.innodb_purge_threads; + +SET @@GLOBAL.innodb_purge_threads=-1; +SELECT @@GLOBAL.innodb_purge_threads; +SET @@GLOBAL.innodb_purge_threads=0; +SELECT @@GLOBAL.innodb_purge_threads; +SET @@GLOBAL.innodb_purge_threads=33; +SELECT @@GLOBAL.innodb_purge_threads; + SET @@GLOBAL.innodb_purge_threads=1; ---echo Expected error 'Read-only variable' +SET @@GLOBAL.innodb_purge_threads=32; --Error ER_BAD_FIELD_ERROR SELECT innodb_purge_threads = @@SESSION.innodb_purge_threads; @@ -51,3 +59,5 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'innodb_purge_threads'; --enable_warnings + +SET GLOBAL innodb_purge_threads = @save_threads; diff --git a/mysql-test/suite/sysschema/r/pr_diagnostics.result b/mysql-test/suite/sysschema/r/pr_diagnostics.result index d07295bdbe9..90021f636d8 100644 --- a/mysql-test/suite/sysschema/r/pr_diagnostics.result +++ b/mysql-test/suite/sysschema/r/pr_diagnostics.result @@ -6,8 +6,6 @@ SET @sys.debug = 'OFF', @sys.diagnostics.allow_i_s_tables = 'OFF', @sys.diagnostics.include_raw = 'OFF'; CALL sys.diagnostics(0, 0, 'full'); -summary -Disabled 1 thread ERROR 45000: in_max_runtime must be greater than 0 CALL sys.diagnostics(2, 0, 'full'); ERROR 45000: in_interval must be greater than 0 diff --git a/mysql-test/suite/sysschema/t/pr_diagnostics.test b/mysql-test/suite/sysschema/t/pr_diagnostics.test index 40ea90005a9..01825a1274e 100644 --- a/mysql-test/suite/sysschema/t/pr_diagnostics.test +++ b/mysql-test/suite/sysschema/t/pr_diagnostics.test @@ -19,6 +19,7 @@ SET @sys.debug = 'ON', @sys.diagnostics.allow_i_s_tables = 'ON', @sys.diagnostics.include_raw = 'ON'; +--error ER_ILLEGAL_HA_CREATE_OPTION CALL sys.diagnostics(4, 2, 'full'); SET @sys.debug = 'OFF', diff --git a/mysql-test/suite/versioning/r/data.result b/mysql-test/suite/versioning/r/data.result new file mode 100644 index 00000000000..873f7297ad5 --- /dev/null +++ b/mysql-test/suite/versioning/r/data.result @@ -0,0 +1,59 @@ +# +# MDEV-16355 Add option for mysqldump to read data as of specific timestamp from system-versioned tables +# +create or replace table t1 (x int) with system versioning; +set timestamp=unix_timestamp('1990-01-01 00:00'); +insert t1 (x) values (1),(2),(3); +set timestamp=unix_timestamp('1990-08-03 00:00'); +delete from t1 where x=1; +set timestamp=unix_timestamp('1991-01-02 00:00'); +delete from t1 where x=2; +set timestamp=default; +#MYSQL_DUMP --compact test +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING; +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO `t1` VALUES +(3); +#MYSQL_DUMP --compact --as-of="1990-01-02 00:00" test +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING; +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO `t1` VALUES +(1), +(2), +(3); +#MYSQL_DUMP --compact --as-of="1990-08-02 00:00" --databases test + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `test`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING; +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO `t1` VALUES +(1), +(2), +(3); +#MYSQL_DUMP --compact --as-of="1990-08-04 00:00" test t1 +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t1` ( + `x` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING; +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO `t1` VALUES +(2), +(3); +#MYSQL_DUMP --compact --as-of="1990-08-04 00:00' where 'abc" test 2>&1 +mysqldump: Incorrect DATETIME value: '1990-08-04 00:00' where 'abc' +drop tables t1; diff --git a/mysql-test/suite/versioning/t/data.test b/mysql-test/suite/versioning/t/data.test new file mode 100644 index 00000000000..4046ec609dd --- /dev/null +++ b/mysql-test/suite/versioning/t/data.test @@ -0,0 +1,32 @@ +--source include/not_embedded.inc +--source suite/versioning/common.inc + +--echo # +--echo # MDEV-16355 Add option for mysqldump to read data as of specific timestamp from system-versioned tables +--echo # +create or replace table t1 (x int) with system versioning; +set timestamp=unix_timestamp('1990-01-01 00:00'); +insert t1 (x) values (1),(2),(3); +set timestamp=unix_timestamp('1990-08-03 00:00'); +delete from t1 where x=1; +set timestamp=unix_timestamp('1991-01-02 00:00'); +delete from t1 where x=2; +set timestamp=default; + +--echo #MYSQL_DUMP --compact test +--exec $MYSQL_DUMP --compact test +--echo #MYSQL_DUMP --compact --as-of="1990-01-02 00:00" test +--exec $MYSQL_DUMP --compact --as-of="1990-01-02 00:00" test +--echo #MYSQL_DUMP --compact --as-of="1990-08-02 00:00" --databases test +--exec $MYSQL_DUMP --compact --as-of="1990-08-02 00:00" --databases test +--echo #MYSQL_DUMP --compact --as-of="1990-08-04 00:00" test t1 +--exec $MYSQL_DUMP --compact --as-of="1990-08-04 00:00" test t1 +## Forged query protection +--echo #MYSQL_DUMP --compact --as-of="1990-08-04 00:00' where 'abc" test 2>&1 +--replace_result mysqldump.exe mysqldump +--error 1 +--exec $MYSQL_DUMP --compact --as-of="1990-08-04 00:00' where 'abc" test 2>&1 + +drop tables t1; + +--source suite/versioning/common_finish.inc diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result index 82c480917f1..8e1af35fd62 100644 --- a/mysql-test/suite/wsrep/r/variables.result +++ b/mysql-test/suite/wsrep/r/variables.result @@ -105,8 +105,6 @@ WSREP_FORCED_BINLOG_FORMAT WSREP_GTID_DOMAIN_ID WSREP_GTID_MODE WSREP_GTID_SEQ_NO -WSREP_MODE -WSREP_STRICT_DDL WSREP_IGNORE_APPLY_ERRORS WSREP_LOAD_DATA_SPLITTING WSREP_LOG_CONFLICTS @@ -125,7 +123,6 @@ WSREP_PROVIDER WSREP_PROVIDER_OPTIONS WSREP_RECOVER WSREP_REJECT_QUERIES -WSREP_REPLICATE_MYISAM WSREP_RESTART_SLAVE WSREP_RETRY_AUTOCOMMIT WSREP_SLAVE_FK_CHECKS @@ -138,7 +135,6 @@ WSREP_SST_DONOR_REJECTS_QUERIES WSREP_SST_METHOD WSREP_SST_RECEIVE_ADDRESS WSREP_START_POSITION -WSREP_STRICT_DDL WSREP_SYNC_WAIT WSREP_TRX_FRAGMENT_SIZE WSREP_TRX_FRAGMENT_UNIT diff --git a/mysql-test/suite/wsrep/r/variables_debug.result b/mysql-test/suite/wsrep/r/variables_debug.result index fe2bffb3f08..0690f540a37 100644 --- a/mysql-test/suite/wsrep/r/variables_debug.result +++ b/mysql-test/suite/wsrep/r/variables_debug.result @@ -105,11 +105,13 @@ WSREP_DRUPAL_282555_WORKAROUND WSREP_FORCED_BINLOG_FORMAT WSREP_GTID_DOMAIN_ID WSREP_GTID_MODE +WSREP_GTID_SEQ_NO WSREP_IGNORE_APPLY_ERRORS WSREP_LOAD_DATA_SPLITTING WSREP_LOG_CONFLICTS WSREP_MAX_WS_ROWS WSREP_MAX_WS_SIZE +WSREP_MODE WSREP_MYSQL_REPLICATION_BUNDLE WSREP_NODE_ADDRESS WSREP_NODE_INCOMING_ADDRESS @@ -122,7 +124,6 @@ WSREP_PROVIDER WSREP_PROVIDER_OPTIONS WSREP_RECOVER WSREP_REJECT_QUERIES -WSREP_REPLICATE_MYISAM WSREP_RESTART_SLAVE WSREP_RETRY_AUTOCOMMIT WSREP_SLAVE_FK_CHECKS diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c index 3e0b774b0c7..9f230b6bbcb 100644 --- a/mysys/my_alloc.c +++ b/mysys/my_alloc.c @@ -20,15 +20,101 @@ #include <my_global.h> #include <my_sys.h> #include <m_string.h> +#include <my_bit.h> +#ifdef HAVE_SYS_MMAN_H +#include <sys/mman.h> +#endif + #undef EXTRA_DEBUG #define EXTRA_DEBUG /* data packed in MEM_ROOT -> min_malloc */ -#define MALLOC_FLAG(A) ((A & 1) ? MY_THREAD_SPECIFIC : 0) +/* Don't allocate too small blocks */ +#define ROOT_MIN_BLOCK_SIZE 256 + +/* bits in MEM_ROOT->flags */ +#define ROOT_FLAG_THREAD_SPECIFIC 1 +#define ROOT_FLAG_MPROTECT 2 + +#define MALLOC_FLAG(R) MYF((R)->flags & ROOT_FLAG_THREAD_SPECIFIC ? THREAD_SPECIFIC : 0) #define TRASH_MEM(X) TRASH_FREE(((char*)(X) + ((X)->size-(X)->left)), (X)->left) + +/* + Alloc memory through either my_malloc or mmap() +*/ + +static void *root_alloc(MEM_ROOT *root, size_t size, size_t *alloced_size, + myf my_flags) +{ + *alloced_size= size; +#if defined(HAVE_MMAP) && defined(HAVE_MPROTECT) && defined(MAP_ANONYMOUS) + if (root->flags & ROOT_FLAG_MPROTECT) + { + void *res; + *alloced_size= MY_ALIGN(size, my_system_page_size); + res= my_mmap(0, *alloced_size, PROT_READ | PROT_WRITE, + MAP_NORESERVE | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + if (res == MAP_FAILED) + res= 0; + return res; + } +#endif /* HAVE_MMAP */ + + return my_malloc(root->psi_key, size, + my_flags | MYF(root->flags & ROOT_FLAG_THREAD_SPECIFIC ? + MY_THREAD_SPECIFIC : 0)); +} + +static void root_free(MEM_ROOT *root, void *ptr, size_t size) +{ +#if defined(HAVE_MMAP) && defined(HAVE_MPROTECT) && defined(MAP_ANONYMOUS) + if (root->flags & ROOT_FLAG_MPROTECT) + my_munmap(ptr, size); + else +#endif + my_free(ptr); +} + + +/* + Calculate block sizes to use + + Sizes will be updated to next power of 2, minus operating system + memory management size. + + The idea is to reduce memory fragmentation as most system memory + allocators are using power of 2 block size internally. +*/ + +static void calculate_block_sizes(MEM_ROOT *mem_root, size_t block_size, + size_t *pre_alloc_size) +{ + size_t pre_alloc= *pre_alloc_size; + + if (mem_root->flags&= ROOT_FLAG_MPROTECT) + { + mem_root->block_size= MY_ALIGN(block_size, my_system_page_size); + if (pre_alloc) + pre_alloc= MY_ALIGN(pre_alloc, my_system_page_size); + } + else + { + DBUG_ASSERT(block_size <= UINT_MAX32); + mem_root->block_size= (my_round_up_to_next_power((uint32) block_size - + MALLOC_OVERHEAD)- + MALLOC_OVERHEAD); + if (pre_alloc) + pre_alloc= (my_round_up_to_next_power((uint32) pre_alloc - + MALLOC_OVERHEAD)- + MALLOC_OVERHEAD); + } + *pre_alloc_size= pre_alloc; +} + + /* Initialize memory root @@ -36,13 +122,18 @@ init_alloc_root() mem_root - memory root to initialize name - name of memroot (for debugging) - block_size - size of chunks (blocks) used for memory allocation + block_size - size of chunks (blocks) used for memory allocation. + Will be updated to next power of 2, minus + internal and system memory management size. This is + will reduce memory fragmentation as most system memory + allocators are using power of 2 block size internally. (It is external size of chunk i.e. it should include memory required for internal structures, thus it - should be no less than ALLOC_ROOT_MIN_BLOCK_SIZE) + should be no less than ROOT_MIN_BLOCK_SIZE). pre_alloc_size - if non-0, then size of block that should be pre-allocated during memory root initialization. my_flags MY_THREAD_SPECIFIC flag for my_malloc + MY_RROOT_USE_MPROTECT for read only protected memory DESCRIPTION This function prepares memory root for further use, sets initial size of @@ -50,9 +141,6 @@ Although error can happen during execution of this function if pre_alloc_size is non-0 it won't be reported. Instead it will be reported as error in first alloc_root() on this memory root. - - We don't want to change the structure size for MEM_ROOT. - Because of this, we store in MY_THREAD_SPECIFIC as bit 1 in block_size */ void init_alloc_root(PSI_memory_key key, MEM_ROOT *mem_root, size_t block_size, @@ -63,25 +151,31 @@ void init_alloc_root(PSI_memory_key key, MEM_ROOT *mem_root, size_t block_size, DBUG_PRINT("enter",("root: %p prealloc: %zu", mem_root, pre_alloc_size)); mem_root->free= mem_root->used= mem_root->pre_alloc= 0; - mem_root->min_malloc= 32; - mem_root->block_size= (block_size - ALLOC_ROOT_MIN_BLOCK_SIZE) & ~1; + mem_root->min_malloc= 32 + REDZONE_SIZE; + mem_root->block_size= MY_MAX(block_size, ROOT_MIN_BLOCK_SIZE); + mem_root->flags= 0; if (my_flags & MY_THREAD_SPECIFIC) - mem_root->block_size|= 1; + mem_root->flags|= ROOT_FLAG_THREAD_SPECIFIC; + if (my_flags & MY_ROOT_USE_MPROTECT) + mem_root->flags|= ROOT_FLAG_MPROTECT; + + calculate_block_sizes(mem_root, block_size, &pre_alloc_size); mem_root->error_handler= 0; mem_root->block_num= 4; /* We shift this with >>2 */ mem_root->first_block_usage= 0; - mem_root->m_psi_key= key; + mem_root->psi_key= key; #if !(defined(HAVE_valgrind) && defined(EXTRA_DEBUG)) if (pre_alloc_size) { - size_t size= pre_alloc_size + ALIGN_SIZE(sizeof(USED_MEM)); + size_t alloced_size; if ((mem_root->free= mem_root->pre_alloc= - (USED_MEM*) my_malloc(key, size, MYF(my_flags)))) + (USED_MEM*) root_alloc(mem_root, pre_alloc_size, &alloced_size, + MYF(0)))) { - mem_root->free->size= size; - mem_root->free->left= pre_alloc_size; + mem_root->free->size= alloced_size; + mem_root->free->left= alloced_size - ALIGN_SIZE(sizeof(USED_MEM)); mem_root->free->next= 0; TRASH_MEM(mem_root->free); } @@ -113,13 +207,14 @@ void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size, DBUG_ENTER("reset_root_defaults"); DBUG_ASSERT(alloc_root_inited(mem_root)); - mem_root->block_size= (((block_size - ALLOC_ROOT_MIN_BLOCK_SIZE) & ~1) | - (mem_root->block_size & 1)); + calculate_block_sizes(mem_root, block_size, &pre_alloc_size); + #if !(defined(HAVE_valgrind) && defined(EXTRA_DEBUG)) if (pre_alloc_size) { - size_t size= pre_alloc_size + ALIGN_SIZE(sizeof(USED_MEM)); - if (!mem_root->pre_alloc || mem_root->pre_alloc->size != size) + size_t size= mem_root->block_size, alloced_size; + if (!mem_root->pre_alloc || + mem_root->pre_alloc->size != mem_root->block_size) { USED_MEM *mem, **prev= &mem_root->free; /* @@ -139,26 +234,23 @@ void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size, { /* remove block from the list and free it */ *prev= mem->next; - my_free(mem); + root_free(mem_root, mem, mem->size); } else prev= &mem->next; } /* Allocate new prealloc block and add it to the end of free list */ - if ((mem= (USED_MEM *) my_malloc(mem_root->m_psi_key, size, - MYF(MALLOC_FLAG(mem_root-> - block_size))))) + if ((mem= (USED_MEM *) root_alloc(mem_root, size, &alloced_size, + MYF(MY_WME)))) { - mem->size= size; - mem->left= pre_alloc_size; + mem->size= alloced_size; + mem->left= alloced_size - ALIGN_SIZE(sizeof(USED_MEM)); mem->next= *prev; *prev= mem_root->pre_alloc= mem; TRASH_MEM(mem); } else - { mem_root->pre_alloc= 0; - } } } else @@ -171,37 +263,6 @@ void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size, void *alloc_root(MEM_ROOT *mem_root, size_t length) { -#if defined(HAVE_valgrind) && defined(EXTRA_DEBUG) - reg1 USED_MEM *next; - DBUG_ENTER("alloc_root"); - DBUG_PRINT("enter",("root: %p", mem_root)); - - DBUG_ASSERT(alloc_root_inited(mem_root)); - - DBUG_EXECUTE_IF("simulate_out_of_memory", - { - if (mem_root->error_handler) - (*mem_root->error_handler)(); - DBUG_SET("-d,simulate_out_of_memory"); - DBUG_RETURN((void*) 0); /* purecov: inspected */ - }); - - length+=ALIGN_SIZE(sizeof(USED_MEM)); - if (!(next = (USED_MEM*) my_malloc(mem_root->m_psi_key, length, - MYF(MY_WME | ME_FATAL | - MALLOC_FLAG(mem_root->block_size))))) - { - if (mem_root->error_handler) - (*mem_root->error_handler)(); - DBUG_RETURN((uchar*) 0); /* purecov: inspected */ - } - next->next= mem_root->used; - next->left= 0; - next->size= length; - mem_root->used= next; - DBUG_PRINT("exit",("ptr: %p", (((char*)next)+ALIGN_SIZE(sizeof(USED_MEM))))); - DBUG_RETURN((((uchar*) next)+ALIGN_SIZE(sizeof(USED_MEM)))); -#else size_t get_size, block_size; uchar* point; reg1 USED_MEM *next= 0; @@ -212,13 +273,36 @@ void *alloc_root(MEM_ROOT *mem_root, size_t length) DBUG_ASSERT(alloc_root_inited(mem_root)); DBUG_EXECUTE_IF("simulate_out_of_memory", - { - /* Avoid reusing an already allocated block */ - if (mem_root->error_handler) - (*mem_root->error_handler)(); - DBUG_SET("-d,simulate_out_of_memory"); - DBUG_RETURN((void*) 0); /* purecov: inspected */ - }); + { + if (mem_root->error_handler) + (*mem_root->error_handler)(); + DBUG_SET("-d,simulate_out_of_memory"); + DBUG_RETURN((void*) 0); /* purecov: inspected */ + }); + +#if defined(HAVE_valgrind) && defined(EXTRA_DEBUG) + if (!(mem_root->flags & ROOT_FLAG_MPROTECT)) + { + length+= ALIGN_SIZE(sizeof(USED_MEM)); + if (!(next = (USED_MEM*) my_malloc(mem_root->psi_key, length, + MYF(MY_WME | ME_FATAL | + (mem_root->flags & + ROOT_FLAG_THREAD_SPECIFIC ? + MY_THREAD_SPECIFIC : 0))))) + { + if (mem_root->error_handler) + (*mem_root->error_handler)(); + DBUG_RETURN((uchar*) 0); /* purecov: inspected */ + } + next->next= mem_root->used; + next->left= 0; + next->size= length; + mem_root->used= next; + DBUG_PRINT("exit",("ptr: %p", (((char*)next)+ALIGN_SIZE(sizeof(USED_MEM))))); + DBUG_RETURN((((uchar*) next)+ALIGN_SIZE(sizeof(USED_MEM)))); + } +#endif /* defined(HAVE_valgrind) && defined(EXTRA_DEBUG) */ + length= ALIGN_SIZE(length) + REDZONE_SIZE; if ((*(prev= &mem_root->free)) != NULL) { @@ -237,14 +321,16 @@ void *alloc_root(MEM_ROOT *mem_root, size_t length) } if (! next) { /* Time to alloc new block */ - block_size= (mem_root->block_size & ~1) * (mem_root->block_num >> 2); - get_size= length+ALIGN_SIZE(sizeof(USED_MEM)); + size_t alloced_length; + + /* Increase block size over time if there is a lot of mallocs */ + block_size= (MY_ALIGN(mem_root->block_size, ROOT_MIN_BLOCK_SIZE) * + (mem_root->block_num >> 2)- MALLOC_OVERHEAD); + get_size= length + ALIGN_SIZE(sizeof(USED_MEM)); get_size= MY_MAX(get_size, block_size); - if (!(next = (USED_MEM*) my_malloc(mem_root->m_psi_key, get_size, - MYF(MY_WME | ME_FATAL | - MALLOC_FLAG(mem_root-> - block_size))))) + if (!(next= (USED_MEM*) root_alloc(mem_root, get_size, &alloced_length, + MYF(MY_WME | ME_FATAL)))) { if (mem_root->error_handler) (*mem_root->error_handler)(); @@ -252,8 +338,8 @@ void *alloc_root(MEM_ROOT *mem_root, size_t length) } mem_root->block_num++; next->next= *prev; - next->size= get_size; - next->left= get_size-ALIGN_SIZE(sizeof(USED_MEM)); + next->size= alloced_length; + next->left= alloced_length - ALIGN_SIZE(sizeof(USED_MEM)); *prev=next; TRASH_MEM(next); } @@ -271,7 +357,6 @@ void *alloc_root(MEM_ROOT *mem_root, size_t length) TRASH_ALLOC(point, original_length); DBUG_PRINT("exit",("ptr: %p", point)); DBUG_RETURN((void*) point); -#endif } @@ -407,13 +492,13 @@ void free_root(MEM_ROOT *root, myf MyFlags) { old=next; next= next->next ; if (old != root->pre_alloc) - my_free(old); + root_free(root, old, old->size); } for (next=root->free ; next ;) { old=next; next= next->next; if (old != root->pre_alloc) - my_free(old); + root_free(root, old, old->size); } root->used=root->free=0; if (root->pre_alloc) @@ -428,6 +513,7 @@ void free_root(MEM_ROOT *root, myf MyFlags) DBUG_VOID_RETURN; } + /* Find block that contains an object and set the pre_alloc to it */ @@ -454,6 +540,38 @@ void set_prealloc_root(MEM_ROOT *root, char *ptr) } +/** + Change protection for all blocks in the mem root +*/ + +#if defined(HAVE_MMAP) && defined(HAVE_MPROTECT) && defined(MAP_ANONYMOUS) +void protect_root(MEM_ROOT *root, int prot) +{ + reg1 USED_MEM *next,*old; + DBUG_ENTER("protect_root"); + DBUG_PRINT("enter",("root: %p prot: %d", root, prot)); + + DBUG_ASSERT(root->flags & ROOT_FLAG_MPROTECT); + + for (next= root->used; next ;) + { + old= next; next= next->next ; + mprotect(old, old->size, prot); + } + for (next= root->free; next ;) + { + old= next; next= next->next ; + mprotect(old, old->size, prot); + } + DBUG_VOID_RETURN; +} +#else +void protect_root(MEM_ROOT *root, int prot) +{ +} +#endif /* defined(HAVE_MMAP) && ... */ + + char *strdup_root(MEM_ROOT *root, const char *str) { return strmake_root(root, str, strlen(str)); diff --git a/mysys/my_bitmap.c b/mysys/my_bitmap.c index bf2bacd213c..9893c7e4a58 100644 --- a/mysys/my_bitmap.c +++ b/mysys/my_bitmap.c @@ -123,19 +123,6 @@ static inline my_bitmap_map last_word_mask(uint bit) } -static inline void bitmap_lock(MY_BITMAP *map __attribute__((unused))) -{ - if (map->mutex) - mysql_mutex_lock(map->mutex); -} - -static inline void bitmap_unlock(MY_BITMAP *map __attribute__((unused))) -{ - if (map->mutex) - mysql_mutex_unlock(map->mutex); -} - - static inline uint get_first_set(my_bitmap_map value, uint word_pos) { uchar *byte_ptr= (uchar*)&value; @@ -159,32 +146,15 @@ static inline uint get_first_set(my_bitmap_map value, uint word_pos) Initialize a bitmap object. All bits will be set to zero */ -my_bool my_bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits, - my_bool thread_safe) +my_bool my_bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits) { DBUG_ENTER("my_bitmap_init"); - map->mutex= 0; if (!buf) { uint size_in_bytes= bitmap_buffer_size(n_bits); - uint extra= 0; - if (thread_safe) - { - size_in_bytes= ALIGN_SIZE(size_in_bytes); - extra= sizeof(mysql_mutex_t); - } if (!(buf= (my_bitmap_map*) my_malloc(key_memory_MY_BITMAP_bitmap, - size_in_bytes+extra, MYF(MY_WME)))) + size_in_bytes, MYF(MY_WME)))) DBUG_RETURN(1); - if (thread_safe) - { - map->mutex= (mysql_mutex_t *) ((char*) buf + size_in_bytes); - mysql_mutex_init(key_BITMAP_mutex, map->mutex, MY_MUTEX_INIT_FAST); - } - } - else - { - DBUG_ASSERT(thread_safe == 0); } map->bitmap= buf; @@ -200,8 +170,6 @@ void my_bitmap_free(MY_BITMAP *map) DBUG_ENTER("my_bitmap_free"); if (map->bitmap) { - if (map->mutex) - mysql_mutex_destroy(map->mutex); my_free(map->bitmap); map->bitmap=0; } @@ -247,13 +215,9 @@ my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit) my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit) { - my_bool res; DBUG_ASSERT(map->bitmap); DBUG_ASSERT(bitmap_bit < map->n_bits); - bitmap_lock(map); - res= bitmap_fast_test_and_set(map, bitmap_bit); - bitmap_unlock(map); - return res; + return bitmap_fast_test_and_set(map, bitmap_bit); } /* @@ -281,13 +245,9 @@ my_bool bitmap_fast_test_and_clear(MY_BITMAP *map, uint bitmap_bit) my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit) { - my_bool res; DBUG_ASSERT(map->bitmap); DBUG_ASSERT(bitmap_bit < map->n_bits); - bitmap_lock(map); - res= bitmap_fast_test_and_clear(map, bitmap_bit); - bitmap_unlock(map); - return res; + return bitmap_fast_test_and_clear(map, bitmap_bit); } @@ -733,24 +693,3 @@ found: DBUG_ASSERT(0); return MY_BIT_NONE; /* Impossible */ } - - -uint bitmap_lock_set_next(MY_BITMAP *map) -{ - uint bit_found; - bitmap_lock(map); - bit_found= bitmap_set_next(map); - bitmap_unlock(map); - return bit_found; -} - - -void bitmap_lock_clear_bit(MY_BITMAP *map, uint bitmap_bit) -{ - bitmap_lock(map); - DBUG_ASSERT(map->bitmap); - DBUG_ASSERT(bitmap_bit < map->n_bits); - bitmap_clear_bit(map, bitmap_bit); - bitmap_unlock(map); -} - diff --git a/mysys/my_init.c b/mysys/my_init.c index 2b420da03be..d201d45a4ee 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -22,6 +22,9 @@ #include <m_ctype.h> #include <signal.h> #include <mysql/psi/mysql_stage.h> +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif #ifdef _WIN32 #ifdef _MSC_VER #include <locale.h> @@ -35,6 +38,10 @@ static my_bool win32_init_tcp_ip(); #define my_win_init() #endif +#if defined(_SC_PAGE_SIZE) && !defined(_SC_PAGESIZE) +#define _SC_PAGESIZE _SC_PAGE_SIZE +#endif + extern pthread_key(struct st_my_thread_var*, THR_KEY_mysys); #define SCALE_SEC 100 @@ -42,6 +49,7 @@ extern pthread_key(struct st_my_thread_var*, THR_KEY_mysys); my_bool my_init_done= 0; uint mysys_usage_id= 0; /* Incremented for each my_init() */ +size_t my_system_page_size= 8192; /* Default if no sysconf() */ ulonglong my_thread_stack_size= (sizeof(void*) <= 4)? 65536: ((256-16)*1024); @@ -79,6 +87,9 @@ my_bool my_init(void) my_umask= 0660; /* Default umask for new files */ my_umask_dir= 0700; /* Default umask for new directories */ my_global_flags= 0; +#ifdef _SC_PAGESIZE + my_system_page_size= sysconf(_SC_PAGESIZE); +#endif /* Default creation of new files */ if ((str= getenv("UMASK")) != 0) diff --git a/mysys/my_lockmem.c b/mysys/my_lockmem.c index e159502a278..a3ad7a5b76c 100644 --- a/mysys/my_lockmem.c +++ b/mysys/my_lockmem.c @@ -13,7 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */ -/* Alloc a block of locked memory */ +/* Alloc a block of locked memory (memory protected against swap) */ #include "mysys_priv.h" #include "mysys_err.h" @@ -33,7 +33,7 @@ LIST *mem_list; uchar *my_malloc_lock(uint size,myf MyFlags) { int success; - uint pagesize=sysconf(_SC_PAGESIZE); + uint pagesize= my_system_page_size; uchar *ptr; struct st_mem_list *element; DBUG_ENTER("my_malloc_lock"); diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 854d6cac8aa..5a8ea9ea2d2 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -97,9 +97,9 @@ SET (SQL_SOURCE filesort.cc gstream.cc signal_handler.cc handler.cc - hostname.cc init.cc item.cc item_buff.cc item_cmpfunc.cc - item_create.cc item_func.cc item_geofunc.cc item_row.cc - item_strfunc.cc item_subselect.cc item_sum.cc item_timefunc.cc + hostname.cc init.cc item.cc item_buff.cc item_cmpfunc.cc + item_create.cc item_func.cc item_geofunc.cc item_row.cc + item_strfunc.cc item_subselect.cc item_sum.cc item_timefunc.cc key.cc log.cc lock.cc log_event.cc log_event_server.cc rpl_record.cc rpl_reporting.cc @@ -108,33 +108,33 @@ SET (SQL_SOURCE mysqld.cc net_serv.cc keycaches.cc ../sql-common/client_plugin.c opt_range.cc opt_sum.cc - ../sql-common/pack.c parse_file.cc password.c procedure.cc + ../sql-common/pack.c parse_file.cc password.c procedure.cc protocol.cc records.cc repl_failsafe.cc rpl_filter.cc session_tracker.cc - set_var.cc - slave.cc sp.cc sp_cache.cc sp_head.cc sp_pcontext.cc - sp_rcontext.cc spatial.cc sql_acl.cc sql_analyse.cc sql_base.cc + set_var.cc + slave.cc sp.cc sp_cache.cc sp_head.cc sp_pcontext.cc + sp_rcontext.cc spatial.cc sql_acl.cc sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc sql_client.cc sql_crypt.cc sql_cursor.cc sql_db.cc sql_delete.cc sql_derived.cc - sql_digest.cc sql_do.cc + sql_digest.cc sql_do.cc sql_error.cc sql_handler.cc sql_get_diagnostics.cc - sql_help.cc sql_insert.cc sql_lex.cc + sql_help.cc sql_insert.cc sql_lex.cc sql_list.cc sql_load.cc sql_manager.cc sql_parse.cc sql_bootstrap.cc - sql_partition.cc sql_plugin.cc sql_prepare.cc sql_rename.cc + sql_partition.cc sql_plugin.cc sql_prepare.cc sql_rename.cc debug_sync.cc debug.cc sql_repl.cc sql_select.cc sql_show.cc sql_state.c group_by_handler.cc derived_handler.cc select_handler.cc sql_statistics.cc sql_string.cc lex_string.h sql_table.cc sql_test.cc sql_trigger.cc sql_udf.cc sql_union.cc ddl_log.cc ddl_log.h - sql_update.cc sql_view.cc strfunc.cc table.cc thr_malloc.cc - sql_time.cc tztime.cc unireg.cc item_xmlfunc.cc + sql_update.cc sql_view.cc strfunc.cc table.cc thr_malloc.cc + sql_time.cc tztime.cc unireg.cc item_xmlfunc.cc uniques.cc rpl_tblmap.cc sql_binlog.cc event_scheduler.cc event_data_objects.cc - event_queue.cc event_db_repository.cc - sql_tablespace.cc events.cc ../sql-common/my_user.c + event_queue.cc event_db_repository.cc + events.cc ../sql-common/my_user.c partition_info.cc rpl_utility.cc rpl_utility_server.cc rpl_injector.cc sql_locale.cc rpl_rli.cc rpl_mi.cc sql_servers.cc sql_audit.cc @@ -178,7 +178,7 @@ SET (SQL_SOURCE ${GEN_SOURCES} ${MYSYS_LIBWRAP_SOURCE} ) - + IF ((CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "SunOS" OR WIN32 OR @@ -312,24 +312,24 @@ ENDIF() # On Solaris, some extra effort is required in order to get dtrace probes # from static libraries -DTRACE_INSTRUMENT_STATIC_LIBS(mariadbd +DTRACE_INSTRUMENT_STATIC_LIBS(mariadbd "sql;mysys;mysys_ssl;${MYSQLD_STATIC_PLUGIN_LIBS}") - + SET(WITH_MYSQLD_LDFLAGS "" CACHE STRING "Additional linker flags for mysqld") MARK_AS_ADVANCED(WITH_MYSQLD_LDFLAGS) IF(WITH_MYSQLD_LDFLAGS) GET_TARGET_PROPERTY(MYSQLD_LINK_FLAGS mariadbd LINK_FLAGS) IF(NOT MYSQLD_LINK_FLAGS) - SET(MYSQLD_LINK_FLAGS) - ENDIF() - SET_TARGET_PROPERTIES(mariadbd PROPERTIES LINK_FLAGS + SET(MYSQLD_LINK_FLAGS) + ENDIF() + SET_TARGET_PROPERTIES(mariadbd PROPERTIES LINK_FLAGS "${MYSQLD_LINK_FLAGS} ${WITH_MYSQLD_LDFLAGS}") ENDIF() -# Handle out-of-source build from source package with possibly broken -# bison. Copy bison output to from source to build directory, if not already +# Handle out-of-source build from source package with possibly broken +# bison. Copy bison output to from source to build directory, if not already # there IF (NOT BISON_FOUND) IF (NOT ${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR}) @@ -439,9 +439,9 @@ IF(TARGET mariadbd AND (NOT CMAKE_CROSSCOMPILING OR DEFINED CMAKE_CROSSCOMPILING ELSE() SET(ALL_ON_WINDOWS) ENDIF() - ADD_CUSTOM_TARGET(initial_database + ADD_CUSTOM_TARGET(initial_database ${ALL_ON_WINDOWS} - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/initdb.dep + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/initdb.dep ) ENDIF() @@ -450,7 +450,7 @@ IF(WIN32) FILE(TO_NATIVE_PATH ${my_bootstrap_sql} native_outfile) # Create bootstrapper SQL script - ADD_CUSTOM_COMMAND(OUTPUT + ADD_CUSTOM_COMMAND(OUTPUT ${my_bootstrap_sql} COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/scripts cmd /c copy mysql_system_tables.sql+mysql_system_tables_data.sql+fill_help_tables.sql+mysql_performance_tables.sql+mysql_test_db.sql+mysql_sys_schema.sql ${native_outfile} @@ -473,7 +473,7 @@ IF(WIN32) DEPENDS comp_sql ${my_bootstrap_sql} ) - MYSQL_ADD_EXECUTABLE(mariadb-install-db + MYSQL_ADD_EXECUTABLE(mariadb-install-db mysql_install_db.cc ${CMAKE_CURRENT_BINARY_DIR}/mysql_bootstrap_sql.c COMPONENT Server diff --git a/sql/backup.cc b/sql/backup.cc index 84c3788a4d4..208e1694b3a 100644 --- a/sql/backup.cc +++ b/sql/backup.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2018, 2020, MariaDB Corporation. +/* Copyright (c) 2018, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. @@ -381,6 +381,9 @@ bool backup_end(THD *thd) if (WSREP_NNULL(thd) && thd->wsrep_desynced_backup_stage) { Wsrep_server_state &server_state= Wsrep_server_state::instance(); + THD_STAGE_INFO(thd, stage_waiting_flow); + WSREP_DEBUG("backup_end: waiting for flow control for %s", + wsrep_thd_query(thd)); server_state.resume_and_resync(); thd->wsrep_desynced_backup_stage= false; } diff --git a/sql/gcalc_slicescan.cc b/sql/gcalc_slicescan.cc index 93561f5fe97..e35f9155967 100644 --- a/sql/gcalc_slicescan.cc +++ b/sql/gcalc_slicescan.cc @@ -168,7 +168,7 @@ static void GCALC_DBUG_PRINT_SLICE(const char *header, Gcalc_dyn_list::Gcalc_dyn_list(size_t blk_size, size_t sizeof_item): - m_blk_size(blk_size - ALLOC_ROOT_MIN_BLOCK_SIZE), + m_blk_size(blk_size), m_sizeof_item(ALIGN_SIZE(sizeof_item)), m_points_per_blk((uint)((m_blk_size - PH_DATA_OFFSET) / m_sizeof_item)), m_blk_hook(&m_first_blk), diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 1aa917d525b..8259c26087a 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -3538,31 +3538,31 @@ bool ha_partition::init_partition_bitmaps() DBUG_ENTER("ha_partition::init_partition_bitmaps"); /* Initialize the bitmap we use to minimize ha_start_bulk_insert calls */ - if (my_bitmap_init(&m_bulk_insert_started, NULL, m_tot_parts + 1, FALSE)) + if (my_bitmap_init(&m_bulk_insert_started, NULL, m_tot_parts + 1)) DBUG_RETURN(true); /* Initialize the bitmap we use to keep track of locked partitions */ - if (my_bitmap_init(&m_locked_partitions, NULL, m_tot_parts, FALSE)) + if (my_bitmap_init(&m_locked_partitions, NULL, m_tot_parts)) DBUG_RETURN(true); /* Initialize the bitmap we use to keep track of partitions which may have something to reset in ha_reset(). */ - if (my_bitmap_init(&m_partitions_to_reset, NULL, m_tot_parts, FALSE)) + if (my_bitmap_init(&m_partitions_to_reset, NULL, m_tot_parts)) DBUG_RETURN(true); /* Initialize the bitmap we use to keep track of partitions which returned HA_ERR_KEY_NOT_FOUND from index_read_map. */ - if (my_bitmap_init(&m_key_not_found_partitions, NULL, m_tot_parts, FALSE)) + if (my_bitmap_init(&m_key_not_found_partitions, NULL, m_tot_parts)) DBUG_RETURN(true); - if (bitmap_init(&m_mrr_used_partitions, NULL, m_tot_parts, TRUE)) + if (my_bitmap_init(&m_mrr_used_partitions, NULL, m_tot_parts)) DBUG_RETURN(true); - if (my_bitmap_init(&m_opened_partitions, NULL, m_tot_parts, FALSE)) + if (my_bitmap_init(&m_opened_partitions, NULL, m_tot_parts)) DBUG_RETURN(true); m_file_sample= NULL; diff --git a/sql/handler.h b/sql/handler.h index 75a15ed4c6a..1dfce4d4044 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -968,39 +968,6 @@ struct xid_recovery_member #define MIN_XID_LIST_SIZE 128 #define MAX_XID_LIST_SIZE (1024*128) -/* - These structures are used to pass information from a set of SQL commands - on add/drop/change tablespace definitions to the proper hton. -*/ -#define UNDEF_NODEGROUP 65535 -enum ts_command_type -{ - TS_CMD_NOT_DEFINED = -1, - CREATE_TABLESPACE = 0, - ALTER_TABLESPACE = 1, - CREATE_LOGFILE_GROUP = 2, - ALTER_LOGFILE_GROUP = 3, - DROP_TABLESPACE = 4, - DROP_LOGFILE_GROUP = 5, - CHANGE_FILE_TABLESPACE = 6, - ALTER_ACCESS_MODE_TABLESPACE = 7 -}; - -enum ts_alter_tablespace_type -{ - TS_ALTER_TABLESPACE_TYPE_NOT_DEFINED = -1, - ALTER_TABLESPACE_ADD_FILE = 1, - ALTER_TABLESPACE_DROP_FILE = 2 -}; - -enum tablespace_access_mode -{ - TS_NOT_DEFINED= -1, - TS_READ_ONLY = 0, - TS_READ_WRITE = 1, - TS_NOT_ACCESSIBLE = 2 -}; - /* Statistics about batch operations like bulk_insert */ struct ha_copy_info { @@ -1011,50 +978,6 @@ struct ha_copy_info ha_rows updated; }; -struct handlerton; -class st_alter_tablespace : public Sql_alloc -{ - public: - const char *tablespace_name; - const char *logfile_group_name; - enum ts_command_type ts_cmd_type; - enum ts_alter_tablespace_type ts_alter_tablespace_type; - const char *data_file_name; - const char *undo_file_name; - const char *redo_file_name; - ulonglong extent_size; - ulonglong undo_buffer_size; - ulonglong redo_buffer_size; - ulonglong initial_size; - ulonglong autoextend_size; - ulonglong max_size; - uint nodegroup_id; - handlerton *storage_engine; - bool wait_until_completed; - const char *ts_comment; - enum tablespace_access_mode ts_access_mode; - st_alter_tablespace() - { - tablespace_name= NULL; - logfile_group_name= "DEFAULT_LG"; //Default log file group - ts_cmd_type= TS_CMD_NOT_DEFINED; - data_file_name= NULL; - undo_file_name= NULL; - redo_file_name= NULL; - extent_size= 1024*1024; //Default 1 MByte - undo_buffer_size= 8*1024*1024; //Default 8 MByte - redo_buffer_size= 8*1024*1024; //Default 8 MByte - initial_size= 128*1024*1024; //Default 128 MByte - autoextend_size= 0; //No autoextension as default - max_size= 0; //Max size == initial size => no extension - storage_engine= NULL; - nodegroup_id= UNDEF_NODEGROUP; - wait_until_completed= TRUE; - ts_comment= NULL; - ts_access_mode= TS_NOT_DEFINED; - } -}; - /* The handler for a table type. Will be included in the TABLE structure */ struct TABLE; @@ -1118,6 +1041,7 @@ typedef bool (stat_print_fn)(THD *thd, const char *type, size_t type_len, enum ha_stat_type { HA_ENGINE_STATUS, HA_ENGINE_LOGS, HA_ENGINE_MUTEX }; extern MYSQL_PLUGIN_IMPORT st_plugin_int *hton2plugin[MAX_HA]; +struct handlerton; #define view_pseudo_hton ((handlerton *)1) /* Transaction log maintains type definitions */ @@ -1548,8 +1472,7 @@ struct handlerton bool (*show_status)(handlerton *hton, THD *thd, stat_print_fn *print, enum ha_stat_type stat); uint (*partition_flags)(); alter_table_operations (*alter_table_flags)(alter_table_operations flags); - int (*alter_tablespace)(handlerton *hton, THD *thd, st_alter_tablespace *ts_info); - int (*fill_is_table)(handlerton *hton, THD *thd, TABLE_LIST *tables, + int (*fill_is_table)(handlerton *hton, THD *thd, TABLE_LIST *tables, class Item *cond, enum enum_schema_tables); uint32 flags; /* global handler flags */ diff --git a/sql/item.cc b/sql/item.cc index ebf9d720b99..82c09f595fd 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -55,8 +55,8 @@ const char *item_empty_name=""; const char *item_used_name= "\0"; static int save_field_in_field(Field *, bool *, Field *, bool); -const Item_bool_static Item_false("FALSE", 0); -const Item_bool_static Item_true("TRUE", 1); +Item_bool_static *Item_false; +Item_bool_static *Item_true; /** Compare two Items for List<Item>::add_unique() @@ -446,7 +446,7 @@ Item::Item(THD *thd): Item::Item(): name(null_clex_str), orig_name(0), is_expensive_cache(-1) { - DBUG_ASSERT(my_progname == NULL); // before main() + DBUG_ASSERT(!mysqld_server_started); // Created early base_flags= item_base_t::FIXED; with_flags= item_with_t::NONE; null_value= 0; diff --git a/sql/item.h b/sql/item.h index 6b9223de122..947e46532e4 100644 --- a/sql/item.h +++ b/sql/item.h @@ -769,8 +769,8 @@ enum class item_base_t : item_flags_t FIXED= (1<<2), // Was fixed with fix_fields(). IS_EXPLICIT_NAME= (1<<3), // The name of this Item was set by the user // (or was auto generated otherwise) - IS_IN_WITH_CYCLE= (1<<4) // This item is in CYCLE clause - // of WITH. + IS_IN_WITH_CYCLE= (1<<4), // This item is in CYCLE clause of WITH. + AT_TOP_LEVEL= (1<<5) // At top (AND) level of item tree }; @@ -1319,6 +1319,25 @@ public: { set_maybe_null(maybe_null_arg); } + /* + Mark the item that it is a top level item, or part of a top level AND item, + for WHERE and ON clauses: + Example: ... WHERE a=5 AND b=6; Both a=5 and b=6 are top level items + + This is used to indicate that there is no distinction between if the + value of the item is FALSE or NULL.. + This enables Item_cond_and and subquery related items to do special + "top level" optimizations. + */ + virtual void top_level_item() + { + base_flags|= item_base_t::AT_TOP_LEVEL; + } + /* + Return TRUE if this item of top WHERE level (AND/OR) + */ + bool is_top_level_item() const + { return (bool) (base_flags & item_base_t::AT_TOP_LEVEL); } void set_typelib(const TYPELIB *typelib) override { @@ -2035,25 +2054,6 @@ public: { return type_handler()->Item_update_null_value(this); } - - /* - Inform the item that there will be no distinction between its result - being FALSE or NULL. - - NOTE - This function will be called for eg. Items that are top-level AND-parts - of the WHERE clause. Items implementing this function (currently - Item_cond_and and subquery-related item) enable special optimizations - when they are "top level". - */ - virtual void top_level_item() {} - /* - Return TRUE if it is item of top WHERE level (AND/OR) and it is - important, return FALSE if it not important (we can not use to simplify - calculations) or not top level - */ - virtual bool is_top_level_item() const - { return FALSE; /* not important */} /* return IN/ALL/ANY subquery or NULL */ @@ -2647,7 +2647,7 @@ public: bool depends_only_on(table_map view_map) { return marker & MARKER_FULL_EXTRACTION; } - int get_extraction_flag() + int get_extraction_flag() const { return marker & MARKER_EXTRACTION_MASK; } void set_extraction_flag(int16 flags) { @@ -4430,11 +4430,16 @@ public: Item_bool_static(const char *str_arg, longlong i): Item_bool(str_arg, i) {}; + /* Don't mark static items as top level item */ + virtual void top_level_item() override {} void set_join_tab_idx(uint8 join_tab_idx_arg) override { DBUG_ASSERT(0); } + + void cleanup() override {} }; -extern const Item_bool_static Item_false, Item_true; +/* The following variablese are stored in a read only segment */ +extern Item_bool_static *Item_false, *Item_true; class Item_uint :public Item_int { diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 227e65c9d94..22756d543cb 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1065,14 +1065,14 @@ int Arg_comparator::compare_row() // NULL was compared switch (((Item_func*)owner)->functype()) { case Item_func::NE_FUNC: - break; // NE never aborts on NULL even if abort_on_null is set + break; // NE never aborts on NULL case Item_func::LT_FUNC: case Item_func::LE_FUNC: case Item_func::GT_FUNC: case Item_func::GE_FUNC: return -1; // <, <=, > and >= always fail on NULL case Item_func::EQ_FUNC: - if (((Item_func_eq*)owner)->abort_on_null) + if (owner->is_top_level_item()) return -1; // We do not need correct NULL returning break; default: @@ -1189,12 +1189,6 @@ longlong Item_func_truth::val_int() } -bool Item_in_optimizer::is_top_level_item() const -{ - return args[1]->is_top_level_item(); -} - - void Item_in_optimizer::fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge) { @@ -1379,7 +1373,8 @@ bool Item_in_optimizer::fix_fields(THD *thd, Item **ref) } base_flags|= (item_base_t::FIXED | - (args[1]->base_flags & item_base_t::MAYBE_NULL)); + (args[1]->base_flags & (item_base_t::MAYBE_NULL | + item_base_t::AT_TOP_LEVEL))); with_flags|= (item_with_t::SUBQUERY | args[1]->with_flags | (args[0]->with_flags & @@ -2065,7 +2060,7 @@ bool Item_func_between::eval_not_null_tables(void *opt_arg) return 1; /* not_null_tables_cache == union(T1(e),T1(e1),T1(e2)) */ - if (pred_level && !negated) + if (is_top_level_item() && !negated) return 0; /* not_null_tables_cache == union(T1(e), intersection(T1(e1),T1(e2))) */ @@ -2467,6 +2462,10 @@ bool Item_func_if::fix_fields(THD *thd, Item **ref) { DBUG_ASSERT(fixed() == 0); + /* + Mark that we don't care if args[0] is NULL or FALSE, we regard both cases as + false. + */ args[0]->top_level_item(); if (Item_func::fix_fields(thd, ref)) @@ -4342,7 +4341,7 @@ Item_func_in::eval_not_null_tables(void *opt_arg) return 1; /* not_null_tables_cache == union(T1(e),union(T1(ei))) */ - if (pred_level && negated) + if (is_top_level_item() && negated) return 0; /* not_null_tables_cache = union(T1(e),intersection(T1(ei))) */ @@ -4796,9 +4795,10 @@ bool Item_func_bit_and::fix_length_and_dec() Item_cond::Item_cond(THD *thd, Item_cond *item) :Item_bool_func(thd, item), - abort_on_null(item->abort_on_null), and_tables_cache(item->and_tables_cache) { + base_flags|= (item->base_flags & item_base_t::AT_TOP_LEVEL); + /* item->list will be copied by copy_andor_arguments() call */ @@ -4806,7 +4806,7 @@ Item_cond::Item_cond(THD *thd, Item_cond *item) Item_cond::Item_cond(THD *thd, Item *i1, Item *i2): - Item_bool_func(thd), abort_on_null(0) + Item_bool_func(thd) { list.push_back(i1, thd->mem_root); list.push_back(i2, thd->mem_root); @@ -4874,7 +4874,7 @@ Item_cond::fix_fields(THD *thd, Item **ref) ((Item_cond*) item)->list.empty(); item= *li.ref(); // new current item } - if (abort_on_null) + if (is_top_level_item()) item->top_level_item(); /* @@ -4901,7 +4901,7 @@ Item_cond::fix_fields(THD *thd, Item **ref) if (item->can_eval_in_optimize() && !item->with_sp_var() && !cond_has_datetime_is_null(item)) { - if (item->eval_const_cond() == is_and_cond && top_level()) + if (item->eval_const_cond() == is_and_cond && is_top_level_item()) { /* a. This is "... AND true_cond AND ..." @@ -4958,7 +4958,7 @@ Item_cond::eval_not_null_tables(void *opt_arg) if (item->can_eval_in_optimize() && !item->with_sp_var() && !cond_has_datetime_is_null(item)) { - if (item->eval_const_cond() == is_and_cond && top_level()) + if (item->eval_const_cond() == is_and_cond && is_top_level_item()) { /* a. This is "... AND true_cond AND ..." @@ -5393,17 +5393,18 @@ void Item_cond_and::mark_as_condition_AND_part(TABLE_LIST *embedding) Evaluation of AND(expr, expr, expr ...). @note - abort_if_null is set for AND expressions for which we don't care if the - result is NULL or 0. This is set for: + There are AND expressions for which we don't care if the + result is NULL or 0. This is the case for: - WHERE clause - HAVING clause - IF(expression) + For these we mark them as "top_level_items" @retval 1 If all expressions are true @retval - 0 If all expressions are false or if we find a NULL expression and - 'abort_on_null' is set. + 0 If any of the expressions are false or if we find a NULL expression and + this is a top_level_item. @retval NULL if all expression are either 1 or NULL */ @@ -5419,8 +5420,8 @@ longlong Item_cond_and::val_int() { if (!item->val_bool()) { - if (abort_on_null || !(null_value= item->null_value)) - return 0; // return FALSE + if (is_top_level_item() || !(null_value= item->null_value)) + return 0; } } return null_value ? 0 : 1; diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index bc7441c2530..3767c2172e8 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -411,7 +411,6 @@ public: void set_join_tab_idx(uint8 join_tab_idx_arg) override { args[1]->set_join_tab_idx(join_tab_idx_arg); } void get_cache_parameters(List<Item> ¶meters) override; - bool is_top_level_item() const override; bool eval_not_null_tables(void *opt_arg) override; bool find_not_null_fields(table_map allowed) override; void fix_after_pullout(st_select_lex *new_parent, Item **ref, @@ -631,12 +630,8 @@ public: class Item_func_not :public Item_bool_func { - bool abort_on_null; public: - Item_func_not(THD *thd, Item *a): - Item_bool_func(thd, a), abort_on_null(FALSE) {} - void top_level_item() override { abort_on_null= 1; } - bool is_top_level_item() const override { return abort_on_null; } + Item_func_not(THD *thd, Item *a): Item_bool_func(thd, a) {} longlong val_int() override; enum Functype functype() const override { return NOT_FUNC; } LEX_CSTRING func_name_cstring() const override @@ -755,11 +750,10 @@ public: class Item_func_eq :public Item_bool_rowready_func2 { - bool abort_on_null; public: Item_func_eq(THD *thd, Item *a, Item *b): Item_bool_rowready_func2(thd, a, b), - abort_on_null(false), in_equality_no(UINT_MAX) + in_equality_no(UINT_MAX) {} longlong val_int() override; enum Functype functype() const override { return EQ_FUNC; } @@ -770,7 +764,6 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("=") }; return name; } - void top_level_item() override { abort_on_null= true; } Item *negated_item(THD *thd) override; COND *build_equal_items(THD *thd, COND_EQUAL *inherited, bool link_item_fields, @@ -956,15 +949,12 @@ protected: DTCollation cmp_collation; public: bool negated; /* <=> the item represents NOT <func> */ - bool pred_level; /* <=> [NOT] <func> is used on a predicate level */ public: Item_func_opt_neg(THD *thd, Item *a, Item *b, Item *c): - Item_bool_func(thd, a, b, c), negated(0), pred_level(0) {} + Item_bool_func(thd, a, b, c), negated(0) {} Item_func_opt_neg(THD *thd, List<Item> &list): - Item_bool_func(thd, list), negated(0), pred_level(0) {} + Item_bool_func(thd, list), negated(0) {} public: - void top_level_item() override { pred_level= 1; } - bool is_top_level_item() const override { return pred_level; } Item *neg_transformer(THD *thd) override { negated= !negated; @@ -2800,11 +2790,9 @@ public: class Item_func_isnotnull :public Item_func_null_predicate { - bool abort_on_null; public: Item_func_isnotnull(THD *thd, Item *a): - Item_func_null_predicate(thd, a), abort_on_null(0) - { } + Item_func_null_predicate(thd, a) {} longlong val_int() override; enum Functype functype() const override { return ISNOTNULL_FUNC; } LEX_CSTRING func_name_cstring() const override @@ -2814,10 +2802,9 @@ public: } enum precedence precedence() const override { return CMP_PRECEDENCE; } table_map not_null_tables() const override - { return abort_on_null ? not_null_tables_cache : 0; } + { return is_top_level_item() ? not_null_tables_cache : 0; } Item *neg_transformer(THD *thd) override; void print(String *str, enum_query_type query_type) override; - void top_level_item() override { abort_on_null=1; } Item *get_copy(THD *thd) override { return get_item_copy<Item_func_isnotnull>(thd, this); } }; @@ -3128,17 +3115,19 @@ class Item_cond :public Item_bool_func { protected: List<Item> list; - bool abort_on_null; table_map and_tables_cache; public: - /* Item_cond() is only used to create top level items */ - Item_cond(THD *thd): Item_bool_func(thd), abort_on_null(1) - { const_item_cache=0; } + Item_cond(THD *thd): Item_bool_func(thd) + { + /* Item_cond() is only used to create top level items */ + top_level_item(); + const_item_cache=0; + } Item_cond(THD *thd, Item *i1, Item *i2); Item_cond(THD *thd, Item_cond *item); Item_cond(THD *thd, List<Item> &nlist): - Item_bool_func(thd), list(nlist), abort_on_null(0) {} + Item_bool_func(thd), list(nlist) {} bool add(Item *item, MEM_ROOT *root) { DBUG_ASSERT(item); @@ -3185,8 +3174,6 @@ public: List<Item> &fields, uint flags) override; friend int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves, COND **conds); - void top_level_item() override { abort_on_null=1; } - bool top_level() { return abort_on_null; } void copy_andor_arguments(THD *thd, Item_cond *item); bool walk(Item_processor processor, bool walk_subquery, void *arg) override; Item *transform(THD *thd, Item_transformer transformer, uchar *arg) override; @@ -3542,7 +3529,7 @@ public: } enum precedence precedence() const override { return AND_PRECEDENCE; } table_map not_null_tables() const override - { return abort_on_null ? not_null_tables_cache: and_tables_cache; } + { return is_top_level_item() ? not_null_tables_cache: and_tables_cache; } Item *copy_andor_structure(THD *thd) override; Item *neg_transformer(THD *thd) override; void mark_as_condition_AND_part(TABLE_LIST *embedding) override; diff --git a/sql/item_create.cc b/sql/item_create.cc index c80cf7b03d7..e019ac6f8bb 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -902,6 +902,32 @@ protected: }; +class Create_func_json_normalize : public Create_func_arg1 +{ +public: + virtual Item *create_1_arg(THD *thd, Item *arg1); + + static Create_func_json_normalize s_singleton; + +protected: + Create_func_json_normalize() {} + virtual ~Create_func_json_normalize() {} +}; + + +class Create_func_json_equals : public Create_func_arg2 +{ +public: + virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); + + static Create_func_json_equals s_singleton; + +protected: + Create_func_json_equals() {} + virtual ~Create_func_json_equals() {} +}; + + class Create_func_json_exists : public Create_func_arg2 { public: @@ -3596,6 +3622,25 @@ Create_func_isnull::create_1_arg(THD *thd, Item *arg1) return new (thd->mem_root) Item_func_isnull(thd, arg1); } +Create_func_json_normalize Create_func_json_normalize::s_singleton; + +Item* +Create_func_json_normalize::create_1_arg(THD *thd, Item *arg1) +{ + status_var_increment(thd->status_var.feature_json); + return new (thd->mem_root) Item_func_json_normalize(thd, arg1); +} + + +Create_func_json_equals Create_func_json_equals::s_singleton; + +Item* +Create_func_json_equals::create_2_arg(THD *thd, Item *arg1, Item *arg2) +{ + status_var_increment(thd->status_var.feature_json); + return new (thd->mem_root) Item_func_json_equals(thd, arg1, arg2); +} + Create_func_json_exists Create_func_json_exists::s_singleton; @@ -5552,6 +5597,7 @@ Native_func_registry func_array[] = { { STRING_WITH_LEN("JSON_CONTAINS_PATH") }, BUILDER(Create_func_json_contains_path)}, { { STRING_WITH_LEN("JSON_DEPTH") }, BUILDER(Create_func_json_depth)}, { { STRING_WITH_LEN("JSON_DETAILED") }, BUILDER(Create_func_json_detailed)}, + { { STRING_WITH_LEN("JSON_EQUALS") }, BUILDER(Create_func_json_equals)}, { { STRING_WITH_LEN("JSON_EXISTS") }, BUILDER(Create_func_json_exists)}, { { STRING_WITH_LEN("JSON_EXTRACT") }, BUILDER(Create_func_json_extract)}, { { STRING_WITH_LEN("JSON_INSERT") }, BUILDER(Create_func_json_insert)}, @@ -5561,6 +5607,7 @@ Native_func_registry func_array[] = { { STRING_WITH_LEN("JSON_MERGE") }, BUILDER(Create_func_json_merge)}, { { STRING_WITH_LEN("JSON_MERGE_PATCH") }, BUILDER(Create_func_json_merge_patch)}, { { STRING_WITH_LEN("JSON_MERGE_PRESERVE") }, BUILDER(Create_func_json_merge)}, + { { STRING_WITH_LEN("JSON_NORMALIZE") }, BUILDER(Create_func_json_normalize)}, { { STRING_WITH_LEN("JSON_QUERY") }, BUILDER(Create_func_json_query)}, { { STRING_WITH_LEN("JSON_QUOTE") }, BUILDER(Create_func_json_quote)}, { { STRING_WITH_LEN("JSON_OBJECT") }, BUILDER(Create_func_json_object)}, diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index 4b63b119a83..4d966a7d79b 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -393,6 +393,66 @@ longlong Item_func_json_valid::val_int() } +bool Item_func_json_equals::fix_length_and_dec() +{ + if (Item_bool_func::fix_length_and_dec()) + return TRUE; + set_maybe_null(); + return FALSE; +} + + +longlong Item_func_json_equals::val_int() +{ + longlong result= 0; + + String a_tmp, b_tmp; + + String *a= args[0]->val_json(&a_tmp); + String *b= args[1]->val_json(&b_tmp); + + DYNAMIC_STRING a_res; + if (init_dynamic_string(&a_res, NULL, 0, 0)) + { + null_value= 1; + return 1; + } + + DYNAMIC_STRING b_res; + if (init_dynamic_string(&b_res, NULL, 0, 0)) + { + dynstr_free(&a_res); + null_value= 1; + return 1; + } + + if ((null_value= args[0]->null_value || args[1]->null_value)) + { + null_value= 1; + goto end; + } + + if (json_normalize(&a_res, a->ptr(), a->length(), a->charset())) + { + null_value= 1; + goto end; + } + + if (json_normalize(&b_res, b->ptr(), b->length(), b->charset())) + { + null_value= 1; + goto end; + } + + result= strcmp(a_res.str, b_res.str) ? 0 : 1; + +end: + dynstr_free(&b_res); + dynstr_free(&a_res); + return result; +} + + bool Item_func_json_exists::fix_length_and_dec() { if (Item_bool_func::fix_length_and_dec()) @@ -986,7 +1046,7 @@ my_decimal *Item_func_json_extract::val_decimal(my_decimal *to) case JSON_VALUE_ARRAY: case JSON_VALUE_FALSE: case JSON_VALUE_NULL: - case JSON_VALUE_UNINITALIZED: + case JSON_VALUE_UNINITIALIZED: break; }; } @@ -3885,3 +3945,48 @@ String* Item_func_json_objectagg::val_str(String* str) } +String *Item_func_json_normalize::val_str(String *buf) +{ + String tmp; + String *raw_json= args[0]->val_str(&tmp); + + DYNAMIC_STRING normalized_json; + if (init_dynamic_string(&normalized_json, NULL, 0, 0)) + { + null_value= 1; + return NULL; + } + + null_value= args[0]->null_value; + if (null_value) + goto end; + + if (json_normalize(&normalized_json, + raw_json->ptr(), raw_json->length(), + raw_json->charset())) + { + null_value= 1; + goto end; + } + + buf->length(0); + if (buf->append(normalized_json.str, normalized_json.length)) + { + null_value= 1; + goto end; + } + +end: + dynstr_free(&normalized_json); + return null_value ? NULL : buf; +} + + +bool Item_func_json_normalize::fix_length_and_dec() +{ + collation.set(&my_charset_utf8mb4_bin); + /* 0 becomes 0.0E0, thus one character becomes 5 chars */ + fix_char_length_ulonglong((ulonglong) args[0]->max_char_length() * 5); + set_maybe_null(); + return FALSE; +} diff --git a/sql/item_jsonfunc.h b/sql/item_jsonfunc.h index 60600108320..e87b971269b 100644 --- a/sql/item_jsonfunc.h +++ b/sql/item_jsonfunc.h @@ -107,6 +107,23 @@ public: }; +class Item_func_json_equals: public Item_bool_func +{ +public: + Item_func_json_equals(THD *thd, Item *a, Item *b): + Item_bool_func(thd, a, b) {} + LEX_CSTRING func_name_cstring() const override + { + static LEX_CSTRING name= {STRING_WITH_LEN("json_equals") }; + return name; + } + bool fix_length_and_dec() override; + Item *get_copy(THD *thd) override + { return get_item_copy<Item_func_json_equals>(thd, this); } + longlong val_int() override; +}; + + class Item_func_json_exists: public Item_bool_func { protected: @@ -443,6 +460,24 @@ public: { return get_item_copy<Item_func_json_merge_patch>(thd, this); } }; + +class Item_func_json_normalize: public Item_json_func +{ +public: + Item_func_json_normalize(THD *thd, Item *a): + Item_json_func(thd, a) {} + String *val_str(String *) override; + LEX_CSTRING func_name_cstring() const override + { + static LEX_CSTRING name= {STRING_WITH_LEN("json_normalize") }; + return name; + } + bool fix_length_and_dec() override; + Item *get_copy(THD *thd) override + { return get_item_copy<Item_func_json_normalize>(thd, this); } +}; + + class Item_func_json_length: public Item_long_func { bool check_arguments() const override diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index bafb81139e1..58680384f55 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -1602,7 +1602,7 @@ bool Item_singlerow_subselect::get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t Item_exists_subselect::Item_exists_subselect(THD *thd, st_select_lex *select_lex): - Item_subselect(thd), upper_not(NULL), abort_on_null(0), + Item_subselect(thd), upper_not(NULL), emb_on_expr_nest(NULL), optimizer(0), exists_transformed(0) { DBUG_ENTER("Item_exists_subselect::Item_exists_subselect"); @@ -1687,7 +1687,6 @@ Item_allany_subselect::Item_allany_subselect(THD *thd, Item * left_exp, func= func_creator(all_arg); init(select_lex, new (thd->mem_root) select_exists_subselect(thd, this)); max_columns= 1; - abort_on_null= 0; reset(); //if test_limit will fail then error will be reported to client test_limit(select_lex->master_unit()); @@ -2262,8 +2261,11 @@ bool Item_allany_subselect::is_maxmin_applicable(JOIN *join) Check if max/min optimization applicable: It is top item of WHERE condition. */ - return (abort_on_null || (upper_item && upper_item->is_top_level_item())) && - !(join->select_lex->master_unit()->uncacheable & ~UNCACHEABLE_EXPLAIN) && !func->eqne_op(); + return ((is_top_level_item() || + (upper_item && upper_item->is_top_level_item())) && + !(join->select_lex->master_unit()->uncacheable & + ~UNCACHEABLE_EXPLAIN) && + !func->eqne_op()); } @@ -2333,7 +2335,7 @@ Item_in_subselect::create_single_in_to_exists_cond(JOIN *join, ref_pointer_array[0], {STRING_WITH_LEN("<ref>")}, field_name)); - if (!abort_on_null && left_expr->maybe_null()) + if (!is_top_level_item() && left_expr->maybe_null()) { /* We can encounter "NULL IN (SELECT ...)". Wrap the added condition @@ -2366,7 +2368,7 @@ Item_in_subselect::create_single_in_to_exists_cond(JOIN *join, Item *orig_item= item; item= func->create(thd, expr, item); - if (!abort_on_null && orig_item->maybe_null()) + if (!is_top_level_item() && orig_item->maybe_null()) { having= new (thd->mem_root) Item_is_not_null_test(thd, this, having); if (left_expr->maybe_null()) @@ -2388,7 +2390,7 @@ Item_in_subselect::create_single_in_to_exists_cond(JOIN *join, If we may encounter NULL IN (SELECT ...) and care whether subquery result is NULL or FALSE, wrap condition in a trig_cond. */ - if (!abort_on_null && left_expr->maybe_null()) + if (!is_top_level_item() && left_expr->maybe_null()) { disable_cond_guard_for_const_null_left_expr(0); if (!(item= new (thd->mem_root) Item_func_trig_cond(thd, item, @@ -2418,7 +2420,7 @@ Item_in_subselect::create_single_in_to_exists_cond(JOIN *join, &select_lex->ref_pointer_array[0], no_matter_name, field_name)); - if (!abort_on_null && left_expr->maybe_null()) + if (!is_top_level_item() && left_expr->maybe_null()) { disable_cond_guard_for_const_null_left_expr(0); if (!(new_having= new (thd->mem_root) @@ -2617,7 +2619,7 @@ Item_in_subselect::create_row_in_to_exists_cond(JOIN * join, list_ref)); Item *col_item= new (thd->mem_root) Item_cond_or(thd, item_eq, item_isnull); - if (!abort_on_null && left_expr->element_index(i)->maybe_null() && + if (!is_top_level_item() && left_expr->element_index(i)->maybe_null() && get_cond_guard(i)) { disable_cond_guard_for_const_null_left_expr(i); @@ -2636,7 +2638,7 @@ Item_in_subselect::create_row_in_to_exists_cond(JOIN * join, ref_pointer_array[i], no_matter_name, list_ref)); - if (!abort_on_null && left_expr->element_index(i)->maybe_null() && + if (!is_top_level_item() && left_expr->element_index(i)->maybe_null() && get_cond_guard(i) ) { disable_cond_guard_for_const_null_left_expr(i); @@ -2677,7 +2679,7 @@ Item_in_subselect::create_row_in_to_exists_cond(JOIN * join, ref_pointer_array[i], no_matter_name, list_ref)); - if (!abort_on_null && select_lex->ref_pointer_array[i]->maybe_null()) + if (!is_top_level_item() && select_lex->ref_pointer_array[i]->maybe_null()) { Item *having_col_item= new (thd->mem_root) @@ -2709,7 +2711,7 @@ Item_in_subselect::create_row_in_to_exists_cond(JOIN * join, } *having_item= and_items(thd, *having_item, having_col_item); } - if (!abort_on_null && left_expr->element_index(i)->maybe_null() && + if (!is_top_level_item() && left_expr->element_index(i)->maybe_null() && get_cond_guard(i)) { if (!(item= new (thd->mem_root) @@ -3678,7 +3680,7 @@ bool Item_in_subselect::init_cond_guards() { DBUG_ASSERT(thd); uint cols_num= left_expr->cols(); - if (!abort_on_null && !pushed_cond_guards && + if (!is_top_level_item() && !pushed_cond_guards && (left_expr->maybe_null() || cols_num > 1)) { if (!(pushed_cond_guards= (bool*)thd->alloc(sizeof(bool) * cols_num))) @@ -4260,9 +4262,9 @@ bool subselect_uniquesubquery_engine::copy_ref_key(bool skip_constants) - NULL if select produces empty row set - FALSE otherwise. - In some cases (IN subselect is a top level item, i.e. abort_on_null==TRUE) - the caller doesn't distinguish between NULL and FALSE result and we just - return FALSE. + In some cases (IN subselect is a top level item, i.e. + is_top_level_item() == TRUE, the caller doesn't distinguish between NULL and + FALSE result and we just return FALSE. Otherwise we make a full table scan to see if there is at least one matching row. @@ -5117,7 +5119,7 @@ my_bitmap_init_memroot(MY_BITMAP *map, uint n_bits, MEM_ROOT *mem_root) if (!(bitmap_buf= (my_bitmap_map*) alloc_root(mem_root, bitmap_buffer_size(n_bits))) || - my_bitmap_init(map, bitmap_buf, n_bits, FALSE)) + my_bitmap_init(map, bitmap_buf, n_bits)) return TRUE; bitmap_clear_all(map); return FALSE; @@ -6010,7 +6012,7 @@ bool Ordered_key::alloc_keys_buffers() lookup offset. */ /* Notice that max_null_row is max array index, we need count, so +1. */ - if (my_bitmap_init(&null_key, NULL, (uint)(max_null_row + 1), FALSE)) + if (my_bitmap_init(&null_key, NULL, (uint)(max_null_row + 1))) return TRUE; cur_key_idx= HA_POS_ERROR; diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 426b76f8067..54e4f8f0ced 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -373,7 +373,6 @@ class Item_exists_subselect :public Item_subselect protected: Item_func_not *upper_not; bool value; /* value of this item (boolean: exists/not-exists) */ - bool abort_on_null; void init_length_and_dec(); bool select_prepare_to_be_in(); @@ -397,7 +396,7 @@ public: Item_exists_subselect(THD *thd_arg, st_select_lex *select_lex); Item_exists_subselect(THD *thd_arg): - Item_subselect(thd_arg), upper_not(NULL), abort_on_null(0), + Item_subselect(thd_arg), upper_not(NULL), emb_on_expr_nest(NULL), optimizer(0), exists_transformed(0) {} @@ -424,8 +423,6 @@ public: bool fix_length_and_dec() override; void print(String *str, enum_query_type query_type) override; bool select_transformer(JOIN *join) override; - void top_level_item() override { abort_on_null=1; } - bool is_top_level_item() const override { return abort_on_null; } bool exists2in_processor(void *opt_arg) override; Item* expr_cache_insert_transformer(THD *thd, uchar *unused) override; diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc index 2f4d34afc6d..a130be4f973 100644 --- a/sql/item_xmlfunc.cc +++ b/sql/item_xmlfunc.cc @@ -1232,13 +1232,13 @@ my_xpath_keyword(MY_XPATH *x, static Item *create_func_true(MY_XPATH *xpath, Item **args, uint nargs) { - return (Item*) &Item_true; + return (Item*) Item_true; } static Item *create_func_false(MY_XPATH *xpath, Item **args, uint nargs) { - return (Item*) &Item_false; + return (Item*) Item_false; } diff --git a/sql/json_table.cc b/sql/json_table.cc index aebc52b0832..e57dccd00c4 100644 --- a/sql/json_table.cc +++ b/sql/json_table.cc @@ -835,8 +835,7 @@ TABLE *create_table_for_function(THD *thd, TABLE_LIST *sql_table) my_bitmap_map* bitmaps= (my_bitmap_map*) thd->alloc(bitmap_buffer_size(field_count)); - my_bitmap_init(&table->def_read_set, (my_bitmap_map*) bitmaps, field_count, - FALSE); + my_bitmap_init(&table->def_read_set, (my_bitmap_map*) bitmaps, field_count); table->read_set= &table->def_read_set; bitmap_clear_all(table->read_set); table->alias_name_used= true; diff --git a/sql/lex.h b/sql/lex.h index cbf9d9d51b2..4ce88ccc2ee 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -110,6 +110,7 @@ SYMBOL symbols[] = { { "CHAIN", SYM(CHAIN_SYM)}, { "CHANGE", SYM(CHANGE)}, { "CHANGED", SYM(CHANGED)}, + { "CHANNEL", SYM(CHANNEL_SYM)}, { "CHAR", SYM(CHAR_SYM)}, { "CHARACTER", SYM(CHAR_SYM)}, { "CHARSET", SYM(CHARSET)}, @@ -567,6 +568,8 @@ SYMBOL symbols[] = { { "ROWTYPE", SYM(ROWTYPE_MARIADB_SYM)}, { "ROW_COUNT", SYM(ROW_COUNT_SYM)}, { "ROW_FORMAT", SYM(ROW_FORMAT_SYM)}, + /** sql_function and condition_property_name for GET DIAGNOSTICS */ + { "ROW_NUMBER", SYM(ROW_NUMBER_SYM)}, { "RTREE", SYM(RTREE_SYM)}, { "SAVEPOINT", SYM(SAVEPOINT_SYM)}, { "SCHEDULE", SYM(SCHEDULE_SYM)}, @@ -781,7 +784,6 @@ SYMBOL sql_functions[] = { { "PERCENTILE_CONT", SYM(PERCENTILE_CONT_SYM)}, { "PERCENTILE_DISC", SYM(PERCENTILE_DISC_SYM)}, { "RANK", SYM(RANK_SYM)}, - { "ROW_NUMBER", SYM(ROW_NUMBER_SYM)}, { "SESSION_USER", SYM(USER_SYM)}, { "STD", SYM(STD_SYM)}, { "STDDEV", SYM(STD_SYM)}, diff --git a/sql/lock.cc b/sql/lock.cc index f6cdd40fa0b..2eba5df35f1 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -1,6 +1,6 @@ /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. - Copyright (c) 2020, MariaDB + Copyright (c) 2020, 2021, 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 @@ -1138,6 +1138,9 @@ void Global_read_lock::unlock_global_read_lock(THD *thd) else if (WSREP_NNULL(thd) && server_state.state() == Wsrep_server_state::s_synced) { + THD_STAGE_INFO(thd, stage_waiting_flow); + WSREP_DEBUG("unlock_global_read_lock: waiting for flow control for %s", + wsrep_thd_query(thd)); server_state.resume_and_resync(); wsrep_locked_seqno= WSREP_SEQNO_UNDEFINED; } diff --git a/sql/log_event.cc b/sql/log_event.cc index b0d47ff496b..afca79b008a 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -3321,8 +3321,7 @@ Rows_log_event::Rows_log_event(const uchar *buf, uint event_len, /* if my_bitmap_init fails, caught in is_valid() */ if (likely(!my_bitmap_init(&m_cols, m_width <= sizeof(m_bitbuf)*8 ? m_bitbuf : NULL, - m_width, - false))) + m_width))) { DBUG_PRINT("debug", ("Reading from %p", ptr_after_width)); memcpy(m_cols.bitmap, ptr_after_width, (m_width + 7) / 8); @@ -3346,8 +3345,7 @@ Rows_log_event::Rows_log_event(const uchar *buf, uint event_len, /* if my_bitmap_init fails, caught in is_valid() */ if (likely(!my_bitmap_init(&m_cols_ai, m_width <= sizeof(m_bitbuf_ai)*8 ? m_bitbuf_ai : NULL, - m_width, - false))) + m_width))) { DBUG_PRINT("debug", ("Reading from %p", ptr_after_width)); memcpy(m_cols_ai.bitmap, ptr_after_width, (m_width + 7) / 8); diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc index 4e6b9e3f1c8..1990103598e 100644 --- a/sql/log_event_old.cc +++ b/sql/log_event_old.cc @@ -1156,8 +1156,7 @@ Old_rows_log_event::Old_rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid, /* if my_bitmap_init fails, caught in is_valid() */ if (likely(!my_bitmap_init(&m_cols, m_width <= sizeof(m_bitbuf)*8 ? m_bitbuf : NULL, - m_width, - false))) + m_width))) { /* Cols can be zero if this is a dummy binrows event */ if (likely(cols != NULL)) @@ -1232,8 +1231,7 @@ Old_rows_log_event::Old_rows_log_event(const uchar *buf, uint event_len, /* if my_bitmap_init fails, caught in is_valid() */ if (likely(!my_bitmap_init(&m_cols, m_width <= sizeof(m_bitbuf)*8 ? m_bitbuf : NULL, - m_width, - false))) + m_width))) { DBUG_PRINT("debug", ("Reading from %p", ptr_after_width)); memcpy(m_cols.bitmap, ptr_after_width, (m_width + 7) / 8); diff --git a/sql/log_event_server.cc b/sql/log_event_server.cc index 786b1d08aa9..5bdded3f529 100644 --- a/sql/log_event_server.cc +++ b/sql/log_event_server.cc @@ -5225,8 +5225,7 @@ Rows_log_event::Rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid, /* if my_bitmap_init fails, caught in is_valid() */ if (likely(!my_bitmap_init(&m_cols, m_width <= sizeof(m_bitbuf)*8 ? m_bitbuf : NULL, - m_width, - false))) + m_width))) { /* Cols can be zero if this is a dummy binrows event */ if (likely(cols != NULL)) @@ -8281,8 +8280,7 @@ void Update_rows_log_event::init(MY_BITMAP const *cols) /* if my_bitmap_init fails, caught in is_valid() */ if (likely(!my_bitmap_init(&m_cols_ai, m_width <= sizeof(m_bitbuf_ai)*8 ? m_bitbuf_ai : NULL, - m_width, - false))) + m_width))) { /* Cols can be zero if this is a dummy binrows event */ if (likely(cols != NULL)) diff --git a/sql/mdl.cc b/sql/mdl.cc index dc1d658b0b5..7f170a56d7a 100644 --- a/sql/mdl.cc +++ b/sql/mdl.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2007, 2012, Oracle and/or its affiliates. - Copyright (c) 2020, MariaDB + Copyright (c) 2020, 2021, 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 @@ -2304,6 +2304,20 @@ MDL_context::acquire_lock(MDL_request *mdl_request, double lock_wait_timeout) DBUG_RETURN(TRUE); } +#ifdef WITH_WSREP + if (WSREP(get_thd())) + { + THD* requester= get_thd(); + bool requester_toi= wsrep_thd_is_toi(requester) || wsrep_thd_is_applying(requester); + WSREP_DEBUG("::acquire_lock is TOI %d for %s", requester_toi, + wsrep_thd_query(requester)); + if (requester_toi) + THD_STAGE_INFO(requester, stage_waiting_ddl); + else + THD_STAGE_INFO(requester, stage_waiting_isolation); + } +#endif /* WITH_WSREP */ + lock->m_waiting.add_ticket(ticket); /* diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 820ff51515a..e3d474150d2 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -369,6 +369,7 @@ uint volatile global_disable_checkpoint; ulong slow_start_timeout; #endif static MEM_ROOT startup_root; +MEM_ROOT read_only_root; /** @brief 'grant_option' is used to indicate if privileges needs @@ -641,7 +642,23 @@ struct system_variables max_system_variables; struct system_status_var global_status_var; MY_TMPDIR mysql_tmpdir_list; -MY_BITMAP temp_pool; +static MY_BITMAP temp_pool; +static mysql_mutex_t LOCK_temp_pool; + +void temp_pool_clear_bit(uint bit) +{ + mysql_mutex_lock(&LOCK_temp_pool); + bitmap_clear_bit(&temp_pool, bit); + mysql_mutex_unlock(&LOCK_temp_pool); +} + +uint temp_pool_set_next() +{ + mysql_mutex_lock(&LOCK_temp_pool); + uint res= bitmap_set_next(&temp_pool); + mysql_mutex_unlock(&LOCK_temp_pool); + return res; +} CHARSET_INFO *system_charset_info, *files_charset_info ; CHARSET_INFO *national_charset_info, *table_alias_charset; @@ -888,7 +905,7 @@ PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_xid_list, key_LOCK_manager, key_LOCK_backup_log, key_LOCK_prepared_stmt_count, key_LOCK_rpl_status, key_LOCK_server_started, - key_LOCK_status, + key_LOCK_status, key_LOCK_temp_pool, key_LOCK_system_variables_hash, key_LOCK_thd_data, key_LOCK_thd_kill, key_LOCK_user_conn, key_LOCK_uuid_short_generator, key_LOG_LOCK_log, key_master_info_data_lock, key_master_info_run_lock, @@ -946,6 +963,7 @@ static PSI_mutex_info all_server_mutexes[]= { &key_hash_filo_lock, "hash_filo::lock", 0}, { &key_LOCK_active_mi, "LOCK_active_mi", PSI_FLAG_GLOBAL}, { &key_LOCK_backup_log, "LOCK_backup_log", PSI_FLAG_GLOBAL}, + { &key_LOCK_temp_pool, "LOCK_temp_pool", PSI_FLAG_GLOBAL}, { &key_LOCK_thread_id, "LOCK_thread_id", PSI_FLAG_GLOBAL}, { &key_LOCK_crypt, "LOCK_crypt", PSI_FLAG_GLOBAL}, { &key_LOCK_delayed_create, "LOCK_delayed_create", PSI_FLAG_GLOBAL}, @@ -1971,6 +1989,8 @@ static void clean_up(bool print_message) mysql_library_end(); finish_client_errs(); free_root(&startup_root, MYF(0)); + protect_root(&read_only_root, PROT_READ | PROT_WRITE); + free_root(&read_only_root, MYF(0)); cleanup_errmsgs(); free_error_messages(); /* Tell main we are ready */ @@ -2050,6 +2070,7 @@ static void clean_up_mutexes() mysql_mutex_destroy(&LOCK_active_mi); mysql_rwlock_destroy(&LOCK_ssl_refresh); mysql_mutex_destroy(&LOCK_backup_log); + mysql_mutex_destroy(&LOCK_temp_pool); mysql_rwlock_destroy(&LOCK_sys_init_connect); mysql_rwlock_destroy(&LOCK_sys_init_slave); mysql_mutex_destroy(&LOCK_global_system_variables); @@ -3352,7 +3373,6 @@ SHOW_VAR com_status_vars[]= { {"alter_server", STMT_STATUS(SQLCOM_ALTER_SERVER)}, {"alter_sequence", STMT_STATUS(SQLCOM_ALTER_SEQUENCE)}, {"alter_table", STMT_STATUS(SQLCOM_ALTER_TABLE)}, - {"alter_tablespace", STMT_STATUS(SQLCOM_ALTER_TABLESPACE)}, {"alter_user", STMT_STATUS(SQLCOM_ALTER_USER)}, {"analyze", STMT_STATUS(SQLCOM_ANALYZE)}, {"assign_to_keycache", STMT_STATUS(SQLCOM_ASSIGN_TO_KEYCACHE)}, @@ -3721,6 +3741,8 @@ static int init_early_variables() set_malloc_size_cb(my_malloc_size_cb_func); global_status_var.global_memory_used= 0; init_alloc_root(PSI_NOT_INSTRUMENTED, &startup_root, 1024, 0, MYF(0)); + init_alloc_root(PSI_NOT_INSTRUMENTED, &read_only_root, 1024, 0, + MYF(MY_ROOT_USE_MPROTECT)); return 0; } @@ -4225,7 +4247,7 @@ static int init_common_variables() #endif /* defined(ENABLED_DEBUG_SYNC) */ #if (ENABLE_TEMP_POOL) - if (use_temp_pool && my_bitmap_init(&temp_pool,0,1024,1)) + if (use_temp_pool && my_bitmap_init(&temp_pool,0,1024)) return 1; #else use_temp_pool= 0; @@ -4352,6 +4374,7 @@ static int init_thread_environment() mysql_mutex_init(key_LOCK_commit_ordered, &LOCK_commit_ordered, MY_MUTEX_INIT_SLOW); mysql_mutex_init(key_LOCK_backup_log, &LOCK_backup_log, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_temp_pool, &LOCK_temp_pool, MY_MUTEX_INIT_FAST); #ifdef HAVE_OPENSSL mysql_mutex_init(key_LOCK_des_key_file, @@ -5370,6 +5393,10 @@ static int init_server_components() if (!opt_bootstrap) servers_init(0); init_status_vars(); + Item_false= new (&read_only_root) Item_bool_static("FALSE", 0); + Item_true= new (&read_only_root) Item_bool_static("TRUE", 1); + DBUG_ASSERT(Item_false); + DBUG_RETURN(0); } @@ -5733,6 +5760,9 @@ int mysqld_main(int argc, char **argv) } #endif /* WITH_WSREP */ + /* Protect read_only_root against writes */ + protect_root(&read_only_root, PROT_READ); + if (opt_bootstrap) { select_thread_in_use= 0; // Allow 'kill' to work @@ -9152,6 +9182,14 @@ PSI_stage_info stage_starting= { 0, "starting", 0}; PSI_stage_info stage_waiting_for_flush= { 0, "Waiting for non trans tables to be flushed", 0}; PSI_stage_info stage_waiting_for_ddl= { 0, "Waiting for DDLs", 0}; +#ifdef WITH_WSREP +// Aditional Galera thread states +PSI_stage_info stage_waiting_isolation= { 0, "Waiting to execute in isolation", 0}; +PSI_stage_info stage_waiting_certification= {0, "Waiting for certification", 0}; +PSI_stage_info stage_waiting_ddl= {0, "Waiting for TOI DDL", 0}; +PSI_stage_info stage_waiting_flow= {0, "Waiting for flow control", 0}; +#endif /* WITH_WSREP */ + PSI_memory_key key_memory_DATE_TIME_FORMAT; PSI_memory_key key_memory_DDL_LOG_MEMORY_ENTRY; PSI_memory_key key_memory_Event_queue_element_for_exec_names; @@ -9371,6 +9409,13 @@ PSI_stage_info *all_server_stages[]= & stage_reading_semi_sync_ack, & stage_waiting_for_deadlock_kill, & stage_starting +#ifdef WITH_WSREP + , + & stage_waiting_isolation, + & stage_waiting_certification, + & stage_waiting_ddl, + & stage_waiting_flow +#endif /* WITH_WSREP */ }; PSI_socket_key key_socket_tcpip, key_socket_unix, key_socket_client_connection; diff --git a/sql/mysqld.h b/sql/mysqld.h index d0a33fabb51..8c0b92c6446 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -1,5 +1,5 @@ /* Copyright (c) 2006, 2016, Oracle and/or its affiliates. - Copyright (c) 2010, 2020, MariaDB Corporation. + Copyright (c) 2010, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -100,7 +100,9 @@ extern CHARSET_INFO *error_message_charset_info; extern CHARSET_INFO *character_set_filesystem; -extern MY_BITMAP temp_pool; +void temp_pool_clear_bit(uint bit); +uint temp_pool_set_next(); + extern bool opt_large_files; extern bool opt_update_log, opt_bin_log, opt_error_log, opt_bin_log_compress; extern uint opt_bin_log_compress_min_len; @@ -677,6 +679,13 @@ extern PSI_stage_info stage_slave_background_process_request; extern PSI_stage_info stage_slave_background_wait_request; extern PSI_stage_info stage_waiting_for_deadlock_kill; extern PSI_stage_info stage_starting; +#ifdef WITH_WSREP +// Aditional Galera thread states +extern PSI_stage_info stage_waiting_isolation; +extern PSI_stage_info stage_waiting_certification; +extern PSI_stage_info stage_waiting_ddl; +extern PSI_stage_info stage_waiting_flow; +#endif /* WITH_WSREP */ #ifdef HAVE_PSI_STATEMENT_INTERFACE /** diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 698c709e22e..5f69f3157d9 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -1308,7 +1308,7 @@ QUICK_RANGE_SELECT::QUICK_RANGE_SELECT(THD *thd, TABLE *table, uint key_nr, *create_error= 1; } else - my_bitmap_init(&column_bitmap, bitmap, head->s->fields, FALSE); + my_bitmap_init(&column_bitmap, bitmap, head->s->fields); DBUG_VOID_RETURN; } @@ -2577,7 +2577,7 @@ static int fill_used_fields_bitmap(PARAM *param) param->fields_bitmap_size= table->s->column_bitmap_size; if (!(tmp= (my_bitmap_map*) alloc_root(param->mem_root, param->fields_bitmap_size)) || - my_bitmap_init(¶m->needed_fields, tmp, table->s->fields, FALSE)) + my_bitmap_init(¶m->needed_fields, tmp, table->s->fields)) return 1; bitmap_copy(¶m->needed_fields, table->read_set); @@ -3347,7 +3347,7 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond) my_bitmap_map* buf; if (!(buf= (my_bitmap_map*)thd->alloc(table->s->column_bitmap_size))) DBUG_RETURN(TRUE); - my_bitmap_init(&handled_columns, buf, table->s->fields, FALSE); + my_bitmap_init(&handled_columns, buf, table->s->fields); /* Calculate the selectivity of the range conditions supported by indexes. @@ -4137,7 +4137,7 @@ static int find_used_partitions_imerge_list(PART_PRUNE_PARAM *ppar, */ return find_used_partitions_imerge(ppar, merges.head()); } - my_bitmap_init(&all_merges, bitmap_buf, n_bits, FALSE); + my_bitmap_init(&all_merges, bitmap_buf, n_bits); bitmap_set_prefix(&all_merges, n_bits); List_iterator<SEL_IMERGE> it(merges); @@ -4793,8 +4793,7 @@ static bool create_partition_index_description(PART_PRUNE_PARAM *ppar) uint32 bufsize= bitmap_buffer_size(ppar->part_info->num_subparts); if (!(buf= (my_bitmap_map*) alloc_root(alloc, bufsize))) return TRUE; - my_bitmap_init(&ppar->subparts_bitmap, buf, ppar->part_info->num_subparts, - FALSE); + my_bitmap_init(&ppar->subparts_bitmap, buf, ppar->part_info->num_subparts); } range_par->key_parts= key_part; Field **field= (ppar->part_fields)? part_info->part_field_array : @@ -5620,7 +5619,7 @@ bool create_fields_bitmap(PARAM *param, MY_BITMAP *fields_bitmap) if (!(bitmap_buf= (my_bitmap_map *) alloc_root(param->mem_root, param->fields_bitmap_size))) return TRUE; - if (my_bitmap_init(fields_bitmap, bitmap_buf, param->table->s->fields, FALSE)) + if (my_bitmap_init(fields_bitmap, bitmap_buf, param->table->s->fields)) return TRUE; return FALSE; @@ -6532,7 +6531,7 @@ ROR_SCAN_INFO *make_ror_scan(const PARAM *param, int idx, SEL_ARG *sel_arg) DBUG_RETURN(NULL); if (my_bitmap_init(&ror_scan->covered_fields, bitmap_buf, - param->table->s->fields, FALSE)) + param->table->s->fields)) DBUG_RETURN(NULL); bitmap_clear_all(&ror_scan->covered_fields); @@ -6649,8 +6648,7 @@ ROR_INTERSECT_INFO* ror_intersect_init(const PARAM *param) if (!(buf= (my_bitmap_map*) alloc_root(param->mem_root, param->fields_bitmap_size))) return NULL; - if (my_bitmap_init(&info->covered_fields, buf, param->table->s->fields, - FALSE)) + if (my_bitmap_init(&info->covered_fields, buf, param->table->s->fields)) return NULL; info->is_covering= FALSE; info->index_scan_costs= 0.0; @@ -7295,7 +7293,7 @@ TRP_ROR_INTERSECT *get_best_covering_ror_intersect(PARAM *param, param->fields_bitmap_size); if (!covered_fields->bitmap || my_bitmap_init(covered_fields, covered_fields->bitmap, - param->table->s->fields, FALSE)) + param->table->s->fields)) DBUG_RETURN(0); bitmap_clear_all(covered_fields); diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 859ee5f16ff..d91557c5be2 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -4476,7 +4476,7 @@ SJ_TMP_TABLE::create_sj_weedout_tmp_table(THD *thd) STEP 1: Get temporary table name */ if (use_temp_pool && !(test_flags & TEST_KEEP_TMP_TABLES)) - temp_pool_slot = bitmap_lock_set_next(&temp_pool); + temp_pool_slot = temp_pool_set_next(); if (temp_pool_slot != MY_BIT_NONE) // we got a slot sprintf(path, "%s-subquery-%lx-%i", tmp_file_prefix, @@ -4513,7 +4513,7 @@ SJ_TMP_TABLE::create_sj_weedout_tmp_table(THD *thd) NullS)) { if (temp_pool_slot != MY_BIT_NONE) - bitmap_lock_clear_bit(&temp_pool, temp_pool_slot); + temp_pool_clear_bit(temp_pool_slot); DBUG_RETURN(TRUE); } strmov(tmpname,path); @@ -4723,7 +4723,7 @@ err: thd->mem_root= mem_root_save; free_tmp_table(thd,table); /* purecov: inspected */ if (temp_pool_slot != MY_BIT_NONE) - bitmap_lock_clear_bit(&temp_pool, temp_pool_slot); + temp_pool_clear_bit(temp_pool_slot); DBUG_RETURN(TRUE); /* purecov: inspected */ } diff --git a/sql/opt_table_elimination.cc b/sql/opt_table_elimination.cc index a6f0ac24719..8c4720bdec4 100644 --- a/sql/opt_table_elimination.cc +++ b/sql/opt_table_elimination.cc @@ -1070,7 +1070,7 @@ bool Dep_analysis_context::setup_equality_modules_deps(List<Dep_module> void *buf; if (!(buf= thd->alloc(bitmap_buffer_size(offset))) || - my_bitmap_init(&expr_deps, (my_bitmap_map*)buf, offset, FALSE)) + my_bitmap_init(&expr_deps, (my_bitmap_map*)buf, offset)) { DBUG_RETURN(TRUE); /* purecov: inspected */ } diff --git a/sql/partition_element.h b/sql/partition_element.h index e0a519065cc..c551baa3092 100644 --- a/sql/partition_element.h +++ b/sql/partition_element.h @@ -111,7 +111,6 @@ public: ha_rows part_min_rows; longlong range_value; const char *partition_name; - const char *tablespace_name; struct st_ddl_log_memory_entry *log_entry; const char* part_comment; const char* data_file_name; @@ -129,7 +128,7 @@ public: partition_element() : part_max_rows(0), part_min_rows(0), range_value(0), - partition_name(NULL), tablespace_name(NULL), + partition_name(NULL), log_entry(NULL), part_comment(NULL), data_file_name(NULL), index_file_name(NULL), engine_type(NULL), connect_string(null_clex_str), part_state(PART_NORMAL), @@ -143,7 +142,6 @@ public: : part_max_rows(part_elem->part_max_rows), part_min_rows(part_elem->part_min_rows), range_value(0), partition_name(NULL), - tablespace_name(part_elem->tablespace_name), log_entry(NULL), part_comment(part_elem->part_comment), data_file_name(part_elem->data_file_name), diff --git a/sql/partition_info.cc b/sql/partition_info.cc index fd92e437cac..62a3092f369 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -2426,7 +2426,7 @@ bool partition_info::has_same_partitioning(partition_info *new_part_info) partition_element *new_part_elem= new_part_it++; /* The following must match: - partition_name, tablespace_name, data_file_name, index_file_name, + partition_name, data_file_name, index_file_name, engine_type, part_max_rows, part_min_rows, nodegroup_id. (max_value, signed_flag, has_null_value only on partition level, RANGE/LIST) @@ -2512,9 +2512,7 @@ bool partition_info::has_same_partitioning(partition_info *new_part_info) if (strcmp_null(sub_part_elem->data_file_name, new_sub_part_elem->data_file_name) || strcmp_null(sub_part_elem->index_file_name, - new_sub_part_elem->index_file_name) || - strcmp_null(sub_part_elem->tablespace_name, - new_sub_part_elem->tablespace_name)) + new_sub_part_elem->index_file_name)) DBUG_RETURN(false); } while (++j < num_subparts); @@ -2530,9 +2528,7 @@ bool partition_info::has_same_partitioning(partition_info *new_part_info) if (strcmp_null(part_elem->data_file_name, new_part_elem->data_file_name) || strcmp_null(part_elem->index_file_name, - new_part_elem->index_file_name) || - strcmp_null(part_elem->tablespace_name, - new_part_elem->tablespace_name)) + new_part_elem->index_file_name)) DBUG_RETURN(false); } } while (++i < num_parts); diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc index 84c3109c136..da192df7aa7 100644 --- a/sql/rpl_mi.cc +++ b/sql/rpl_mi.cc @@ -1453,11 +1453,32 @@ bool Master_info_index::add_master_info(Master_info *mi, bool write_to_file) atomic */ -bool Master_info_index::remove_master_info(Master_info *mi) +bool Master_info_index::remove_master_info(Master_info *mi, bool clear_log_files) { + char tmp_name[FN_REFLEN]; DBUG_ENTER("remove_master_info"); mysql_mutex_assert_owner(&LOCK_active_mi); + if (clear_log_files) + { + /* This code is only executed when change_master() failes to create a new master info */ + + // Delete any temporary relay log files that could have been created by change_master() + mi->rli.relay_log.reset_logs(current_thd, 0, (rpl_gtid*) 0, 0, 0); + /* Delete master-'connection'.info */ + create_logfile_name_with_suffix(tmp_name, + sizeof(tmp_name), + master_info_file, 0, + &mi->cmp_connection_name); + my_delete(tmp_name, MYF(0)); + /* Delete relay-log-'connection'.info */ + create_logfile_name_with_suffix(tmp_name, + sizeof(tmp_name), + relay_log_info_file, 0, + &mi->cmp_connection_name); + my_delete(tmp_name, MYF(0)); + } + // Delete Master_info and rewrite others to file if (!my_hash_delete(&master_info_hash, (uchar*) mi)) { diff --git a/sql/rpl_mi.h b/sql/rpl_mi.h index 0d6e959838f..d2232ac2664 100644 --- a/sql/rpl_mi.h +++ b/sql/rpl_mi.h @@ -385,7 +385,7 @@ public: bool check_duplicate_master_info(LEX_CSTRING *connection_name, const char *host, uint port); bool add_master_info(Master_info *mi, bool write_to_file); - bool remove_master_info(Master_info *mi); + bool remove_master_info(Master_info *mi, bool clear_log_files); Master_info *get_master_info(const LEX_CSTRING *connection_name, Sql_condition::enum_warning_level warning); bool start_all_slaves(THD *thd); diff --git a/sql/slave.cc b/sql/slave.cc index e7aa0d4a510..38f4fd31c70 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -788,7 +788,7 @@ bool init_slave_skip_errors(const char* arg) if (!arg || !*arg) // No errors defined goto end; - if (unlikely(my_bitmap_init(&slave_error_mask,0,MAX_SLAVE_ERROR,0))) + if (my_bitmap_init(&slave_error_mask,0,MAX_SLAVE_ERROR)) DBUG_RETURN(1); use_slave_mask= 1; diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc index c4c19dd39f6..619218f3b68 100644 --- a/sql/sp_rcontext.cc +++ b/sql/sp_rcontext.cc @@ -518,7 +518,8 @@ bool sp_rcontext::handle_sql_condition(THD *thd, found_condition= new (callers_arena->mem_root) Sql_condition(callers_arena->mem_root, da->get_error_condition_identity(), - da->message()); + da->message(), + da->current_row_for_warning()); } } else if (da->current_statement_warn_count()) diff --git a/sql/sql_array.h b/sql/sql_array.h index 8610e971016..0995653e1d7 100644 --- a/sql/sql_array.h +++ b/sql/sql_array.h @@ -122,8 +122,8 @@ public: Dynamic_array(MEM_ROOT *root, uint prealloc=16, uint increment=16) { void *init_buffer= alloc_root(root, sizeof(Elem) * prealloc); - init_dynamic_array2(root->m_psi_key, &array, sizeof(Elem), init_buffer, - prealloc, increment, MYF(0)); + init_dynamic_array2(root->psi_key, &array, sizeof(Elem), init_buffer, + prealloc, increment, MYF(0)); } void init(PSI_memory_key psi_key, uint prealloc=16, uint increment=16) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 9f15d2500d7..e1221fb6f6e 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -7438,7 +7438,7 @@ store_top_level_join_columns(THD *thd, TABLE_LIST *table_ref, /* Add a TRUE condition to outer joins that have no common columns. */ if (table_ref_2->outer_join && !table_ref_1->on_expr && !table_ref_2->on_expr) - table_ref_2->on_expr= (Item*) &Item_true; + table_ref_2->on_expr= (Item*) Item_true; /* Change this table reference to become a leaf for name resolution. */ if (left_neighbor) diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 7c0879af8c9..31f5faa72ed 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -748,8 +748,7 @@ THD::THD(my_thread_id id, bool is_wsrep_applier) will be re-initialized in init_for_queries(). */ init_sql_alloc(key_memory_thd_main_mem_root, - &main_mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0, - MYF(MY_THREAD_SPECIFIC)); + &main_mem_root, 64, 0, MYF(MY_THREAD_SPECIFIC)); /* Allocation of user variables for binary logging is always done with main diff --git a/sql/sql_class.h b/sql/sql_class.h index b5874d2435a..e569fcd32d6 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -3049,8 +3049,8 @@ public: { bzero((char*)this, sizeof(*this)); implicit_xid.null(); - init_sql_alloc(key_memory_thd_transactions, &mem_root, - ALLOC_ROOT_MIN_BLOCK_SIZE, 0, MYF(MY_THREAD_SPECIFIC)); + init_sql_alloc(key_memory_thd_transactions, &mem_root, 256, + 0, MYF(MY_THREAD_SPECIFIC)); } } default_transaction, *transaction; Global_read_lock global_read_lock; diff --git a/sql/sql_cmd.h b/sql/sql_cmd.h index ce34852117f..430afadb491 100644 --- a/sql/sql_cmd.h +++ b/sql/sql_cmd.h @@ -75,7 +75,6 @@ enum enum_sql_command { SQLCOM_XA_START, SQLCOM_XA_END, SQLCOM_XA_PREPARE, SQLCOM_XA_COMMIT, SQLCOM_XA_ROLLBACK, SQLCOM_XA_RECOVER, SQLCOM_SHOW_PROC_CODE, SQLCOM_SHOW_FUNC_CODE, - SQLCOM_ALTER_TABLESPACE, SQLCOM_INSTALL_PLUGIN, SQLCOM_UNINSTALL_PLUGIN, SQLCOM_SHOW_AUTHORS, SQLCOM_BINLOG_BASE64_EVENT, SQLCOM_SHOW_PLUGINS, SQLCOM_SHOW_CONTRIBUTORS, diff --git a/sql/sql_error.cc b/sql/sql_error.cc index cef9e6cec00..7b6e6a83d2f 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -672,7 +672,8 @@ Sql_condition *Warning_info::push_warning(THD *thd, if (m_allow_unlimited_warnings || m_warn_list.elements() < thd->variables.max_error_count) { - cond= new (& m_warn_root) Sql_condition(& m_warn_root, *value, msg); + cond= new (& m_warn_root) Sql_condition(& m_warn_root, *value, msg, + m_current_row_for_warning); if (cond) m_warn_list.push_back(cond); } diff --git a/sql/sql_error.h b/sql/sql_error.h index 6b0d4d7749c..e7f1a27a6a7 100644 --- a/sql/sql_error.h +++ b/sql/sql_error.h @@ -306,6 +306,9 @@ protected: /** SQL CURSOR_NAME condition item. */ String m_cursor_name; + /** SQL ROW_NUMBER condition item. */ + ulong m_row_number; + Sql_condition_items() :m_class_origin((const char*) NULL, 0, & my_charset_utf8mb3_bin), m_subclass_origin((const char*) NULL, 0, & my_charset_utf8mb3_bin), @@ -316,7 +319,8 @@ protected: m_schema_name((const char*) NULL, 0, & my_charset_utf8mb3_bin), m_table_name((const char*) NULL, 0, & my_charset_utf8mb3_bin), m_column_name((const char*) NULL, 0, & my_charset_utf8mb3_bin), - m_cursor_name((const char*) NULL, 0, & my_charset_utf8mb3_bin) + m_cursor_name((const char*) NULL, 0, & my_charset_utf8mb3_bin), + m_row_number(0) { } void clear() @@ -331,6 +335,7 @@ protected: m_table_name.length(0); m_column_name.length(0); m_cursor_name.length(0); + m_row_number= 0; } }; @@ -434,16 +439,15 @@ private: @param level - the error level for this condition @param msg - the message text for this condition */ - Sql_condition(MEM_ROOT *mem_root, - const Sql_condition_identity &value, - const char *msg) - :Sql_condition_identity(value), - m_mem_root(mem_root) + Sql_condition(MEM_ROOT *mem_root, const Sql_condition_identity &value, + const char *msg, ulong current_row_for_warning) + : Sql_condition_identity(value), m_mem_root(mem_root) { DBUG_ASSERT(mem_root != NULL); DBUG_ASSERT(value.get_sql_errno() != 0); DBUG_ASSERT(msg != NULL); set_builtin_message_text(msg); + m_row_number= current_row_for_warning; } /** Destructor. */ diff --git a/sql/sql_get_diagnostics.cc b/sql/sql_get_diagnostics.cc index 197bf5e7a00..240975d2974 100644 --- a/sql/sql_get_diagnostics.cc +++ b/sql/sql_get_diagnostics.cc @@ -338,6 +338,8 @@ Condition_information_item::get_value(THD *thd, const Sql_condition *cond) str.set_ascii(cond->get_sqlstate(), strlen(cond->get_sqlstate())); value= make_utf8_string_item(thd, &str); break; + case ROW_NUMBER: + value= new (thd->mem_root) Item_uint(thd, cond->m_row_number); } DBUG_RETURN(value); diff --git a/sql/sql_get_diagnostics.h b/sql/sql_get_diagnostics.h index f283aa5b2c6..efe526d7c61 100644 --- a/sql/sql_get_diagnostics.h +++ b/sql/sql_get_diagnostics.h @@ -254,7 +254,8 @@ public: CURSOR_NAME, MESSAGE_TEXT, MYSQL_ERRNO, - RETURNED_SQLSTATE + RETURNED_SQLSTATE, + ROW_NUMBER }; /** diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index b5bc0c037ad..a3f4e67405a 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -699,7 +699,6 @@ bool mysql_insert(THD *thd, TABLE_LIST *table_list, const bool was_insert_delayed= (table_list->lock_type == TL_WRITE_DELAYED); bool using_bulk_insert= 0; uint value_count; - ulong counter = 1; /* counter of iteration in bulk PS operation*/ ulonglong iteration= 0; ulonglong id; @@ -830,10 +829,11 @@ bool mysql_insert(THD *thd, TABLE_LIST *table_list, while ((values= its++)) { - counter++; + thd->get_stmt_da()->inc_current_row_for_warning(); if (values->elements != value_count) { - my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), counter); + my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), + thd->get_stmt_da()->current_row_for_warning()); goto abort; } if (setup_fields(thd, Ref_ptr_array(), @@ -842,6 +842,7 @@ bool mysql_insert(THD *thd, TABLE_LIST *table_list, switch_to_nullable_trigger_fields(*values, table); } its.rewind (); + thd->get_stmt_da()->reset_current_row_for_warning(); /* Restore the current context. */ ctx_state.restore_state(context, table_list); @@ -1402,7 +1403,7 @@ static bool check_view_insertability(THD * thd, TABLE_LIST *view) DBUG_ASSERT(view->table != 0 && view->field_translation != 0); - (void) my_bitmap_init(&used_fields, used_fields_buff, table->s->fields, 0); + (void) my_bitmap_init(&used_fields, used_fields_buff, table->s->fields); bitmap_clear_all(&used_fields); view->contain_auto_increment= 0; @@ -2774,7 +2775,7 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd) my_bitmap_init(©->has_value_set, (my_bitmap_map*) (bitmap + bitmaps_used*share->column_bitmap_size), - share->fields, FALSE); + share->fields); } copy->tmp_set.bitmap= 0; // To catch errors bzero((char*) bitmap, share->column_bitmap_size * bitmaps_used); @@ -5059,7 +5060,8 @@ bool select_create::send_eof() { WSREP_DEBUG("select_create commit failed, thd: %llu err: %s %s", thd->thread_id, - wsrep_thd_transaction_state_str(thd), wsrep_thd_query(thd)); + wsrep_thd_transaction_state_str(thd), + wsrep_thd_query(thd)); mysql_mutex_unlock(&thd->LOCK_thd_data); abort_result_set(); DBUG_RETURN(true); diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 1fe8b869c11..ef4e738860b 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -290,7 +290,6 @@ class sp_pcontext; class sp_variable; class sp_expr_lex; class sp_assignment_lex; -class st_alter_tablespace; class partition_info; class Event_parse_data; class set_var_base; @@ -3521,12 +3520,6 @@ public: /* - Reference to a struct that contains information in various commands - to add/create/drop/change table spaces. - */ - st_alter_tablespace *alter_tablespace_info; - - /* The set of those tables whose fields are referenced in all subqueries of the query. TODO: possibly this it is incorrect to have used tables in LEX because diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 2a48c8fb1ce..b9d3eec5a60 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -54,7 +54,6 @@ // check_mqh, // reset_mqh #include "sql_rename.h" // mysql_rename_tables -#include "sql_tablespace.h" // mysql_alter_tablespace #include "hostname.h" // hostname_cache_refresh #include "sql_test.h" // mysql_print_status #include "sql_select.h" // handle_select, mysql_select, @@ -878,7 +877,6 @@ void init_update_queries(void) sql_command_flags[SQLCOM_ALTER_PROCEDURE]|= CF_DISALLOW_IN_RO_TRANS; sql_command_flags[SQLCOM_ALTER_FUNCTION]|= CF_DISALLOW_IN_RO_TRANS; sql_command_flags[SQLCOM_TRUNCATE]|= CF_DISALLOW_IN_RO_TRANS; - sql_command_flags[SQLCOM_ALTER_TABLESPACE]|= CF_DISALLOW_IN_RO_TRANS; sql_command_flags[SQLCOM_REPAIR]|= CF_DISALLOW_IN_RO_TRANS; sql_command_flags[SQLCOM_OPTIMIZE]|= CF_DISALLOW_IN_RO_TRANS; sql_command_flags[SQLCOM_GRANT]|= CF_DISALLOW_IN_RO_TRANS; @@ -4137,7 +4135,7 @@ mysql_execute_command(THD *thd, bool is_called_from_prepared_stmt) If new master was not added, we still need to free mi. */ if (master_info_added) - master_info_index->remove_master_info(mi); + master_info_index->remove_master_info(mi, 1); else delete mi; } @@ -5889,12 +5887,6 @@ mysql_execute_command(THD *thd, bool is_called_from_prepared_stmt) case SQLCOM_XA_RECOVER: res= mysql_xa_recover(thd); break; - case SQLCOM_ALTER_TABLESPACE: - if (check_global_access(thd, CREATE_TABLESPACE_ACL)) - break; - if (!(res= mysql_alter_tablespace(thd, lex->alter_tablespace_info))) - my_ok(thd); - break; case SQLCOM_INSTALL_PLUGIN: if (! (res= mysql_install_plugin(thd, &thd->lex->comment, &thd->lex->ident))) @@ -6126,7 +6118,12 @@ finish: thd->wsrep_consistency_check= NO_CONSISTENCY_CHECK; if (wsrep_thd_is_toi(thd) || wsrep_thd_is_in_rsu(thd)) + { + WSREP_DEBUG("mysql_execute_command for %s", wsrep_thd_query(thd)); + THD_STAGE_INFO(thd, stage_waiting_isolation); wsrep_to_isolation_end(thd); + } + /* Force release of transactional locks if not in active MST and wsrep is on. */ @@ -7890,7 +7887,8 @@ static bool wsrep_mysql_parse(THD *thd, char *rawbuf, uint length, DBUG_ASSERT(!debug_sync_set_action(thd, STRING_WITH_LEN(act))); }); WSREP_DEBUG("wsrep retrying AC query: %lu %s", - thd->wsrep_retry_counter, wsrep_thd_query(thd)); + thd->wsrep_retry_counter, + wsrep_thd_query(thd)); wsrep_prepare_for_autocommit_retry(thd, rawbuf, length, parser_state); if (thd->lex->explain) delete_explain_query(thd->lex); diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 0547331e7cd..3e7acef0694 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -67,7 +67,6 @@ #include "opt_range.h" // store_key_image_to_rec #include "sql_alter.h" // Alter_table_ctx #include "sql_select.h" -#include "sql_tablespace.h" // check_tablespace_name #include "ddl_log.h" #include "tztime.h" // my_tz_OFFSET0 @@ -525,7 +524,7 @@ static bool create_full_part_field_array(THD *thd, TABLE *table, goto end; } if (unlikely(my_bitmap_init(&part_info->full_part_field_set, bitmap_buf, - table->s->fields, FALSE))) + table->s->fields))) { result= TRUE; goto end; @@ -1100,10 +1099,10 @@ static bool set_up_partition_bitmaps(THD *thd, partition_info *part_info) bitmap_bytes * 2)))) DBUG_RETURN(TRUE); - my_bitmap_init(&part_info->read_partitions, bitmap_buf, bitmap_bits, FALSE); + my_bitmap_init(&part_info->read_partitions, bitmap_buf, bitmap_bits); /* Use the second half of the allocated buffer for lock_partitions */ my_bitmap_init(&part_info->lock_partitions, bitmap_buf + (bitmap_bytes / 4), - bitmap_bits, FALSE); + bitmap_bits); part_info->bitmaps_are_initialized= TRUE; part_info->set_partition_bitmaps(NULL); DBUG_RETURN(FALSE); @@ -2215,8 +2214,6 @@ static int add_partition_options(String *str, partition_element *p_elem) { int err= 0; - if (p_elem->tablespace_name) - err+= add_keyword_string(str,"TABLESPACE", false, p_elem->tablespace_name); if (p_elem->nodegroup_id != UNDEF_NODEGROUP) err+= add_keyword_int(str,"NODEGROUP",(longlong)p_elem->nodegroup_id); if (p_elem->part_max_rows) @@ -4714,8 +4711,6 @@ bool compare_partition_options(HA_CREATE_INFO *table_create_info, Note that there are not yet any engine supporting tablespace together with partitioning. TODO: when there are, add compare. */ - if (part_elem->tablespace_name || table_create_info->tablespace) - option_diffs[errors++]= "TABLESPACE"; if (part_elem->part_max_rows != table_create_info->max_rows) option_diffs[errors++]= "MAX_ROWS"; if (part_elem->part_min_rows != table_create_info->min_rows) diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 4ead77c225f..f9f008602ed 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1314,7 +1314,6 @@ static bool mysql_test_insert_common(Prepared_statement *stmt, if ((values= its++)) { uint value_count; - ulong counter= 0; Item *unused_conds= 0; if (table_list->table) @@ -1340,16 +1339,18 @@ static bool mysql_test_insert_common(Prepared_statement *stmt, } while ((values= its++)) { - counter++; if (values->elements != value_count) { - my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), counter); + my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), + thd->get_stmt_da()->current_row_for_warning()); goto error; } if (setup_fields(thd, Ref_ptr_array(), *values, COLUMNS_READ, 0, NULL, 0)) goto error; + thd->get_stmt_da()->inc_current_row_for_warning(); } + thd->get_stmt_da()->reset_current_row_for_warning(); } DBUG_RETURN(FALSE); diff --git a/sql/sql_priv.h b/sql/sql_priv.h index 2206f71c060..f7d8ef0da67 100644 --- a/sql/sql_priv.h +++ b/sql/sql_priv.h @@ -416,16 +416,6 @@ inline int hexchar_to_int(char c) /* This must match the path length limit in the ER_NOT_RW_DIR error msg. */ #define ER_NOT_RW_DIR_PATHSIZE 200 -#define IS_TABLESPACES_TABLESPACE_NAME 0 -#define IS_TABLESPACES_ENGINE 1 -#define IS_TABLESPACES_TABLESPACE_TYPE 2 -#define IS_TABLESPACES_LOGFILE_GROUP_NAME 3 -#define IS_TABLESPACES_EXTENT_SIZE 4 -#define IS_TABLESPACES_AUTOEXTEND_SIZE 5 -#define IS_TABLESPACES_MAXIMUM_SIZE 6 -#define IS_TABLESPACES_NODEGROUP_ID 7 -#define IS_TABLESPACES_TABLESPACE_COMMENT 8 - bool db_name_is_in_ignore_db_dirs_list(const char *dbase); #endif /* MYSQL_SERVER */ diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc index ddada6ad892..1dfa238de50 100644 --- a/sql/sql_reload.cc +++ b/sql/sql_reload.cc @@ -403,7 +403,7 @@ bool reload_acl_and_cache(THD *thd, unsigned long long options, /* If not default connection and 'all' is used */ mi->release(); mysql_mutex_lock(&LOCK_active_mi); - if (master_info_index->remove_master_info(mi)) + if (master_info_index->remove_master_info(mi, 0)) result= 1; mysql_mutex_unlock(&LOCK_active_mi); } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 0c6f38ffa56..ce99e68c59c 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2561,7 +2561,7 @@ int JOIN::optimize_stage2() if (!conds && outer_join) { /* Handle the case where we have an OUTER JOIN without a WHERE */ - conds= (Item*) &Item_true; + conds= (Item*) Item_true; } if (impossible_where) @@ -2731,9 +2731,7 @@ int JOIN::optimize_stage2() if (conds && const_table_map != found_const_table_map && (select_options & SELECT_DESCRIBE)) - { - conds= (Item*) &Item_false; - } + conds= (Item*) Item_false; /* Cache constant expressions in WHERE, HAVING, ON clauses. */ cache_const_exprs(); @@ -3050,7 +3048,7 @@ int JOIN::optimize_stage2() having= having->remove_eq_conds(thd, &select_lex->having_value, true); if (select_lex->having_value == Item::COND_FALSE) { - having= (Item*) &Item_false; + having= (Item*) Item_false; zero_result_cause= "Impossible HAVING noticed after reading const tables"; error= 0; select_lex->mark_const_derived(zero_result_cause); @@ -5635,7 +5633,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list, if (join->cond_value == Item::COND_FALSE) { join->impossible_where= true; - conds= (Item*) &Item_false; + conds= (Item*) Item_false; } join->cond_equal= NULL; @@ -7109,7 +7107,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab, /* set a barrier for the array of SARGABLE_PARAM */ (*sargables)[0].field= 0; - if (my_init_dynamic_array2(thd->mem_root->m_psi_key, keyuse, sizeof(KEYUSE), + if (my_init_dynamic_array2(thd->mem_root->psi_key, keyuse, sizeof(KEYUSE), thd->alloc(sizeof(KEYUSE) * 20), 20, 64, MYF(MY_THREAD_SPECIFIC))) DBUG_RETURN(TRUE); @@ -11910,7 +11908,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) below to check if we should use 'quick' instead. */ DBUG_PRINT("info", ("Item_int")); - tmp= (Item*) &Item_true; + tmp= (Item*) Item_true; } } @@ -15493,7 +15491,7 @@ COND *Item_cond_and::build_equal_items(THD *thd, if (!cond_args->elements && !cond_equal.current_level.elements && !eq_list.elements) - return (Item*) &Item_true; + return (Item*) Item_true; List_iterator_fast<Item_equal> it(cond_equal.current_level); while ((item_equal= it++)) @@ -15600,7 +15598,7 @@ COND *Item_func_eq::build_equal_items(THD *thd, Item_equal *item_equal; int n= cond_equal.current_level.elements + eq_list.elements; if (n == 0) - return (Item*) &Item_true; + return (Item*) Item_true; else if (n == 1) { if ((item_equal= cond_equal.current_level.pop())) @@ -16004,7 +16002,7 @@ Item *eliminate_item_equal(THD *thd, COND *cond, COND_EQUAL *upper_levels, List<Item> eq_list; Item_func_eq *eq_item= 0; if (((Item *) item_equal)->const_item() && !item_equal->val_int()) - return (Item*) &Item_false; + return (Item*) Item_false; Item *item_const= item_equal->get_const(); Item_equal_fields_iterator it(*item_equal); Item *head; @@ -16149,7 +16147,7 @@ Item *eliminate_item_equal(THD *thd, COND *cond, COND_EQUAL *upper_levels, switch (eq_list.elements) { case 0: - res= cond ? cond : (Item*) &Item_true; + res= cond ? cond : (Item*) Item_true; break; case 1: if (!cond || cond->is_bool_literal()) @@ -16402,9 +16400,9 @@ static void update_const_equal_items(THD *thd, COND *cond, JOIN_TAB *tab, Item *item; while ((item= li++)) update_const_equal_items(thd, item, tab, - (((Item_cond*) cond)->top_level() && - ((Item_cond*) cond)->functype() == - Item_func::COND_AND_FUNC)); + cond->is_top_level_item() && + ((Item_cond*) cond)->functype() == + Item_func::COND_AND_FUNC); } else if (cond->type() == Item::FUNC_ITEM && ((Item_func*) cond)->functype() == Item_func::MULT_EQUAL_FUNC) @@ -17987,7 +17985,7 @@ Item_func_isnull::remove_eq_conds(THD *thd, Item::cond_result *cond_value, */ - Item *item0= (Item*) &Item_false; + Item *item0= (Item*) Item_false; Item *eq_cond= new(thd->mem_root) Item_func_eq(thd, args[0], item0); if (!eq_cond) return this; @@ -18554,20 +18552,19 @@ setup_tmp_table_column_bitmaps(TABLE *table, uchar *bitmaps, uint field_count) DBUG_ASSERT(table->s->virtual_fields == 0); - my_bitmap_init(&table->def_read_set, (my_bitmap_map*) bitmaps, field_count, - FALSE); + my_bitmap_init(&table->def_read_set, (my_bitmap_map*) bitmaps, field_count); bitmaps+= bitmap_size; my_bitmap_init(&table->tmp_set, - (my_bitmap_map*) bitmaps, field_count, FALSE); + (my_bitmap_map*) bitmaps, field_count); bitmaps+= bitmap_size; my_bitmap_init(&table->eq_join_set, - (my_bitmap_map*) bitmaps, field_count, FALSE); + (my_bitmap_map*) bitmaps, field_count); bitmaps+= bitmap_size; my_bitmap_init(&table->cond_set, - (my_bitmap_map*) bitmaps, field_count, FALSE); + (my_bitmap_map*) bitmaps, field_count); bitmaps+= bitmap_size; my_bitmap_init(&table->has_value_set, - (my_bitmap_map*) bitmaps, field_count, FALSE); + (my_bitmap_map*) bitmaps, field_count); /* write_set and all_set are copies of read_set */ table->def_write_set= table->def_read_set; table->s->all_set= table->def_read_set; @@ -18690,7 +18687,7 @@ TABLE *Create_tmp_table::start(THD *thd, (ulong) m_rows_limit, MY_TEST(m_group))); if (use_temp_pool && !(test_flags & TEST_KEEP_TMP_TABLES)) - m_temp_pool_slot = bitmap_lock_set_next(&temp_pool); + m_temp_pool_slot = temp_pool_set_next(); if (m_temp_pool_slot != MY_BIT_NONE) // we got a slot sprintf(path, "%s-%s-%lx-%i", tmp_file_prefix, param->tmp_name, @@ -19600,7 +19597,7 @@ void Create_tmp_table::cleanup_on_failure(THD *thd, TABLE *table) if (table) free_tmp_table(thd, table); if (m_temp_pool_slot != MY_BIT_NONE) - bitmap_lock_clear_bit(&temp_pool, m_temp_pool_slot); + temp_pool_clear_bit(m_temp_pool_slot); } @@ -20365,7 +20362,7 @@ free_tmp_table(THD *thd, TABLE *entry) (*ptr)->free(); if (entry->temp_pool_slot != MY_BIT_NONE) - bitmap_lock_clear_bit(&temp_pool, entry->temp_pool_slot); + temp_pool_clear_bit(entry->temp_pool_slot); plugin_unlock(0, entry->s->db_plugin); entry->alias.free(); @@ -28546,7 +28543,7 @@ JOIN::reoptimize(Item *added_where, table_map join_tables, reset_query_plan(); if (!keyuse.buffer && - my_init_dynamic_array(thd->mem_root->m_psi_key, &keyuse, sizeof(KEYUSE), + my_init_dynamic_array(thd->mem_root->psi_key, &keyuse, sizeof(KEYUSE), 20, 64, MYF(MY_THREAD_SPECIFIC))) { delete_dynamic(&added_keyuse); @@ -29689,7 +29686,7 @@ void JOIN::make_notnull_conds_for_range_scans() Found a IS NULL conjunctive predicate for a null-rejected field in the WHERE clause */ - conds= (Item*) &Item_false; + conds= (Item*) Item_false; cond_equal= 0; impossible_where= true; DBUG_VOID_RETURN; @@ -29712,7 +29709,7 @@ void JOIN::make_notnull_conds_for_range_scans() Found a IS NULL conjunctive predicate for a null-rejected field of the inner table of an outer join with ON expression tbl->on_expr */ - tbl->on_expr= (Item*) &Item_false; + tbl->on_expr= (Item*) Item_false; } } } @@ -29863,7 +29860,7 @@ void build_notnull_conds_for_inner_nest_of_outer_join(JOIN *join, if (used_tables && build_notnull_conds_for_range_scans(join, nest_tbl->on_expr, used_tables)) { - nest_tbl->on_expr= (Item*) &Item_false; + nest_tbl->on_expr= (Item*) Item_false; } li.rewind(); @@ -29877,7 +29874,7 @@ void build_notnull_conds_for_inner_nest_of_outer_join(JOIN *join, } else if (build_notnull_conds_for_range_scans(join, tbl->on_expr, tbl->table->map)) - tbl->on_expr= (Item*) &Item_false; + tbl->on_expr= (Item*) Item_false; } } } diff --git a/sql/sql_show.cc b/sql/sql_show.cc index f9049f47324..7aedbcd84c7 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -7380,13 +7380,7 @@ static void store_schema_partitions_record(THD *thd, TABLE *schema_table, table->field[23]->store(STRING_WITH_LEN("default"), cs); table->field[24]->set_notnull(); - if (part_elem->tablespace_name) - table->field[24]->store(part_elem->tablespace_name, - strlen(part_elem->tablespace_name), cs); - else - { - table->field[24]->set_null(); - } + table->field[24]->set_null(); // Tablespace } return; } @@ -8217,8 +8211,7 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list) DBUG_RETURN(0); my_bitmap_map* bitmaps= (my_bitmap_map*) thd->alloc(bitmap_buffer_size(field_count)); - my_bitmap_init(&table->def_read_set, (my_bitmap_map*) bitmaps, field_count, - FALSE); + my_bitmap_init(&table->def_read_set, (my_bitmap_map*) bitmaps, field_count); table->read_set= &table->def_read_set; bitmap_clear_all(table->read_set); table_list->schema_table_param= tmp_table_param; diff --git a/sql/sql_signal.cc b/sql/sql_signal.cc index 8e973f9b0b3..e023923bd1a 100644 --- a/sql/sql_signal.cc +++ b/sql/sql_signal.cc @@ -419,7 +419,8 @@ bool Sql_cmd_resignal::execute(THD *thd) DBUG_RETURN(result); } - Sql_condition signaled_err(thd->mem_root, *signaled, signaled->message); + Sql_condition signaled_err(thd->mem_root, *signaled, signaled->message, + da->current_row_for_warning()); if (m_cond) { diff --git a/sql/sql_table.cc b/sql/sql_table.cc index db6084f3bd8..9131f16abb3 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -11468,16 +11468,11 @@ bool check_engine(THD *thd, const char *db_name, if (create_info->tmp_table() && ha_check_storage_engine_flag(*new_engine, HTON_TEMPORARY_NOT_SUPPORTED)) { - if (create_info->used_fields & HA_CREATE_USED_ENGINE) - { - my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0), - hton_name(*new_engine)->str, "TEMPORARY"); - *new_engine= 0; - DBUG_RETURN(true); - } - *new_engine= myisam_hton; + my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0), + hton_name(*new_engine)->str, "TEMPORARY"); + *new_engine= 0; + DBUG_RETURN(true); } - lex_string_set(&create_info->new_storage_engine_name, ha_resolve_storage_engine_name(*new_engine)); DBUG_RETURN(false); diff --git a/sql/sql_tablespace.cc b/sql/sql_tablespace.cc deleted file mode 100644 index bfbaf185243..00000000000 --- a/sql/sql_tablespace.cc +++ /dev/null @@ -1,72 +0,0 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */ - -/* drop and alter of tablespaces */ - -#include "mariadb.h" -#include "sql_priv.h" -#include "unireg.h" -#include "sql_tablespace.h" -#include "sql_table.h" // write_bin_log -#include "sql_class.h" // THD - -int mysql_alter_tablespace(THD *thd, st_alter_tablespace *ts_info) -{ - int error= HA_ADMIN_NOT_IMPLEMENTED; - handlerton *hton= ts_info->storage_engine; - - DBUG_ENTER("mysql_alter_tablespace"); - /* - If the user haven't defined an engine, this will fallback to using the - default storage engine. - */ - if (hton == NULL) - { - hton= ha_default_handlerton(thd); - if (ts_info->storage_engine != 0) - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_WARN_USING_OTHER_HANDLER, - ER_THD(thd, ER_WARN_USING_OTHER_HANDLER), - hton_name(hton)->str, - ts_info->tablespace_name ? ts_info->tablespace_name - : ts_info->logfile_group_name); - } - - if (hton->alter_tablespace) - { - if (unlikely((error= hton->alter_tablespace(hton, thd, ts_info)))) - { - if (error == 1) - DBUG_RETURN(1); - - if (error == HA_ADMIN_NOT_IMPLEMENTED) - my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), ""); - else - my_error(error, MYF(0)); - - DBUG_RETURN(error); - } - } - else - { - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_ILLEGAL_HA_CREATE_OPTION, - ER_THD(thd, ER_ILLEGAL_HA_CREATE_OPTION), - hton_name(hton)->str, - "TABLESPACE or LOGFILE GROUP"); - } - error= write_bin_log(thd, FALSE, thd->query(), thd->query_length()); - DBUG_RETURN(error); -} diff --git a/sql/sql_tablespace.h b/sql/sql_tablespace.h deleted file mode 100644 index 0760935edfc..00000000000 --- a/sql/sql_tablespace.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */ - -#ifndef SQL_TABLESPACE_INCLUDED -#define SQL_TABLESPACE_INCLUDED - -class THD; -class st_alter_tablespace; - -int mysql_alter_tablespace(THD* thd, st_alter_tablespace *ts_info); - -#endif /* SQL_TABLESPACE_INCLUDED */ diff --git a/sql/sql_update.cc b/sql/sql_update.cc index f5aec151686..76b07284a37 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -271,7 +271,7 @@ static void prepare_record_for_error_message(int error, TABLE *table) DBUG_VOID_RETURN; /* Create unique_map with all fields used by that index. */ - my_bitmap_init(&unique_map, unique_map_buf, table->s->fields, FALSE); + my_bitmap_init(&unique_map, unique_map_buf, table->s->fields); table->mark_index_columns(keynr, &unique_map); /* Subtract read_set and write_set. */ diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 27d8dd94af1..9281563969f 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -782,6 +782,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %token <kwd> CATALOG_NAME_SYM /* SQL-2003-N */ %token <kwd> CHAIN_SYM /* SQL-2003-N */ %token <kwd> CHANGED +%token <kwd> CHANNEL_SYM %token <kwd> CHARSET %token <kwd> CHECKPOINT_SYM %token <kwd> CHECKSUM_SYM @@ -1463,7 +1464,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); field_options last_field_options %type <ulonglong_number> - ulonglong_num real_ulonglong_num size_number + ulonglong_num real_ulonglong_num %type <longlong_number> longlong_num @@ -2080,6 +2081,7 @@ change: Lex->sql_command = SQLCOM_CHANGE_MASTER; } master_defs + optional_for_channel {} ; @@ -2311,6 +2313,34 @@ connection_name: } ; +optional_for_channel: + /* empty */ + { + /*do nothing */ + } + | for_channel + + ; + +for_channel: + FOR_SYM CHANNEL_SYM TEXT_STRING_sys + { + if (Lex->mi.connection_name.str != NULL) + { + my_yyabort_error((ER_WRONG_ARGUMENTS, MYF(0), "CONNECTION_NAME AND FOR CHANNEL CAN NOT BE SPECIFIED AT THE SAME TIME)")); + } + else + { + Lex->mi.connection_name= $3; +#ifdef HAVE_REPLICATION + if (unlikely(check_master_connection_name(&$3))) + my_yyabort_error((ER_WRONG_ARGUMENTS, MYF(0), "MASTER_CONNECTION_NAME")); +#endif + } + + } + ; + /* create a table */ create: @@ -2552,14 +2582,6 @@ create: $1 | $3))) MYSQL_YYABORT; } - | CREATE LOGFILE_SYM GROUP_SYM logfile_group_info - { - Lex->alter_tablespace_info->ts_cmd_type= CREATE_LOGFILE_GROUP; - } - | CREATE TABLESPACE tablespace_info - { - Lex->alter_tablespace_info->ts_cmd_type= CREATE_TABLESPACE; - } | create_or_replace { Lex->set_command(SQLCOM_CREATE_SERVER, $1); } server_def { } @@ -3609,6 +3631,8 @@ condition_information_item_name: { $$= Condition_information_item::MYSQL_ERRNO; } | RETURNED_SQLSTATE_SYM { $$= Condition_information_item::RETURNED_SQLSTATE; } + | ROW_NUMBER_SYM + { $$= Condition_information_item::ROW_NUMBER; } ; sp_decl_ident: @@ -4308,350 +4332,6 @@ trg_event: | DELETE_SYM { Lex->trg_chistics.event= TRG_EVENT_DELETE; } ; -/* - This part of the parser contains common code for all TABLESPACE - commands. - CREATE TABLESPACE name ... - ALTER TABLESPACE name CHANGE DATAFILE ... - ALTER TABLESPACE name ADD DATAFILE ... - ALTER TABLESPACE name access_mode - CREATE LOGFILE GROUP_SYM name ... - ALTER LOGFILE GROUP_SYM name ADD UNDOFILE .. - ALTER LOGFILE GROUP_SYM name ADD REDOFILE .. - DROP TABLESPACE name - DROP LOGFILE GROUP_SYM name -*/ -change_tablespace_access: - tablespace_name - ts_access_mode - ; - -change_tablespace_info: - tablespace_name - CHANGE ts_datafile - change_ts_option_list - ; - -tablespace_info: - tablespace_name - ADD ts_datafile - opt_logfile_group_name - tablespace_option_list - ; - -opt_logfile_group_name: - /* empty */ {} - | USE_SYM LOGFILE_SYM GROUP_SYM ident - { - LEX *lex= Lex; - lex->alter_tablespace_info->logfile_group_name= $4.str; - } - ; - -alter_tablespace_info: - tablespace_name - ADD ts_datafile - alter_tablespace_option_list - { - Lex->alter_tablespace_info->ts_alter_tablespace_type= ALTER_TABLESPACE_ADD_FILE; - } - | tablespace_name - DROP ts_datafile - alter_tablespace_option_list - { - Lex->alter_tablespace_info->ts_alter_tablespace_type= ALTER_TABLESPACE_DROP_FILE; - } - ; - -logfile_group_info: - logfile_group_name - add_log_file - logfile_group_option_list - ; - -alter_logfile_group_info: - logfile_group_name - add_log_file - alter_logfile_group_option_list - ; - -add_log_file: - ADD lg_undofile - | ADD lg_redofile - ; - -change_ts_option_list: - /* empty */ {} - change_ts_options - ; - -change_ts_options: - change_ts_option - | change_ts_options change_ts_option - | change_ts_options ',' change_ts_option - ; - -change_ts_option: - opt_ts_initial_size - | opt_ts_autoextend_size - | opt_ts_max_size - ; - -tablespace_option_list: - tablespace_options - ; - -tablespace_options: - tablespace_option - | tablespace_options tablespace_option - | tablespace_options ',' tablespace_option - ; - -tablespace_option: - opt_ts_initial_size - | opt_ts_autoextend_size - | opt_ts_max_size - | opt_ts_extent_size - | opt_ts_nodegroup - | opt_ts_engine - | ts_wait - | opt_ts_comment - ; - -alter_tablespace_option_list: - alter_tablespace_options - ; - -alter_tablespace_options: - alter_tablespace_option - | alter_tablespace_options alter_tablespace_option - | alter_tablespace_options ',' alter_tablespace_option - ; - -alter_tablespace_option: - opt_ts_initial_size - | opt_ts_autoextend_size - | opt_ts_max_size - | opt_ts_engine - | ts_wait - ; - -logfile_group_option_list: - logfile_group_options - ; - -logfile_group_options: - logfile_group_option - | logfile_group_options logfile_group_option - | logfile_group_options ',' logfile_group_option - ; - -logfile_group_option: - opt_ts_initial_size - | opt_ts_undo_buffer_size - | opt_ts_redo_buffer_size - | opt_ts_nodegroup - | opt_ts_engine - | ts_wait - | opt_ts_comment - ; - -alter_logfile_group_option_list: - alter_logfile_group_options - ; - -alter_logfile_group_options: - alter_logfile_group_option - | alter_logfile_group_options alter_logfile_group_option - | alter_logfile_group_options ',' alter_logfile_group_option - ; - -alter_logfile_group_option: - opt_ts_initial_size - | opt_ts_engine - | ts_wait - ; - - -ts_datafile: - DATAFILE_SYM TEXT_STRING_sys - { - LEX *lex= Lex; - lex->alter_tablespace_info->data_file_name= $2.str; - } - ; - -lg_undofile: - UNDOFILE_SYM TEXT_STRING_sys - { - LEX *lex= Lex; - lex->alter_tablespace_info->undo_file_name= $2.str; - } - ; - -lg_redofile: - REDOFILE_SYM TEXT_STRING_sys - { - LEX *lex= Lex; - lex->alter_tablespace_info->redo_file_name= $2.str; - } - ; - -tablespace_name: - ident - { - LEX *lex= Lex; - lex->alter_tablespace_info= (new (thd->mem_root) - st_alter_tablespace()); - if (unlikely(lex->alter_tablespace_info == NULL)) - MYSQL_YYABORT; - lex->alter_tablespace_info->tablespace_name= $1.str; - lex->sql_command= SQLCOM_ALTER_TABLESPACE; - } - ; - -logfile_group_name: - ident - { - LEX *lex= Lex; - lex->alter_tablespace_info= (new (thd->mem_root) - st_alter_tablespace()); - if (unlikely(lex->alter_tablespace_info == NULL)) - MYSQL_YYABORT; - lex->alter_tablespace_info->logfile_group_name= $1.str; - lex->sql_command= SQLCOM_ALTER_TABLESPACE; - } - ; - -ts_access_mode: - READ_ONLY_SYM - { - LEX *lex= Lex; - lex->alter_tablespace_info->ts_access_mode= TS_READ_ONLY; - } - | READ_WRITE_SYM - { - LEX *lex= Lex; - lex->alter_tablespace_info->ts_access_mode= TS_READ_WRITE; - } - | NOT_SYM ACCESSIBLE_SYM - { - LEX *lex= Lex; - lex->alter_tablespace_info->ts_access_mode= TS_NOT_ACCESSIBLE; - } - ; - -opt_ts_initial_size: - INITIAL_SIZE_SYM opt_equal size_number - { - LEX *lex= Lex; - lex->alter_tablespace_info->initial_size= $3; - } - ; - -opt_ts_autoextend_size: - AUTOEXTEND_SIZE_SYM opt_equal size_number - { - LEX *lex= Lex; - lex->alter_tablespace_info->autoextend_size= $3; - } - ; - -opt_ts_max_size: - MAX_SIZE_SYM opt_equal size_number - { - LEX *lex= Lex; - lex->alter_tablespace_info->max_size= $3; - } - ; - -opt_ts_extent_size: - EXTENT_SIZE_SYM opt_equal size_number - { - LEX *lex= Lex; - lex->alter_tablespace_info->extent_size= $3; - } - ; - -opt_ts_undo_buffer_size: - UNDO_BUFFER_SIZE_SYM opt_equal size_number - { - LEX *lex= Lex; - lex->alter_tablespace_info->undo_buffer_size= $3; - } - ; - -opt_ts_redo_buffer_size: - REDO_BUFFER_SIZE_SYM opt_equal size_number - { - LEX *lex= Lex; - lex->alter_tablespace_info->redo_buffer_size= $3; - } - ; - -opt_ts_nodegroup: - NODEGROUP_SYM opt_equal real_ulong_num - { - LEX *lex= Lex; - if (unlikely(lex->alter_tablespace_info->nodegroup_id != UNDEF_NODEGROUP)) - my_yyabort_error((ER_FILEGROUP_OPTION_ONLY_ONCE,MYF(0),"NODEGROUP")); - lex->alter_tablespace_info->nodegroup_id= $3; - } - ; - -opt_ts_comment: - COMMENT_SYM opt_equal TEXT_STRING_sys - { - LEX *lex= Lex; - if (unlikely(lex->alter_tablespace_info->ts_comment != NULL)) - my_yyabort_error((ER_FILEGROUP_OPTION_ONLY_ONCE,MYF(0),"COMMENT")); - lex->alter_tablespace_info->ts_comment= $3.str; - } - ; - -opt_ts_engine: - opt_storage ENGINE_SYM opt_equal storage_engines - { - LEX *lex= Lex; - if (unlikely(lex->alter_tablespace_info->storage_engine != NULL)) - my_yyabort_error((ER_FILEGROUP_OPTION_ONLY_ONCE, MYF(0), - "STORAGE ENGINE")); - lex->alter_tablespace_info->storage_engine= $4; - } - ; - -opt_ts_wait: - /* empty */ - | ts_wait - ; - -ts_wait: - WAIT_SYM - { - LEX *lex= Lex; - lex->alter_tablespace_info->wait_until_completed= TRUE; - } - | NO_WAIT_SYM - { - LEX *lex= Lex; - if (unlikely(!(lex->alter_tablespace_info->wait_until_completed))) - my_yyabort_error((ER_FILEGROUP_OPTION_ONLY_ONCE,MYF(0),"NO_WAIT")); - lex->alter_tablespace_info->wait_until_completed= FALSE; - } - ; - -size_number: - real_ulonglong_num { $$= $1;} - | IDENT_sys - { - if ($1.to_size_number(&$$)) - MYSQL_YYABORT; - } - ; - -/* - End tablespace part -*/ create_body: create_field_list_parens @@ -5369,7 +5049,7 @@ opt_part_option_list: opt_part_option: TABLESPACE opt_equal ident_or_text - { Lex->part_info->curr_part_elem->tablespace_name= $3.str; } + { /* Compatibility with MySQL */ } | opt_storage ENGINE_SYM opt_equal storage_engines { partition_info *part_info= Lex->part_info; @@ -5708,7 +5388,7 @@ create_table_option: Lex->create_info.used_fields|= HA_CREATE_USED_INDEXDIR; } | TABLESPACE ident - {Lex->create_info.tablespace= $2.str;} + { /* Compatiblity with MySQL */ } | STORAGE_SYM DISK_SYM {Lex->create_info.storage_media= HA_SM_DISK;} | STORAGE_SYM MEMORY_SYM @@ -7356,26 +7036,6 @@ alter: Lex->pop_select(); //main select } - | ALTER TABLESPACE alter_tablespace_info - { - LEX *lex= Lex; - lex->alter_tablespace_info->ts_cmd_type= ALTER_TABLESPACE; - } - | ALTER LOGFILE_SYM GROUP_SYM alter_logfile_group_info - { - LEX *lex= Lex; - lex->alter_tablespace_info->ts_cmd_type= ALTER_LOGFILE_GROUP; - } - | ALTER TABLESPACE change_tablespace_info - { - LEX *lex= Lex; - lex->alter_tablespace_info->ts_cmd_type= CHANGE_FILE_TABLESPACE; - } - | ALTER TABLESPACE change_tablespace_access - { - LEX *lex= Lex; - lex->alter_tablespace_info->ts_cmd_type= ALTER_ACCESS_MODE_TABLESPACE; - } | ALTER SERVER_SYM ident_or_text { LEX *lex= Lex; @@ -8034,7 +7694,7 @@ opt_to: ; slave: - START_SYM SLAVE optional_connection_name slave_thread_opts + START_SYM SLAVE optional_connection_name slave_thread_opts optional_for_channel { LEX *lex=Lex; lex->sql_command = SQLCOM_SLAVE_START; @@ -8051,7 +7711,7 @@ slave: /* If you change this code don't forget to update STOP SLAVE too */ } {} - | STOP_SYM SLAVE optional_connection_name slave_thread_opts + | STOP_SYM SLAVE optional_connection_name slave_thread_opts optional_for_channel { LEX *lex=Lex; lex->sql_command = SQLCOM_SLAVE_STOP; @@ -13072,16 +12732,6 @@ drop: lex->set_command(SQLCOM_DROP_TRIGGER, $3); lex->spname= $4; } - | DROP TABLESPACE tablespace_name opt_ts_engine opt_ts_wait - { - LEX *lex= Lex; - lex->alter_tablespace_info->ts_cmd_type= DROP_TABLESPACE; - } - | DROP LOGFILE_SYM GROUP_SYM logfile_group_name opt_ts_engine opt_ts_wait - { - LEX *lex= Lex; - lex->alter_tablespace_info->ts_cmd_type= DROP_LOGFILE_GROUP; - } | DROP SERVER_SYM opt_if_exists ident_or_text { Lex->set_command(SQLCOM_DROP_SERVER, $3); @@ -13186,6 +12836,7 @@ insert: { Lex->sql_command= SQLCOM_INSERT; Lex->duplicates= DUP_ERROR; + thd->get_stmt_da()->opt_clear_warning_info(thd->query_id); } insert_start insert_lock_option opt_ignore opt_into insert_table { @@ -13195,6 +12846,7 @@ insert: stmt_end { Lex->mark_first_table_as_inserting(); + thd->get_stmt_da()->reset_current_row_for_warning(); } ; @@ -13203,6 +12855,7 @@ replace: { Lex->sql_command = SQLCOM_REPLACE; Lex->duplicates= DUP_REPLACE; + thd->get_stmt_da()->opt_clear_warning_info(thd->query_id); } insert_start replace_lock_option opt_into insert_table { @@ -13212,6 +12865,7 @@ replace: stmt_end { Lex->mark_first_table_as_inserting(); + thd->get_stmt_da()->reset_current_row_for_warning(); } ; @@ -13362,6 +13016,7 @@ no_braces: opt_values ')' { LEX *lex=Lex; + thd->get_stmt_da()->inc_current_row_for_warning(); if (unlikely(lex->many_values.push_back(lex->insert_list, thd->mem_root))) MYSQL_YYABORT; @@ -13377,6 +13032,7 @@ no_braces_with_names: opt_values_with_names ')' { LEX *lex=Lex; + thd->get_stmt_da()->inc_current_row_for_warning(); if (unlikely(lex->many_values.push_back(lex->insert_list, thd->mem_root))) MYSQL_YYABORT; @@ -13935,7 +13591,8 @@ show_param: LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_RELAYLOG_EVENTS; } - opt_global_limit_clause + opt_global_limit_clause optional_for_channel + { } | keys_or_index from_or_in table_ident opt_db opt_where_clause { LEX *lex= Lex; @@ -14080,16 +13737,7 @@ show_param: MYSQL_YYABORT; Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT; } - | SLAVE STATUS_SYM - { - LEX *lex= thd->lex; - lex->mi.connection_name= null_clex_str; - if (!(lex->m_sql_cmd= new (thd->mem_root) - Sql_cmd_show_slave_status())) - MYSQL_YYABORT; - lex->sql_command = SQLCOM_SHOW_SLAVE_STAT; - } - | SLAVE connection_name STATUS_SYM + | SLAVE optional_connection_name STATUS_SYM optional_for_channel { if (!(Lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_show_slave_status())) @@ -14474,7 +14122,7 @@ flush_option: { Lex->type|= REFRESH_SLOW_LOG; } | BINARY LOGS_SYM opt_delete_gtid_domain { Lex->type|= REFRESH_BINARY_LOG; } - | RELAY LOGS_SYM optional_connection_name + | RELAY LOGS_SYM optional_connection_name optional_for_channel { LEX *lex= Lex; if (unlikely(lex->type & REFRESH_RELAY_LOG)) @@ -14625,7 +14273,8 @@ reset_options: reset_option: SLAVE { Lex->type|= REFRESH_SLAVE; } optional_connection_name - slave_reset_options { } + slave_reset_options optional_for_channel + { } | MASTER_SYM { Lex->type|= REFRESH_MASTER; @@ -15922,6 +15571,7 @@ keyword_sp_var_and_label: | CASCADED | CATALOG_NAME_SYM | CHAIN_SYM + | CHANNEL_SYM | CHANGED | CIPHER_SYM | CLIENT_SYM diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 29345dfa71a..c2a219ee015 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -740,6 +740,29 @@ static Sys_var_charptr_fscs Sys_character_sets_dir( READ_ONLY GLOBAL_VAR(charsets_dir), CMD_LINE(REQUIRED_ARG), DEFAULT(0)); +static bool check_engine_supports_temporary(sys_var *self, THD *thd, set_var *var) +{ + String str, *res; + LEX_CSTRING name; + if (!var->value || var->value->is_null()) + return false; + res= var->value->val_str(&str); + res->get_value(&name); + plugin_ref plugin= ha_resolve_by_name(thd, &name, true); + DBUG_ASSERT(plugin); + handlerton *hton= plugin_hton(plugin); + DBUG_ASSERT(hton); + if (ha_check_storage_engine_flag(hton, HTON_TEMPORARY_NOT_SUPPORTED)) + { + my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0), hton_name(hton)->str, + "TEMPORARY"); + plugin_unlock(thd, plugin); + return true; + } + plugin_unlock(thd, plugin); + return false; +} + static bool check_not_null(sys_var *self, THD *thd, set_var *var) { return var->value && var->value->is_null(); @@ -4243,7 +4266,8 @@ static Sys_var_plugin Sys_storage_engine( static Sys_var_plugin Sys_default_tmp_storage_engine( "default_tmp_storage_engine", "The default storage engine for user-created temporary tables", SESSION_VAR(tmp_table_plugin), NO_CMD_LINE, - MYSQL_STORAGE_ENGINE_PLUGIN, DEFAULT(&default_tmp_storage_engine)); + MYSQL_STORAGE_ENGINE_PLUGIN, DEFAULT(&default_tmp_storage_engine), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_engine_supports_temporary)); static Sys_var_plugin Sys_enforce_storage_engine( "enforce_storage_engine", "Force the use of a storage engine for new tables", @@ -6007,16 +6031,6 @@ static Sys_var_mybool Sys_wsrep_desync ( ON_CHECK(wsrep_desync_check), ON_UPDATE(wsrep_desync_update)); -static Sys_var_mybool Sys_wsrep_strict_ddl ( - "wsrep_strict_ddl", - "If set, reject DDL on affected tables not supporting Galera replication", - GLOBAL_VAR(wsrep_strict_ddl), - CMD_LINE(OPT_ARG), DEFAULT(FALSE), - NO_MUTEX_GUARD, NOT_IN_BINLOG, - ON_CHECK(0), - ON_UPDATE(wsrep_strict_ddl_update), - DEPRECATED("'@@wsrep_mode=STRICT_REPLICATION'")); // since 10.6.0 - static const char *wsrep_reject_queries_names[]= { "NONE", "ALL", "ALL_KILL", NullS }; static Sys_var_enum Sys_wsrep_reject_queries( "wsrep_reject_queries", "Variable to set to reject queries", @@ -6037,13 +6051,6 @@ static Sys_var_mybool Sys_wsrep_recover_datadir( READ_ONLY GLOBAL_VAR(wsrep_recovery), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -static Sys_var_mybool Sys_wsrep_replicate_myisam( - "wsrep_replicate_myisam", "To enable myisam replication", - GLOBAL_VAR(wsrep_replicate_myisam), CMD_LINE(OPT_ARG), DEFAULT(FALSE), - NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), - ON_UPDATE(wsrep_replicate_myisam_update), - DEPRECATED("'@@wsrep_mode=REPLICATE_MYISAM'")); // since 10.6.0 - static Sys_var_mybool Sys_wsrep_log_conflicts( "wsrep_log_conflicts", "To log multi-master conflicts", GLOBAL_VAR(wsrep_log_conflicts), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); diff --git a/sql/table.cc b/sql/table.cc index 3fa1337ba0b..30db6ab8683 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -3329,7 +3329,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, share->column_bitmap_size * bitmap_count))) goto err; - my_bitmap_init(&share->all_set, bitmaps, share->fields, FALSE); + my_bitmap_init(&share->all_set, bitmaps, share->fields); bitmap_set_all(&share->all_set); if (share->check_set) { @@ -3340,7 +3340,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, my_bitmap_init(share->check_set, (my_bitmap_map*) ((uchar*) bitmaps + share->column_bitmap_size), - share->fields, FALSE); + share->fields); bitmap_clear_all(share->check_set); } @@ -4292,26 +4292,26 @@ partititon_err: goto err; my_bitmap_init(&outparam->def_read_set, - (my_bitmap_map*) bitmaps, share->fields, FALSE); + (my_bitmap_map*) bitmaps, share->fields); bitmaps+= bitmap_size; my_bitmap_init(&outparam->def_write_set, - (my_bitmap_map*) bitmaps, share->fields, FALSE); + (my_bitmap_map*) bitmaps, share->fields); bitmaps+= bitmap_size; my_bitmap_init(&outparam->has_value_set, - (my_bitmap_map*) bitmaps, share->fields, FALSE); + (my_bitmap_map*) bitmaps, share->fields); bitmaps+= bitmap_size; my_bitmap_init(&outparam->tmp_set, - (my_bitmap_map*) bitmaps, share->fields, FALSE); + (my_bitmap_map*) bitmaps, share->fields); bitmaps+= bitmap_size; my_bitmap_init(&outparam->eq_join_set, - (my_bitmap_map*) bitmaps, share->fields, FALSE); + (my_bitmap_map*) bitmaps, share->fields); bitmaps+= bitmap_size; my_bitmap_init(&outparam->cond_set, - (my_bitmap_map*) bitmaps, share->fields, FALSE); + (my_bitmap_map*) bitmaps, share->fields); bitmaps+= bitmap_size; my_bitmap_init(&outparam->def_rpl_write_set, - (my_bitmap_map*) bitmaps, share->fields, FALSE); + (my_bitmap_map*) bitmaps, share->fields); outparam->default_column_bitmaps(); outparam->cond_selectivity= 1.0; diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 89823cea3bf..3886d385d2c 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -90,7 +90,6 @@ my_bool wsrep_drupal_282555_workaround; // Retry autoinc insert after du my_bool wsrep_certify_nonPK; // Certify, even when no primary key ulong wsrep_certification_rules = WSREP_CERTIFICATION_RULES_STRICT; my_bool wsrep_recovery; // Recovery -my_bool wsrep_replicate_myisam; // Enable MyISAM replication my_bool wsrep_log_conflicts; my_bool wsrep_load_data_splitting= 0; // Commit load data every 10K intervals my_bool wsrep_slave_UK_checks; // Slave thread does UK checks @@ -100,9 +99,6 @@ my_bool wsrep_restart_slave; // Should mysql slave thread be my_bool wsrep_desync; // De(re)synchronize the node from the // cluster ulonglong wsrep_mode; -my_bool wsrep_strict_ddl; // Deprecated: Reject DDL to - // effected tables not - // supporting Galera replication bool wsrep_service_started; // If Galera was initialized long wsrep_slave_threads; // No. of slave appliers threads ulong wsrep_retry_autocommit; // Retry aborted autocommit trx @@ -2556,6 +2552,8 @@ static int wsrep_TOI_begin(THD *thd, const char *db, const char *table, } thd_proc_info(thd, "acquiring total order isolation"); + WSREP_DEBUG("wsrep_TOI_begin for %s", wsrep_thd_query(thd)); + THD_STAGE_INFO(thd, stage_waiting_isolation); wsrep::client_state& cs(thd->wsrep_cs()); @@ -2898,39 +2896,49 @@ void wsrep_handle_mdl_conflict(MDL_context *requestor_ctx, const MDL_ticket *ticket, const MDL_key *key) { - /* Fallback to the non-wsrep behaviour */ - if (!WSREP_ON) return; - THD *request_thd= requestor_ctx->get_thd(); THD *granted_thd= ticket->get_ctx()->get_thd(); + /* Fallback to the non-wsrep behaviour */ + if (!WSREP(request_thd)) return; + const char* schema= key->db_name(); int schema_len= key->db_name_length(); mysql_mutex_lock(&request_thd->LOCK_thd_data); - if (wsrep_thd_is_toi(request_thd) || - wsrep_thd_is_applying(request_thd)) { + if (wsrep_thd_is_toi(request_thd) || + wsrep_thd_is_applying(request_thd)) + { + WSREP_DEBUG("wsrep_handle_mdl_conflict request TOI/APPLY for %s", + wsrep_thd_query(request_thd)); + THD_STAGE_INFO(request_thd, stage_waiting_isolation); mysql_mutex_unlock(&request_thd->LOCK_thd_data); WSREP_MDL_LOG(DEBUG, "MDL conflict ", schema, schema_len, request_thd, granted_thd); ticket->wsrep_report(wsrep_debug); mysql_mutex_lock(&granted_thd->LOCK_thd_data); + if (wsrep_thd_is_toi(granted_thd) || wsrep_thd_is_applying(granted_thd)) { if (wsrep_thd_is_aborting(granted_thd)) { - WSREP_DEBUG("BF thread waiting for SR in aborting state"); + WSREP_DEBUG("BF thread waiting for SR in aborting state for %s", + wsrep_thd_query(request_thd)); + THD_STAGE_INFO(request_thd, stage_waiting_isolation); ticket->wsrep_report(wsrep_debug); mysql_mutex_unlock(&granted_thd->LOCK_thd_data); } else if (wsrep_thd_is_SR(granted_thd) && !wsrep_thd_is_SR(request_thd)) { - WSREP_MDL_LOG(INFO, "MDL conflict, DDL vs SR", + WSREP_MDL_LOG(INFO, "MDL conflict, DDL vs SR", schema, schema_len, request_thd, granted_thd); mysql_mutex_unlock(&granted_thd->LOCK_thd_data); + WSREP_DEBUG("wsrep_handle_mdl_conflict DDL vs SR for %s", + wsrep_thd_query(request_thd)); + THD_STAGE_INFO(request_thd, stage_waiting_isolation); wsrep_abort_thd(request_thd, granted_thd, 1); } else @@ -2945,14 +2953,18 @@ void wsrep_handle_mdl_conflict(MDL_context *requestor_ctx, else if (granted_thd->lex->sql_command == SQLCOM_FLUSH || granted_thd->mdl_context.has_explicit_locks()) { - WSREP_DEBUG("BF thread waiting for FLUSH"); + WSREP_DEBUG("BF thread waiting for FLUSH for %s", + wsrep_thd_query(request_thd)); + THD_STAGE_INFO(request_thd, stage_waiting_ddl); ticket->wsrep_report(wsrep_debug); mysql_mutex_unlock(&granted_thd->LOCK_thd_data); } else if (request_thd->lex->sql_command == SQLCOM_DROP_TABLE) { - WSREP_DEBUG("DROP caused BF abort, conf %s", - wsrep_thd_transaction_state_str(granted_thd)); + WSREP_DEBUG("DROP caused BF abort, conf %s for %s", + wsrep_thd_transaction_state_str(granted_thd), + wsrep_thd_query(request_thd)); + THD_STAGE_INFO(request_thd, stage_waiting_isolation); ticket->wsrep_report(wsrep_debug); mysql_mutex_unlock(&granted_thd->LOCK_thd_data); wsrep_abort_thd(request_thd, granted_thd, 1); @@ -2961,7 +2973,11 @@ void wsrep_handle_mdl_conflict(MDL_context *requestor_ctx, { WSREP_MDL_LOG(DEBUG, "MDL conflict-> BF abort", schema, schema_len, request_thd, granted_thd); + WSREP_DEBUG("wsrep_handle_mdl_conflict -> BF abort for %s", + wsrep_thd_query(request_thd)); + THD_STAGE_INFO(request_thd, stage_waiting_isolation); ticket->wsrep_report(wsrep_debug); + if (granted_thd->wsrep_trx().active()) { mysql_mutex_unlock(&granted_thd->LOCK_thd_data); @@ -2974,14 +2990,16 @@ void wsrep_handle_mdl_conflict(MDL_context *requestor_ctx, thd is BF, BF abort and wait. */ mysql_mutex_unlock(&granted_thd->LOCK_thd_data); + if (wsrep_thd_is_BF(request_thd, FALSE)) { ha_abort_transaction(request_thd, granted_thd, TRUE); } else { - WSREP_MDL_LOG(INFO, "MDL unknown BF-BF conflict", schema, schema_len, - request_thd, granted_thd); + WSREP_MDL_LOG(INFO, "MDL unknown BF-BF conflict", + schema, schema_len, + request_thd, granted_thd); ticket->wsrep_report(true); unireg_abort(1); } diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h index 9cbbcbe5862..73eff87e42e 100644 --- a/sql/wsrep_mysqld.h +++ b/sql/wsrep_mysqld.h @@ -85,7 +85,6 @@ extern ulong wsrep_forced_binlog_format; extern my_bool wsrep_desync; extern ulong wsrep_reject_queries; extern my_bool wsrep_recovery; -extern my_bool wsrep_replicate_myisam; extern my_bool wsrep_log_conflicts; extern ulong wsrep_mysql_replication_bundle; extern my_bool wsrep_load_data_splitting; @@ -103,7 +102,6 @@ extern bool wsrep_new_cluster; extern bool wsrep_gtid_mode; extern uint wsrep_gtid_domain_id; extern ulonglong wsrep_mode; -extern my_bool wsrep_strict_ddl; enum enum_wsrep_reject_types { WSREP_REJECT_NONE, /* nothing rejected */ diff --git a/sql/wsrep_trans_observer.h b/sql/wsrep_trans_observer.h index e3e076631c7..16c9bf077ba 100644 --- a/sql/wsrep_trans_observer.h +++ b/sql/wsrep_trans_observer.h @@ -1,4 +1,4 @@ -/* Copyright 2016-2019 Codership Oy <http://www.codership.com> +/* Copyright 2016-2021 Codership Oy <http://www.codership.com> 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 @@ -272,12 +272,14 @@ static inline int wsrep_before_commit(THD* thd, bool all) WSREP_DEBUG("wsrep_before_commit: %d, %lld", wsrep_is_real(thd, all), (long long)wsrep_thd_trx_seqno(thd)); + THD_STAGE_INFO(thd, stage_waiting_certification); int ret= 0; DBUG_ASSERT(wsrep_run_commit_hook(thd, all)); + if ((ret= thd->wsrep_cs().before_commit()) == 0) { DBUG_ASSERT(!thd->wsrep_trx().ws_meta().gtid().is_undefined()); - if (!thd->variables.gtid_seq_no && + if (!thd->variables.gtid_seq_no && (thd->wsrep_trx().ws_meta().flags() & wsrep::provider::flag::commit)) { uint64 seqno= 0; diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc index 1790141b37d..178ec603e72 100644 --- a/sql/wsrep_var.cc +++ b/sql/wsrep_var.cc @@ -836,10 +836,11 @@ bool wsrep_desync_check (sys_var *self, THD* thd, set_var* var) return true; } } else { + THD_STAGE_INFO(thd, stage_waiting_flow); ret= Wsrep_server_state::instance().provider().resync(); if (ret != WSREP_OK) { WSREP_WARN ("SET resync failed %d for schema: %s, query: %s", ret, - thd->get_db(), thd->query()); + thd->get_db(), wsrep_thd_query(thd)); my_error (ER_CANNOT_USER, MYF(0), "'resync'", thd->query()); return true; } @@ -1100,24 +1101,3 @@ bool wsrep_gtid_domain_id_update(sys_var* self, THD *thd, enum_var_type) return false; } -bool wsrep_strict_ddl_update(sys_var *self, THD* thd, enum_var_type var_type) -{ - // In case user still sets wsrep_strict_ddl we set new - // option to wsrep_mode - if (wsrep_strict_ddl) - wsrep_mode|= WSREP_MODE_STRICT_REPLICATION; - else - wsrep_mode&= (~WSREP_MODE_STRICT_REPLICATION); - return false; -} - -bool wsrep_replicate_myisam_update(sys_var *self, THD* thd, enum_var_type var_type) -{ - // In case user still sets wsrep_replicate_myisam we set new - // option to wsrep_mode - if (wsrep_replicate_myisam) - wsrep_mode|= WSREP_MODE_REPLICATE_MYISAM; - else - wsrep_mode&= (~WSREP_MODE_REPLICATE_MYISAM); - return false; -} diff --git a/sql/wsrep_var.h b/sql/wsrep_var.h index 7908e873795..0f811d70928 100644 --- a/sql/wsrep_var.h +++ b/sql/wsrep_var.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2013 Codership Oy <info@codership.com> +/* Copyright (C) 2013-2021 Codership Oy <info@codership.com> 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 @@ -109,8 +109,6 @@ extern bool wsrep_gtid_seq_no_check CHECK_ARGS; extern bool wsrep_gtid_domain_id_update UPDATE_ARGS; extern bool wsrep_mode_check CHECK_ARGS; -extern bool wsrep_strict_ddl_update UPDATE_ARGS; -extern bool wsrep_replicate_myisam_update UPDATE_ARGS; #else /* WITH_WSREP */ #define wsrep_provider_init(X) diff --git a/storage/columnstore/columnstore b/storage/columnstore/columnstore -Subproject 88b75fd590aca6dfcd733b4ed6d56becc510cb6 +Subproject a5322ad627a2ef2f39dd8f3b4678001b50a6dcb diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc index 02aa89361c5..6dfd00ca971 100644 --- a/storage/innobase/btr/btr0btr.cc +++ b/storage/innobase/btr/btr0btr.cc @@ -351,8 +351,8 @@ btr_root_adjust_on_import( } else { /* Check that the table flags and the tablespace flags match. */ - ulint tf = dict_tf_to_fsp_flags(table->flags); - ulint sf = table->space->flags; + uint32_t tf = dict_tf_to_fsp_flags(table->flags); + uint32_t sf = table->space->flags; sf &= ~FSP_FLAGS_MEM_MASK; tf &= ~FSP_FLAGS_MEM_MASK; if (fil_space_t::is_flags_equal(tf, sf) diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index 32bdf9a8a51..8a705c5aa64 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -6894,7 +6894,6 @@ btr_store_big_rec_extern_fields( byte* field_ref; ulint extern_len; ulint store_len; - ulint space_id; ulint i; mtr_t mtr; mem_heap_t* heap = NULL; @@ -6917,7 +6916,6 @@ btr_store_big_rec_extern_fields( btr_blob_log_check_t redo_log(pcur, btr_mtr, offsets, &rec_block, &rec, op); page_zip = buf_block_get_page_zip(rec_block); - space_id = rec_block->page.id().space(); ut_a(fil_page_index_page_check(page_align(rec)) || op == BTR_STORE_INSERT_BULK); @@ -7035,6 +7033,7 @@ btr_store_big_rec_extern_fields( ut_a(block != NULL); + const uint32_t space_id = block->page.id().space(); const uint32_t page_no = block->page.id().page_no(); if (prev_page_no != FIL_NULL) { diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 4ec6a61ccb9..cd5b3a1843a 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -582,15 +582,12 @@ bool buf_is_zeroes(span<const byte> buf) } /** Check if a page is corrupt. -@param[in] check_lsn whether the LSN should be checked -@param[in] read_buf database page -@param[in] fsp_flags tablespace flags +@param check_lsn whether FIL_PAGE_LSN should be checked +@param read_buf database page +@param fsp_flags contents of FIL_SPACE_FLAGS @return whether the page is corrupted */ -bool -buf_page_is_corrupted( - bool check_lsn, - const byte* read_buf, - ulint fsp_flags) +bool buf_page_is_corrupted(bool check_lsn, const byte *read_buf, + uint32_t fsp_flags) { #ifndef UNIV_INNOCHECKSUM DBUG_EXECUTE_IF("buf_page_import_corrupt_failure", return(true); ); @@ -4374,10 +4371,10 @@ buf_print_io( /** Verify that post encryption checksum match with the calculated checksum. This function should be called only if tablespace contains crypt data metadata. -@param[in] page page frame -@param[in] fsp_flags tablespace flags -@return true if true if page is encrypted and OK, false otherwise */ -bool buf_page_verify_crypt_checksum(const byte* page, ulint fsp_flags) +@param page page frame +@param fsp_flags contents of FSP_SPACE_FLAGS +@return whether the page is encrypted and valid */ +bool buf_page_verify_crypt_checksum(const byte *page, uint32_t fsp_flags) { if (!fil_space_t::full_crc32(fsp_flags)) { return fil_space_verify_crypt_checksum( diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc index 447fba38323..c79cbe3224e 100644 --- a/storage/innobase/buf/buf0dblwr.cc +++ b/storage/innobase/buf/buf0dblwr.cc @@ -351,7 +351,7 @@ void buf_dblwr_t::recover() if (recv_sys.parse_start_lsn > lsn) /* Pages written before the checkpoint are not useful for recovery. */ continue; - const ulint space_id= page_get_space_id(page); + const uint32_t space_id= page_get_space_id(page); const page_id_t page_id(space_id, page_no); if (recv_sys.scanned_lsn < lsn) diff --git a/storage/innobase/buf/buf0dump.cc b/storage/innobase/buf/buf0dump.cc index 07416a48f70..ef5b65f533b 100644 --- a/storage/innobase/buf/buf0dump.cc +++ b/storage/innobase/buf/buf0dump.cc @@ -634,7 +634,7 @@ buf_load() /* Avoid calling the expensive fil_space_t::get() for each page within the same tablespace. dump[] is sorted by (space, page), so all pages from a given tablespace are consecutive. */ - ulint cur_space_id = dump[0].space(); + uint32_t cur_space_id = dump[0].space(); fil_space_t* space = fil_space_t::get(cur_space_id); ulint zip_size = space ? space->zip_size() : 0; @@ -646,10 +646,9 @@ buf_load() for (i = 0; i < dump_n && !SHUTTING_DOWN(); i++) { /* space_id for this iteration of the loop */ - const ulint this_space_id = dump[i].space(); + const uint32_t this_space_id = dump[i].space(); - if (this_space_id == SRV_TMP_SPACE_ID) { - /* Ignore the innodb_temporary tablespace. */ + if (this_space_id >= SRV_SPACE_ID_UPPER_BOUND) { continue; } diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 2107f0af9ae..ab0b0986010 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -225,7 +225,7 @@ deleting the data file of that tablespace. The pages still remain a part of LRU and are evicted from the list as they age towards the tail of the LRU. @param id tablespace identifier */ -void buf_flush_remove_pages(ulint id) +void buf_flush_remove_pages(uint32_t id) { const page_id_t first(id, 0), end(id + 1, 0); ut_ad(id); diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc index 13e1a35f08a..f7d06fc38ed 100644 --- a/storage/innobase/buf/buf0rea.cc +++ b/storage/innobase/buf/buf0rea.cc @@ -714,11 +714,9 @@ failed: } /** Issues read requests for pages which recovery wants to read in. -@param[in] space_id tablespace id -@param[in] page_nos array of page numbers to read, with the -highest page number the last in the array -@param[in] n number of page numbers in the array */ -void buf_read_recv_pages(ulint space_id, const uint32_t* page_nos, ulint n) +@param space_id tablespace identifier +@param page_nos page numbers to read, in ascending order */ +void buf_read_recv_pages(uint32_t space_id, st_::span<uint32_t> page_nos) { fil_space_t* space = fil_space_t::get(space_id); @@ -729,7 +727,7 @@ void buf_read_recv_pages(ulint space_id, const uint32_t* page_nos, ulint n) const ulint zip_size = space->zip_size(); - for (ulint i = 0; i < n; i++) { + for (ulint i = 0; i < page_nos.size(); i++) { /* Ignore if the page already present in freed ranges. */ if (space->freed_ranges.contains(page_nos[i])) { @@ -770,7 +768,7 @@ void buf_read_recv_pages(ulint space_id, const uint32_t* page_nos, ulint n) } - DBUG_PRINT("ib_buf", ("recovery read (%u pages) for %s", n, - space->chain.start->name)); + DBUG_PRINT("ib_buf", ("recovery read (%zu pages) for %s", + page_nos.size(), space->chain.start->name)); space->release(); } diff --git a/storage/innobase/dict/dict0boot.cc b/storage/innobase/dict/dict0boot.cc index e6a46699f02..ab968f5047a 100644 --- a/storage/innobase/dict/dict0boot.cc +++ b/storage/innobase/dict/dict0boot.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2016, 2020, MariaDB Corporation. +Copyright (c) 2016, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -44,7 +44,7 @@ dict_hdr_get_new_id( (not assigned if NULL) */ index_id_t* index_id, /*!< out: index id (not assigned if NULL) */ - ulint* space_id) /*!< out: space id + uint32_t* space_id) /*!< out: space id (not assigned if NULL) */ { ib_id_t id; @@ -241,8 +241,8 @@ dict_boot(void) header. */ dict_sys.recover_row_id(mach_read_from_8(dict_hdr + DICT_HDR_ROW_ID)); - if (ulint max_space_id = mach_read_from_4(dict_hdr - + DICT_HDR_MAX_SPACE_ID)) { + if (uint32_t max_space_id + = mach_read_from_4(dict_hdr + DICT_HDR_MAX_SPACE_ID)) { max_space_id--; fil_assign_new_space_id(&max_space_id); } diff --git a/storage/innobase/dict/dict0crea.cc b/storage/innobase/dict/dict0crea.cc index 667a64f907a..ec4db448b0a 100644 --- a/storage/innobase/dict/dict0crea.cc +++ b/storage/innobase/dict/dict0crea.cc @@ -348,8 +348,8 @@ dict_build_table_def_step( dict_table_t* table = node->table; ut_ad(!table->is_temporary()); ut_ad(!table->space); - ut_ad(table->space_id == ULINT_UNDEFINED); - dict_hdr_get_new_id(&table->id, NULL, NULL); + ut_ad(table->space_id == UINT32_MAX); + dict_hdr_get_new_id(&table->id, nullptr, nullptr); /* Always set this bit for all new created tables */ DICT_TF2_FLAG_SET(table, DICT_TF2_FTS_AUX_HEX_NAME); @@ -367,10 +367,10 @@ dict_build_table_def_step( DBUG_EXECUTE_IF( "ib_create_table_fail_out_of_space_ids", - table->space_id = ULINT_UNDEFINED; + table->space_id = UINT32_MAX; ); - if (table->space_id == ULINT_UNDEFINED) { + if (table->space_id == UINT32_MAX) { return DB_ERROR; } } else { diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc index 75cbfaa3587..280a42d12c7 100644 --- a/storage/innobase/dict/dict0load.cc +++ b/storage/innobase/dict/dict0load.cc @@ -622,11 +622,10 @@ dict_sys_tables_type_valid(ulint type, bool not_redundant) @param[in] not_redundant whether ROW_FORMAT=REDUNDANT is not used @return table flags */ static -ulint -dict_sys_tables_type_to_tf(ulint type, bool not_redundant) +uint32_t dict_sys_tables_type_to_tf(uint32_t type, bool not_redundant) { ut_ad(dict_sys_tables_type_valid(type, not_redundant)); - ulint flags = not_redundant ? 1 : 0; + uint32_t flags = not_redundant ? 1 : 0; /* ZIP_SSIZE, ATOMIC_BLOBS, DATA_DIR, PAGE_COMPRESSION, PAGE_COMPRESSION_LEVEL are the same. */ @@ -657,14 +656,13 @@ dict_sys_tables_rec_read( const rec_t* rec, const span<const char>& name, table_id_t* table_id, - ulint* space_id, - ulint* n_cols, - ulint* flags, - ulint* flags2) + uint32_t* space_id, + uint32_t* n_cols, + uint32_t* flags, + uint32_t* flags2) { const byte* field; ulint len; - ulint type; field = rec_get_nth_field_old( rec, DICT_FLD__SYS_TABLES__ID, &len); @@ -680,7 +678,7 @@ dict_sys_tables_rec_read( field = rec_get_nth_field_old( rec, DICT_FLD__SYS_TABLES__TYPE, &len); ut_a(len == 4); - type = mach_read_from_4(field); + uint32_t type = mach_read_from_4(field); /* Handle MDEV-12873 InnoDB SYS_TABLES.TYPE incompatibility for PAGE_COMPRESSED=YES in MariaDB 10.2.2 to 10.2.6. @@ -771,8 +769,8 @@ dict_sys_tables_rec_read( if (!dict_sys_tables_type_valid(type, not_redundant)) { sql_print_error("InnoDB: Table %.*s in InnoDB" " data dictionary contains invalid flags." - " SYS_TABLES.TYPE=" ULINTPF - " SYS_TABLES.N_COLS=" ULINTPF, + " SYS_TABLES.TYPE=" UINT32PF + " SYS_TABLES.N_COLS=" UINT32PF, name.size(), name.data(), type, *n_cols); return(false); } @@ -796,8 +794,8 @@ dict_sys_tables_rec_read( sql_print_error("InnoDB: Table %.*s in InnoDB" " data dictionary" " contains invalid flags." - " SYS_TABLES.TYPE=" ULINTPF - " SYS_TABLES.MIX_LEN=" ULINTPF, + " SYS_TABLES.TYPE=" UINT32PF + " SYS_TABLES.MIX_LEN=" UINT32PF, name.size(), name.data(), type, *flags2); return(false); @@ -820,9 +818,9 @@ Search SYS_TABLES and check each tablespace mentioned that has not already been added to the fil_system. If it is valid, add it to the file_system list. @return the highest space ID found. */ -static ulint dict_check_sys_tables() +static uint32_t dict_check_sys_tables() { - ulint max_space_id = 0; + uint32_t max_space_id = 0; btr_pcur_t pcur; mtr_t mtr; @@ -837,10 +835,10 @@ static ulint dict_check_sys_tables() rec; rec = dict_getnext_system_low(&pcur, &mtr)) { ulint len; table_id_t table_id; - ulint space_id; - ulint n_cols; - ulint flags; - ulint flags2; + uint32_t space_id; + uint32_t n_cols; + uint32_t flags; + uint32_t flags2; /* If a table record is not useable, ignore it and continue on to the next record. Error messages were logged. */ @@ -938,9 +936,9 @@ void dict_check_tablespaces_and_store_max_id() /* Initialize the max space_id from sys header */ mtr.start(); - ulint max_space_id = mach_read_from_4(DICT_HDR_MAX_SPACE_ID - + DICT_HDR - + dict_hdr_get(&mtr)->frame); + uint32_t max_space_id = mach_read_from_4(DICT_HDR_MAX_SPACE_ID + + DICT_HDR + + dict_hdr_get(&mtr)->frame); mtr.commit(); fil_set_max_space_id_if_bigger(max_space_id); @@ -2087,12 +2085,8 @@ const char *dict_load_table_low(const span<const char> &name, const rec_t *rec, dict_table_t **table) { table_id_t table_id; - ulint space_id; - ulint n_cols; - ulint t_num; - ulint flags; - ulint flags2; - ulint n_v_col; + uint32_t space_id, t_num, flags, flags2; + ulint n_cols, n_v_col; if (const char* error_text = dict_sys_tables_rec_check(rec)) { *table = NULL; diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc index 5f273a60be8..1a8d5764d0f 100644 --- a/storage/innobase/dict/dict0mem.cc +++ b/storage/innobase/dict/dict0mem.cc @@ -162,7 +162,7 @@ dict_table_t *dict_table_t::create(const span<const char> &name, table->mdl_name.m_name= table->name.m_name; table->is_system_db= dict_mem_table_is_system(table->name.m_name); table->space= space; - table->space_id= space ? space->id : ULINT_UNDEFINED; + table->space_id= space ? space->id : UINT32_MAX; table->n_t_cols= static_cast<unsigned>(n_cols + DATA_N_SYS_COLS) & dict_index_t::MAX_N_FIELDS; table->n_v_cols= static_cast<unsigned>(n_v_cols) & diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index 04d2070e430..c1889d43b02 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -782,20 +782,20 @@ static bool fil_space_decrypt_for_non_full_checksum( /** Decrypt a page. @param[in] space_id tablespace id +@param[in] fsp_flags Tablespace flags @param[in] crypt_data crypt_data @param[in] tmp_frame Temporary buffer @param[in] physical_size page size -@param[in] fsp_flags Tablespace flags @param[in,out] src_frame Page to decrypt @param[out] err DB_SUCCESS or DB_DECRYPTION_FAILED @return true if page decrypted, false if not.*/ bool fil_space_decrypt( - ulint space_id, + uint32_t space_id, + uint32_t fsp_flags, fil_space_crypt_t* crypt_data, byte* tmp_frame, ulint physical_size, - ulint fsp_flags, byte* src_frame, dberr_t* err) { @@ -829,9 +829,9 @@ fil_space_decrypt( ut_ad(space->crypt_data != NULL && space->crypt_data->is_encrypted()); ut_ad(space->referenced()); - bool encrypted = fil_space_decrypt(space->id, space->crypt_data, + bool encrypted = fil_space_decrypt(space->id, space->flags, + space->crypt_data, tmp_frame, physical_size, - space->flags, src_frame, &err); if (err == DB_SUCCESS) { @@ -1426,7 +1426,7 @@ inline fil_space_t *fil_system_t::default_encrypt_next(fil_space_t *space, mysql_mutex_assert_owner(&mutex); auto it= space && space->is_in_default_encrypt - ? sized_ilist<fil_space_t, rotation_list_tag_t>::iterator(space) + ? sized_ilist<fil_space_t, default_encrypt_tag_t>::iterator(space) : default_encrypt_tables.begin(); const auto end= default_encrypt_tables.end(); @@ -1919,7 +1919,7 @@ fil_crypt_rotate_pages( const key_state_t* key_state, rotate_thread_t* state) { - ulint space_id = state->space->id; + const uint32_t space_id = state->space->id; uint32_t end = std::min(state->offset + uint32_t(state->batch), state->space->free_limit); diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index adb4bdef1c5..3fb384b9ff8 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -54,15 +54,6 @@ Created 10/25/1995 Heikki Tuuri # include <dirent.h> #endif -/** Determine if the space id is a user tablespace id or not. -@param space_id tablespace identifier -@return true if it is a user tablespace ID */ -inline bool fil_is_user_tablespace_id(ulint space_id) -{ - return space_id != TRX_SYS_SPACE && space_id != SRV_TMP_SPACE_ID && - !srv_is_undo_tablespace(space_id); -} - /** Try to close a file to adhere to the innodb_open_files limit. @param print_info whether to diagnose why a file cannot be closed @return whether a file was closed */ @@ -77,7 +68,7 @@ bool fil_space_t::try_to_close(bool print_info) case FIL_TYPE_IMPORT: break; case FIL_TYPE_TABLESPACE: - if (!fil_is_user_tablespace_id(space.id)) + if (is_predefined_tablespace(space.id)) continue; } @@ -127,11 +118,8 @@ The tablespace must exist in the memory cache. @param[in] new_path_in new file name, or NULL if it is located in the normal data directory @return true if success */ -static bool -fil_rename_tablespace( - ulint id, - const char* old_path, - const char* new_path_in); +static bool fil_rename_tablespace(uint32_t id, const char *old_path, + const char *new_path_in); /* IMPLEMENTATION OF THE TABLESPACE MEMORY CACHE @@ -219,14 +207,11 @@ fil_validate_skip(void) } #endif /* UNIV_DEBUG */ -/*******************************************************************//** -Returns the table space by a given id, NULL if not found. -It is unsafe to dereference the returned pointer. It is fine to check -for NULL. */ -fil_space_t* -fil_space_get_by_id( -/*================*/ - ulint id) /*!< in: space id */ +/** Look up a tablespace. +@param tablespace identifier +@return tablespace +@retval nullptr if not found */ +fil_space_t *fil_space_get_by_id(uint32_t id) { fil_space_t* space; @@ -249,14 +234,12 @@ or the caller should be in single-threaded crash recovery mode Normally, fil_space_t::get() should be used instead. @param[in] id tablespace ID @return tablespace, or NULL if not found */ -fil_space_t* -fil_space_get( - ulint id) +fil_space_t *fil_space_get(uint32_t id) { - mysql_mutex_lock(&fil_system.mutex); - fil_space_t* space = fil_space_get_by_id(id); - mysql_mutex_unlock(&fil_system.mutex); - return(space); + mysql_mutex_lock(&fil_system.mutex); + fil_space_t *space= fil_space_get_by_id(id); + mysql_mutex_unlock(&fil_system.mutex); + return space; } /** Validate the compression algorithm for full crc32 format. @@ -418,7 +401,7 @@ static bool fil_node_open_file(fil_node_t *node) { mysql_mutex_assert_owner(&fil_system.mutex); ut_ad(!node->is_open()); - ut_ad(fil_is_user_tablespace_id(node->space->id) || + ut_ad(!is_predefined_tablespace(node->space->id) || srv_operation == SRV_OPERATION_BACKUP || srv_operation == SRV_OPERATION_RESTORE || srv_operation == SRV_OPERATION_RESTORE_DELTA); @@ -861,13 +844,10 @@ fil_space_free_low( /** Frees a space object from the tablespace memory cache. Closes the files in the chain but does not delete them. There must not be any pending i/o's or flushes on the files. -@param[in] id tablespace identifier -@param[in] x_latched whether the caller holds X-mode space->latch +@param id tablespace identifier +@param x_latched whether the caller holds exclusive fil_space_t::latch @return true if success */ -bool -fil_space_free( - ulint id, - bool x_latched) +bool fil_space_free(uint32_t id, bool x_latched) { ut_ad(id != TRX_SYS_SPACE); @@ -915,7 +895,7 @@ fil_space_free( @param mode encryption mode @return pointer to created tablespace, to be filled in with add() @retval nullptr on failure (such as when the same tablespace exists) */ -fil_space_t *fil_space_t::create(ulint id, ulint flags, +fil_space_t *fil_space_t::create(uint32_t id, uint32_t flags, fil_type_t purpose, fil_space_crypt_t *crypt_data, fil_encryption_t mode) @@ -1021,18 +1001,13 @@ Assigns a new space id for a new single-table tablespace. This works simply by incrementing the global counter. If 4 billion id's is not enough, we may need to recycle id's. @return true if assigned, false if not */ -bool -fil_assign_new_space_id( -/*====================*/ - ulint* space_id) /*!< in/out: space id */ +bool fil_assign_new_space_id(uint32_t *space_id) { - ulint id; + uint32_t id = *space_id; bool success; mysql_mutex_lock(&fil_system.mutex); - id = *space_id; - if (id < fil_system.max_assigned_id) { id = fil_system.max_assigned_id; } @@ -1058,7 +1033,7 @@ fil_assign_new_space_id( << ". To reset the counter to zero" " you have to dump all your tables and" " recreate the whole InnoDB installation."; - *space_id = ULINT_UNDEFINED; + *space_id = UINT32_MAX; } mysql_mutex_unlock(&fil_system.mutex); @@ -1091,7 +1066,7 @@ bool fil_space_t::read_page0() } /** Look up a tablespace and ensure that its first page has been validated. */ -static fil_space_t *fil_space_get_space(ulint id) +static fil_space_t *fil_space_get_space(uint32_t id) { if (fil_space_t *space= fil_space_get_by_id(id)) if (space->read_page0()) @@ -1099,7 +1074,8 @@ static fil_space_t *fil_space_get_space(ulint id) return nullptr; } -void fil_space_set_recv_size_and_flags(ulint id, uint32_t size, uint32_t flags) +void fil_space_set_recv_size_and_flags(uint32_t id, uint32_t size, + uint32_t flags) { ut_ad(id < SRV_SPACE_ID_UPPER_BOUND); mysql_mutex_lock(&fil_system.mutex); @@ -1377,14 +1353,9 @@ void fil_space_t::close_all() /*******************************************************************//** Sets the max tablespace id counter if the given number is bigger than the previous value. */ -void -fil_set_max_space_id_if_bigger( -/*===========================*/ - ulint max_id) /*!< in: maximum known id */ +void fil_set_max_space_id_if_bigger(uint32_t max_id) { - if (max_id >= SRV_SPACE_ID_UPPER_BOUND) { - ib::fatal() << "Max tablespace id is too high, " << max_id; - } + ut_a(max_id < SRV_SPACE_ID_UPPER_BOUND); mysql_mutex_lock(&fil_system.mutex); @@ -1420,7 +1391,7 @@ fil_write_flushed_lsn( mach_write_to_8(buf + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION, lsn); - ulint fsp_flags = mach_read_from_4( + uint32_t fsp_flags = mach_read_from_4( buf + FSP_HEADER_OFFSET + FSP_SPACE_FLAGS); if (fil_space_t::full_crc32(fsp_flags)) { @@ -1442,7 +1413,7 @@ fil_write_flushed_lsn( @param id tablespace identifier @return tablespace @retval nullptr if the tablespace is missing or inaccessible */ -fil_space_t *fil_space_t::get(ulint id) +fil_space_t *fil_space_t::get(uint32_t id) { mysql_mutex_lock(&fil_system.mutex); fil_space_t *space= fil_space_get_by_id(id); @@ -1462,7 +1433,7 @@ fil_space_t *fil_space_t::get(ulint id) @param first_page_no first page number in the file @param path file path @param new_path new file path for type=FILE_RENAME */ -inline void mtr_t::log_file_op(mfile_type_t type, ulint space_id, +inline void mtr_t::log_file_op(mfile_type_t type, uint32_t space_id, const char *path, const char *new_path) { ut_ad((new_path != nullptr) == (type == FILE_RENAME)); @@ -1521,13 +1492,8 @@ inline void mtr_t::log_file_op(mfile_type_t type, ulint space_id, @param[in] old_name tablespace file name @param[in] new_name tablespace file name after renaming @param[in,out] mtr mini-transaction */ -static -void -fil_name_write_rename_low( - ulint space_id, - const char* old_name, - const char* new_name, - mtr_t* mtr) +static void fil_name_write_rename_low(uint32_t space_id, const char *old_name, + const char *new_name, mtr_t *mtr) { ut_ad(!is_predefined_tablespace(space_id)); mtr->log_file_op(FILE_RENAME, space_id, old_name, new_name); @@ -1537,35 +1503,28 @@ fil_name_write_rename_low( @param[in] space_id tablespace id @param[in] old_name tablespace file name @param[in] new_name tablespace file name after renaming */ -static void -fil_name_write_rename( - ulint space_id, - const char* old_name, - const char* new_name) +static void fil_name_write_rename(uint32_t space_id, + const char *old_name, const char* new_name) { - mtr_t mtr; - mtr.start(); - fil_name_write_rename_low(space_id, old_name, new_name, &mtr); - mtr.commit(); - log_write_up_to(mtr.commit_lsn(), true); + mtr_t mtr; + mtr.start(); + fil_name_write_rename_low(space_id, old_name, new_name, &mtr); + mtr.commit(); + log_write_up_to(mtr.commit_lsn(), true); } /** Write FILE_MODIFY for a file. @param[in] space_id tablespace id @param[in] name tablespace file name @param[in,out] mtr mini-transaction */ -static -void -fil_name_write( - ulint space_id, - const char* name, - mtr_t* mtr) +static void fil_name_write(uint32_t space_id, const char *name, + mtr_t *mtr) { ut_ad(!is_predefined_tablespace(space_id)); mtr->log_file_op(FILE_MODIFY, space_id, name); } -fil_space_t *fil_space_t::check_pending_operations(ulint id) +fil_space_t *fil_space_t::check_pending_operations(uint32_t id) { ut_a(!is_system_tablespace(id)); mysql_mutex_lock(&fil_system.mutex); @@ -1592,7 +1551,7 @@ being_deleted: return nullptr; /* Issue a warning every 10.24 seconds, starting after 2.56 seconds */ if ((count & 511) == 128) - sql_print_warning("InnoDB: Waiting for tablespace " ULINTPF + sql_print_warning("InnoDB: Waiting for tablespace " UINT32PF " to be deleted", id); std::this_thread::sleep_for(std::chrono::milliseconds(20)); mysql_mutex_lock(&fil_system.mutex); @@ -1631,7 +1590,7 @@ being_deleted: /** Close a single-table tablespace on failed IMPORT TABLESPACE. The tablespace must be cached in the memory cache. Free all pages used by the tablespace. */ -void fil_close_tablespace(ulint id) +void fil_close_tablespace(uint32_t id) { ut_ad(!is_system_tablespace(id)); fil_space_t* space = fil_space_t::check_pending_operations(id); @@ -1671,7 +1630,7 @@ void fil_close_tablespace(ulint id) @param id tablespace identifier @return detached file handle (to be closed by the caller) @return OS_FILE_CLOSED if no file existed */ -pfs_os_file_t fil_delete_tablespace(ulint id) +pfs_os_file_t fil_delete_tablespace(uint32_t id) { ut_ad(!is_system_tablespace(id)); pfs_os_file_t handle= OS_FILE_CLOSED; @@ -1880,11 +1839,8 @@ The tablespace must exist in the memory cache. @param[in] new_path_in new file name, or NULL if it is located in the normal data directory @return true if success */ -static bool -fil_rename_tablespace( - ulint id, - const char* old_path, - const char* new_path_in) +static bool fil_rename_tablespace(uint32_t id, const char *old_path, + const char *new_path_in) { fil_space_t* space; fil_node_t* node; @@ -1969,10 +1925,10 @@ must be >= FIL_IBD_FILE_INITIAL_SIZE @retval NULL on error */ fil_space_t* fil_ibd_create( - ulint space_id, + uint32_t space_id, const table_name_t name, const char* path, - ulint flags, + uint32_t flags, uint32_t size, fil_encryption_t mode, uint32_t key_id, @@ -2143,8 +2099,8 @@ fil_space_t* fil_ibd_open( bool validate, fil_type_t purpose, - ulint id, - ulint flags, + uint32_t id, + uint32_t flags, fil_space_t::name_type name, const char* path_in, dberr_t* err) @@ -2164,7 +2120,7 @@ fil_ibd_open( /* Table flags can be ULINT_UNDEFINED if dict_tf_to_fsp_flags_failure is set. */ - if (flags == ULINT_UNDEFINED) { + if (flags == UINT32_MAX) { corrupted: local_err = DB_CORRUPTION; func_exit: @@ -2507,10 +2463,7 @@ of the file in validate_for_recovery(). @param[out] space the tablespace, or NULL on error @return status of the operation */ enum fil_load_status -fil_ibd_load( - ulint space_id, - const char* filename, - fil_space_t*& space) +fil_ibd_load(uint32_t space_id, const char *filename, fil_space_t *&space) { /* If the a space is already in the file system cache with this space ID, then there is nothing to do. */ @@ -2629,7 +2582,7 @@ tablespace_check: /* Adjust the memory-based flags that would normally be set by dict_tf_to_fsp_flags(). In recovery, we have no data dictionary. */ - ulint flags = file.flags(); + uint32_t flags = file.flags(); if (fil_space_t::is_compressed(flags)) { flags |= page_zip_level << FSP_FLAGS_MEM_COMPRESSION_LEVEL; @@ -2663,7 +2616,7 @@ tablespace_check: (Typically when upgrading from MariaDB 10.1.0..10.1.20.) @param[in,out] space tablespace @param[in] flags desired tablespace flags */ -void fsp_flags_try_adjust(fil_space_t* space, ulint flags) +void fsp_flags_try_adjust(fil_space_t *space, uint32_t flags) { ut_ad(!srv_read_only_mode); ut_ad(fil_space_t::is_valid_flags(flags, space->id)); @@ -2713,14 +2666,15 @@ startup, there may be many tablespaces which are not yet in the memory cache. @param[in] table_flags table flags @return the tablespace @retval NULL if no matching tablespace exists in the memory cache */ -fil_space_t *fil_space_for_table_exists_in_mem(ulint id, ulint table_flags) +fil_space_t *fil_space_for_table_exists_in_mem(uint32_t id, + uint32_t table_flags) { - const ulint expected_flags = dict_tf_to_fsp_flags(table_flags); + const uint32_t expected_flags = dict_tf_to_fsp_flags(table_flags); mysql_mutex_lock(&fil_system.mutex); if (fil_space_t* space = fil_space_get_by_id(id)) { - ulint tf = expected_flags & ~FSP_FLAGS_MEM_MASK; - ulint sf = space->flags & ~FSP_FLAGS_MEM_MASK; + uint32_t tf = expected_flags & ~FSP_FLAGS_MEM_MASK; + uint32_t sf = space->flags & ~FSP_FLAGS_MEM_MASK; if (!fil_space_t::is_flags_equal(tf, sf) && !fil_space_t::is_flags_equal(sf, tf)) { diff --git a/storage/innobase/fil/fil0pagecompress.cc b/storage/innobase/fil/fil0pagecompress.cc index 9961bdf056c..d9c5cfc9f3b 100644 --- a/storage/innobase/fil/fil0pagecompress.cc +++ b/storage/innobase/fil/fil0pagecompress.cc @@ -195,7 +195,7 @@ static ulint fil_page_compress_low( static ulint fil_page_compress_for_full_crc32( const byte* buf, byte* out_buf, - ulint flags, + uint32_t flags, ulint block_size, bool encrypted) { @@ -378,7 +378,7 @@ static ulint fil_page_compress_for_non_full_crc32( ulint fil_page_compress( const byte* buf, byte* out_buf, - ulint flags, + uint32_t flags, ulint block_size, bool encrypted) { @@ -502,7 +502,8 @@ static bool fil_page_decompress_low( @return size of the compressed data @retval 0 if decompression failed @retval srv_page_size if the page was not compressed */ -ulint fil_page_decompress_for_full_crc32(byte* tmp_buf, byte* buf, ulint flags) +static size_t fil_page_decompress_for_full_crc32(byte *tmp_buf, byte *buf, + uint32_t flags) { ut_ad(fil_space_t::full_crc32(flags)); bool compressed = false; @@ -547,9 +548,7 @@ ulint fil_page_decompress_for_full_crc32(byte* tmp_buf, byte* buf, ulint flags) @return size of the compressed data @retval 0 if decompression failed @retval srv_page_size if the page was not compressed */ -ulint fil_page_decompress_for_non_full_crc32( - byte* tmp_buf, - byte* buf) +static size_t fil_page_decompress_for_non_full_crc32(byte *tmp_buf, byte *buf) { ulint header_len; uint comp_algo; @@ -600,10 +599,7 @@ ulint fil_page_decompress_for_non_full_crc32( @return size of the compressed data @retval 0 if decompression failed @retval srv_page_size if the page was not compressed */ -ulint fil_page_decompress( - byte* tmp_buf, - byte* buf, - ulint flags) +ulint fil_page_decompress(byte *tmp_buf, byte *buf, uint32_t flags) { if (fil_space_t::full_crc32(flags)) { return fil_page_decompress_for_full_crc32(tmp_buf, buf, flags); diff --git a/storage/innobase/fsp/fsp0file.cc b/storage/innobase/fsp/fsp0file.cc index 9a552e6dc5c..95eb9007944 100644 --- a/storage/innobase/fsp/fsp0file.cc +++ b/storage/innobase/fsp/fsp0file.cc @@ -304,8 +304,8 @@ Datafile::read_first_page(bool read_only_mode) + m_first_page); m_flags = fsp_header_get_flags(m_first_page); if (!fil_space_t::is_valid_flags(m_flags, m_space_id)) { - ulint cflags = fsp_flags_convert_from_101(m_flags); - if (cflags == ULINT_UNDEFINED) { + uint32_t cflags = fsp_flags_convert_from_101(m_flags); + if (cflags == UINT32_MAX) { ib::error() << "Invalid flags " << ib::hex(m_flags) << " in " << m_filepath; @@ -342,8 +342,7 @@ in order for this function to validate it. @param[in] flags The expected tablespace flags. @retval DB_SUCCESS if tablespace is valid, DB_ERROR if not. m_is_valid is also set true on success, else false. */ -dberr_t -Datafile::validate_to_dd(ulint space_id, ulint flags) +dberr_t Datafile::validate_to_dd(uint32_t space_id, uint32_t flags) { dberr_t err; @@ -433,7 +432,7 @@ Datafile::validate_for_recovery() } } - if (m_space_id == ULINT_UNDEFINED) { + if (m_space_id == UINT32_MAX) { return DB_SUCCESS; /* empty file */ } @@ -629,15 +628,15 @@ Datafile::find_space_id() page_size <<= 1) { /* map[space_id] = count of pages */ typedef std::map< - ulint, - ulint, - std::less<ulint>, - ut_allocator<std::pair<const ulint, ulint> > > + uint32_t, + uint32_t, + std::less<uint32_t>, + ut_allocator<std::pair<const uint32_t, uint32_t> > > Pages; Pages verify; - ulint page_count = 64; - ulint valid_pages = 0; + uint32_t page_count = 64; + uint32_t valid_pages = 0; /* Adjust the number of pages to analyze based on file size */ while ((page_count * page_size) > file_size) { @@ -651,14 +650,14 @@ Datafile::find_space_id() byte* page = static_cast<byte*>( aligned_malloc(page_size, page_size)); - ulint fsp_flags; + uint32_t fsp_flags; /* provide dummy value if the first os_file_read() fails */ switch (srv_checksum_algorithm) { case SRV_CHECKSUM_ALGORITHM_STRICT_FULL_CRC32: case SRV_CHECKSUM_ALGORITHM_FULL_CRC32: fsp_flags = 1U << FSP_FLAGS_FCRC32_POS_MARKER | FSP_FLAGS_FCRC32_PAGE_SSIZE() - | innodb_compression_algorithm + | uint(innodb_compression_algorithm) << FSP_FLAGS_FCRC32_POS_COMPRESSED_ALGO; break; default: @@ -698,7 +697,7 @@ Datafile::find_space_id() if (noncompressed_ok || compressed_ok) { - ulint space_id = mach_read_from_4(page + uint32_t space_id = mach_read_from_4(page + FIL_PAGE_SPACE_ID); if (space_id > 0) { @@ -777,14 +776,14 @@ Datafile::restore_from_doublewrite() return(true); } - ulint flags = mach_read_from_4( + uint32_t flags = mach_read_from_4( FSP_HEADER_OFFSET + FSP_SPACE_FLAGS + page); if (!fil_space_t::is_valid_flags(flags, m_space_id)) { flags = fsp_flags_convert_from_101(flags); /* recv_dblwr_t::validate_page() inside find_page() checked this already. */ - ut_ad(flags != ULINT_UNDEFINED); + ut_ad(flags != UINT32_MAX); /* The flags on the page should be converted later. */ } diff --git a/storage/innobase/fsp/fsp0fsp.cc b/storage/innobase/fsp/fsp0fsp.cc index 2581cecddc3..620b5a0e49b 100644 --- a/storage/innobase/fsp/fsp0fsp.cc +++ b/storage/innobase/fsp/fsp0fsp.cc @@ -1099,7 +1099,7 @@ fsp_alloc_free_page( { fil_addr_t first; xdes_t* descr; - const ulint space_id = space->id; + const uint32_t space_id = space->id; ut_d(space->modify_check(*mtr)); buf_block_t* block = fsp_get_header(space, mtr); @@ -1538,7 +1538,7 @@ static fseg_inode_t* fseg_inode_try_get( const fseg_header_t* header, - ulint space, + uint32_t space, ulint zip_size, mtr_t* mtr, buf_block_t** block) @@ -1575,7 +1575,7 @@ static fseg_inode_t* fseg_inode_get( const fseg_header_t* header, - ulint space, + uint32_t space, ulint zip_size, mtr_t* mtr, buf_block_t** block = NULL) @@ -2023,7 +2023,7 @@ fseg_alloc_free_page_low( xdes_t* ret_descr; /*!< the extent of the allocated page */ buf_block_t* xdes; ulint n; - const ulint space_id = space->id; + const uint32_t space_id = space->id; ut_ad((direction >= FSP_UP) && (direction <= FSP_NO_DIR)); ut_ad(mach_read_from_4(seg_inode + FSEG_MAGIC_N) @@ -2278,13 +2278,12 @@ fseg_alloc_free_page_general( in which the page should be initialized. */ { fseg_inode_t* inode; - ulint space_id; fil_space_t* space; buf_block_t* iblock; buf_block_t* block; uint32_t n_reserved; - space_id = page_get_space_id(page_align(seg_header)); + const uint32_t space_id = page_get_space_id(page_align(seg_header)); space = mtr->x_lock_space(space_id); inode = fseg_inode_get(seg_header, space_id, space->zip_size(), mtr, &iblock); diff --git a/storage/innobase/fsp/fsp0space.cc b/storage/innobase/fsp/fsp0space.cc index b069250ff9f..6bdf9fcc4d8 100644 --- a/storage/innobase/fsp/fsp0space.cc +++ b/storage/innobase/fsp/fsp0space.cc @@ -59,7 +59,7 @@ Tablespace::shutdown() m_files.clear(); ut_free(m_path); m_path = NULL; - m_space_id = ULINT_UNDEFINED; + m_space_id = UINT32_MAX; } /** Note that the data file was found. @@ -118,7 +118,7 @@ Tablespace::open_or_create(bool is_temp) /* Create the tablespace entry for the multi-file tablespace in the tablespace manager. */ - ulint fsp_flags = 0; + uint32_t fsp_flags; switch (srv_checksum_algorithm) { case SRV_CHECKSUM_ALGORITHM_FULL_CRC32: diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index d2185819225..e992b435b2d 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -1763,16 +1763,11 @@ If correct, set the associated page_size_shift which is the power of 2 for this page size. @param[in] page_size Page Size to evaluate @return an associated page_size_shift if valid, 0 if invalid. */ -inline -ulong -innodb_page_size_validate( - ulong page_size) +inline uint32_t innodb_page_size_validate(ulong page_size) { - ulong n; - DBUG_ENTER("innodb_page_size_validate"); - for (n = UNIV_PAGE_SIZE_SHIFT_MIN; + for (uint32_t n = UNIV_PAGE_SIZE_SHIFT_MIN; n <= UNIV_PAGE_SIZE_SHIFT_MAX; n++) { if (page_size == static_cast<ulong>(1 << n)) { @@ -18742,10 +18737,23 @@ static MYSQL_SYSVAR_ULONG(purge_batch_size, srv_purge_batch_size, 1, /* Minimum value */ 5000, 0); /* Maximum value */ +extern void srv_update_purge_thread_count(uint n); + +static +void +innodb_purge_threads_update(THD*, struct st_mysql_sys_var*, void*, const void*save ) +{ + srv_update_purge_thread_count(*static_cast<const uint*>(save)); +} + static MYSQL_SYSVAR_UINT(purge_threads, srv_n_purge_threads, - PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY, + PLUGIN_VAR_OPCMDARG, "Number of tasks for purging transaction history", - NULL, NULL, 4, 1, innodb_purge_threads_MAX, 0); + NULL, innodb_purge_threads_update, + 4, /* Default setting */ + 1, /* Minimum value */ + innodb_purge_threads_MAX, /* Maximum value */ + 0); static MYSQL_SYSVAR_UINT(fast_shutdown, srv_fast_shutdown, PLUGIN_VAR_OPCMDARG, @@ -19255,7 +19263,7 @@ static MYSQL_SYSVAR_STR(undo_directory, srv_undo_dir, "Directory where undo tablespace files live, this path can be absolute.", NULL, NULL, NULL); -static MYSQL_SYSVAR_ULONG(undo_tablespaces, srv_undo_tablespaces, +static MYSQL_SYSVAR_UINT(undo_tablespaces, srv_undo_tablespaces, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, "Number of undo tablespaces to use.", NULL, NULL, diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 3bf56cd2bc6..60b32736474 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -10436,8 +10436,8 @@ commit_cache_norebuild( space->flags |= FSP_FLAGS_MASK_PAGE_COMPRESSION; } else if (!space->is_compressed()) { - space->flags - |= innodb_compression_algorithm + space->flags |= static_cast<uint32_t>( + innodb_compression_algorithm) << FSP_FLAGS_FCRC32_POS_COMPRESSED_ALGO; } mysql_mutex_unlock(&fil_system.mutex); diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc index bd471dff765..0ab1a35dfc7 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.cc +++ b/storage/innobase/ibuf/ibuf0ibuf.cc @@ -2258,7 +2258,7 @@ static void ibuf_read_merge_pages(const uint32_t* space_ids, #endif for (ulint i = 0; i < n_stored; i++) { - const ulint space_id = space_ids[i]; + const uint32_t space_id = space_ids[i]; fil_space_t* s = fil_space_t::get(space_id); if (!s) { tablespace_deleted: @@ -2944,7 +2944,7 @@ void ibuf_update_max_tablespace_id(void) /*===============================*/ { - ulint max_space_id; + uint32_t max_space_id; const rec_t* rec; const byte* field; ulint len; @@ -4463,7 +4463,7 @@ reset_bit: /** Delete all change buffer entries for a tablespace, in DISCARD TABLESPACE, IMPORT TABLESPACE, or crash recovery. @param[in] space missing or to-be-discarded tablespace */ -void ibuf_delete_for_discarded_space(ulint space) +void ibuf_delete_for_discarded_space(uint32_t space) { mem_heap_t* heap; btr_pcur_t pcur; diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h index 59f4c400653..a99bada12f9 100644 --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -425,16 +425,13 @@ Decrements the bufferfix count. */ bool buf_is_zeroes(st_::span<const byte> buf); /** Check if a page is corrupt. -@param[in] check_lsn whether the LSN should be checked -@param[in] read_buf database page -@param[in] fsp_flags tablespace flags +@param check_lsn whether FIL_PAGE_LSN should be checked +@param read_buf database page +@param fsp_flags contents of FIL_SPACE_FLAGS @return whether the page is corrupted */ -bool -buf_page_is_corrupted( - bool check_lsn, - const byte* read_buf, - ulint fsp_flags) - MY_ATTRIBUTE((warn_unused_result)); +bool buf_page_is_corrupted(bool check_lsn, const byte *read_buf, + uint32_t fsp_flags) + MY_ATTRIBUTE((warn_unused_result)); inline void *aligned_malloc(size_t size, size_t align) { @@ -463,7 +460,8 @@ stored in 26th position. @param[in] read_buf database page @param[in] fsp_flags tablespace flags @return key version of the page. */ -inline uint32_t buf_page_get_key_version(const byte* read_buf, ulint fsp_flags) +inline uint32_t buf_page_get_key_version(const byte* read_buf, + uint32_t fsp_flags) { static_assert(FIL_PAGE_FCRC32_KEY_VERSION == 0, "compatibility"); return fil_space_t::full_crc32(fsp_flags) @@ -478,7 +476,7 @@ stored in page type. @param[in] read_buf database page @param[in] fsp_flags tablespace flags @return true if page is compressed. */ -inline bool buf_page_is_compressed(const byte* read_buf, ulint fsp_flags) +inline bool buf_page_is_compressed(const byte* read_buf, uint32_t fsp_flags) { uint16_t page_type= fil_page_get_type(read_buf); return fil_space_t::full_crc32(fsp_flags) @@ -604,12 +602,10 @@ buf_pool_size_align( /** Verify that post encryption checksum match with the calculated checksum. This function should be called only if tablespace contains crypt data metadata. -@param[in] page page frame -@param[in] fsp_flags tablespace flags -@return true if page is encrypted and OK, false otherwise */ -bool buf_page_verify_crypt_checksum( - const byte* page, - ulint fsp_flags); +@param page page frame +@param fsp_flags contents of FSP_SPACE_FLAGS +@return whether the page is encrypted and valid */ +bool buf_page_verify_crypt_checksum(const byte *page, uint32_t fsp_flags); /** Calculate a ROW_FORMAT=COMPRESSED page checksum and update the page. @param[in,out] page page to update diff --git a/storage/innobase/include/buf0flu.h b/storage/innobase/include/buf0flu.h index cd0d068abb0..3bbe631b94d 100644 --- a/storage/innobase/include/buf0flu.h +++ b/storage/innobase/include/buf0flu.h @@ -54,7 +54,7 @@ deleting the data file of that tablespace. The pages still remain a part of LRU and are evicted from the list as they age towards the tail of the LRU. @param id tablespace identifier */ -void buf_flush_remove_pages(ulint id); +void buf_flush_remove_pages(uint32_t id); /*******************************************************************//** Relocates a buffer control block on the flush_list. diff --git a/storage/innobase/include/buf0rea.h b/storage/innobase/include/buf0rea.h index 8d6b28194dc..986a792b97e 100644 --- a/storage/innobase/include/buf0rea.h +++ b/storage/innobase/include/buf0rea.h @@ -101,12 +101,10 @@ which could result in a deadlock if the OS does not support asynchronous io. ulint buf_read_ahead_linear(const page_id_t page_id, ulint zip_size, bool ibuf); -/** Issues read requests for pages which recovery wants to read in. -@param[in] space_id tablespace id -@param[in] page_nos array of page numbers to read, with the -highest page number the last in the array -@param[in] n number of page numbers in the array */ -void buf_read_recv_pages(ulint space_id, const uint32_t* page_nos, ulint n); +/** Issue read requests for pages that need to be recovered. +@param space_id tablespace identifier +@param page_nos page numbers to read, in ascending order */ +void buf_read_recv_pages(uint32_t space_id, st_::span<uint32_t> page_nos); /** @name Modes used in read-ahead @{ */ /** read only pages belonging to the insert buffer tree */ diff --git a/storage/innobase/include/buf0types.h b/storage/innobase/include/buf0types.h index 04b47aaddab..86fcc5a17d0 100644 --- a/storage/innobase/include/buf0types.h +++ b/storage/innobase/include/buf0types.h @@ -101,12 +101,10 @@ class page_id_t public: /** Constructor from (space, page_no). - @param[in] space tablespace id - @param[in] page_no page number */ - page_id_t(ulint space, uint32_t page_no) : m_id(uint64_t{space} << 32 | page_no) - { - ut_ad(space <= 0xFFFFFFFFU); - } + @param space tablespace id + @param page_no page number */ + page_id_t(uint32_t space, uint32_t page_no) : + m_id(uint64_t{space} << 32 | page_no) {} page_id_t(uint64_t id) : m_id(id) {} bool operator==(const page_id_t& rhs) const { return m_id == rhs.m_id; } diff --git a/storage/innobase/include/dict0boot.h b/storage/innobase/include/dict0boot.h index 869905c6b97..07ecfe4edff 100644 --- a/storage/innobase/include/dict0boot.h +++ b/storage/innobase/include/dict0boot.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2018, 2020, MariaDB Corporation. +Copyright (c) 2018, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -45,7 +45,7 @@ dict_hdr_get_new_id( (not assigned if NULL) */ index_id_t* index_id, /*!< out: index id (not assigned if NULL) */ - ulint* space_id); /*!< out: space id + uint32_t* space_id); /*!< out: space id (not assigned if NULL) */ /** Update dict_sys.row_id in the dictionary header file page. */ void dict_hdr_flush_row_id(row_id_t id); diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index e91ee7349d2..505fe76b008 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -871,11 +871,8 @@ fil_space_t::flags | 0 | 0 | 1 | 1 ================================================================== @param[in] table_flags dict_table_t::flags @return tablespace flags (fil_space_t::flags) */ -UNIV_INLINE -ulint -dict_tf_to_fsp_flags(ulint table_flags) - MY_ATTRIBUTE((const)); - +inline uint32_t dict_tf_to_fsp_flags(unsigned table_flags) + MY_ATTRIBUTE((const)); /** Extract the ROW_FORMAT=COMPRESSED page size from table flags. @param[in] flags flags diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic index a98ca38d9b3..8af2d93f831 100644 --- a/storage/innobase/include/dict0dict.ic +++ b/storage/innobase/include/dict0dict.ic @@ -618,19 +618,16 @@ fil_space_t::flags | 0 | 0 | 1 | 1 ================================================================== @param[in] table_flags dict_table_t::flags @return tablespace flags (fil_space_t::flags) */ -UNIV_INLINE -ulint -dict_tf_to_fsp_flags(ulint table_flags) +inline uint32_t dict_tf_to_fsp_flags(unsigned table_flags) { - ulint fsp_flags; - ulint page_compression_level = DICT_TF_GET_PAGE_COMPRESSION_LEVEL( + uint32_t fsp_flags; + uint32_t page_compression_level = DICT_TF_GET_PAGE_COMPRESSION_LEVEL( table_flags); ut_ad((DICT_TF_GET_PAGE_COMPRESSION(table_flags) == 0) == (page_compression_level == 0)); - DBUG_EXECUTE_IF("dict_tf_to_fsp_flags_failure", - return(ULINT_UNDEFINED);); + DBUG_EXECUTE_IF("dict_tf_to_fsp_flags_failure", return UINT32_MAX;); /* No ROW_FORMAT=COMPRESSED for innodb_checksum_algorithm=full_crc32 */ if ((srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_FULL_CRC32 @@ -641,7 +638,8 @@ dict_tf_to_fsp_flags(ulint table_flags) | FSP_FLAGS_FCRC32_PAGE_SSIZE(); if (page_compression_level) { - fsp_flags |= innodb_compression_algorithm + fsp_flags |= static_cast<uint32_t>( + innodb_compression_algorithm) << FSP_FLAGS_FCRC32_POS_COMPRESSED_ALGO; } } else { diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index 2a7b38f345c..f0aa41d2e5b 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -112,7 +112,7 @@ are described in fsp0fsp.h. */ /** This bitmask is used in SYS_TABLES.N_COLS to set and test whether the Compact page format is used, i.e ROW_FORMAT != REDUNDANT */ -#define DICT_N_COLS_COMPACT 0x80000000UL +constexpr uint32_t DICT_N_COLS_COMPACT= 1U << 31; /** Width of the COMPACT flag */ #define DICT_TF_WIDTH_COMPACT 1 @@ -2018,7 +2018,7 @@ public: /** The tablespace of the table */ fil_space_t* space; /** Tablespace ID */ - ulint space_id; + uint32_t space_id; /** Stores information about: 1 row format (redundant or compact), diff --git a/storage/innobase/include/fil0crypt.h b/storage/innobase/include/fil0crypt.h index 29a76defec1..8c698dafb5b 100644 --- a/storage/innobase/include/fil0crypt.h +++ b/storage/innobase/include/fil0crypt.h @@ -291,20 +291,20 @@ byte* fil_space_encrypt( /** Decrypt a page. @param]in] space_id space id +@param[in] fsp_flags Tablespace flags @param[in] crypt_data crypt_data @param[in] tmp_frame Temporary buffer @param[in] physical_size page size -@param[in] fsp_flags Tablespace flags @param[in,out] src_frame Page to decrypt @param[out] err DB_SUCCESS or DB_DECRYPTION_FAILED @return true if page decrypted, false if not.*/ bool fil_space_decrypt( - ulint space_id, + uint32_t space_id, + uint32_t fsp_flags, fil_space_crypt_t* crypt_data, byte* tmp_frame, ulint physical_size, - ulint fsp_flags, byte* src_frame, dberr_t* err); diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index 60f2be95ece..1c306670354 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -43,7 +43,7 @@ Created 10/25/1995 Heikki Tuuri #include <mutex> struct unflushed_spaces_tag_t; -struct rotation_list_tag_t; +struct default_encrypt_tag_t; struct space_list_tag_t; struct named_spaces_tag_t; @@ -82,14 +82,14 @@ enum srv_flush_t extern ulong srv_file_flush_method; /** Undo tablespaces starts with space_id. */ -extern ulint srv_undo_space_id_start; +extern uint32_t srv_undo_space_id_start; /** The number of UNDO tablespaces that are open and ready to use. */ -extern ulint srv_undo_tablespaces_open; +extern uint32_t srv_undo_tablespaces_open; /** Check whether given space id is undo tablespace id @param[in] space_id space id to check @return true if it is undo tablespace else false. */ -inline bool srv_is_undo_tablespace(ulint space_id) +inline bool srv_is_undo_tablespace(uint32_t space_id) { return srv_undo_space_id_start > 0 && space_id >= srv_undo_space_id_start && @@ -336,7 +336,7 @@ enum fil_encryption_t }; struct fil_space_t final : ilist_node<unflushed_spaces_tag_t>, - ilist_node<rotation_list_tag_t>, + ilist_node<default_encrypt_tag_t>, ilist_node<space_list_tag_t>, ilist_node<named_spaces_tag_t> #else @@ -352,8 +352,6 @@ struct fil_space_t final latch.destroy(); } - ulint id; /*!< space id */ - /** fil_system.spaces chain node */ fil_space_t *hash; lsn_t max_lsn; @@ -363,6 +361,8 @@ struct fil_space_t final Protected by log_sys.mutex. If and only if this is nonzero, the tablespace will be in named_spaces. */ + /** tablespace identifier */ + uint32_t id; /** whether undo tablespace truncation is in progress */ bool is_being_truncated; fil_type_t purpose;/*!< purpose */ @@ -522,7 +522,7 @@ public: @param id tablespace identifier @return tablespace @retval nullptr if no tablespace was found */ - static fil_space_t *check_pending_operations(ulint id); + static fil_space_t *check_pending_operations(uint32_t id); private: MY_ATTRIBUTE((warn_unused_result)) @@ -668,274 +668,224 @@ public: freed_ranges.clear(); } #endif /* !UNIV_INNOCHECKSUM */ - /** FSP_SPACE_FLAGS and FSP_FLAGS_MEM_ flags; - check fsp0types.h to more info about flags. */ - ulint flags; - - /** Determine if full_crc32 is used for a data file - @param[in] flags tablespace flags (FSP_SPACE_FLAGS) - @return whether the full_crc32 algorithm is active */ - static bool full_crc32(ulint flags) { - return flags & FSP_FLAGS_FCRC32_MASK_MARKER; - } - /** @return whether innodb_checksum_algorithm=full_crc32 is active */ - bool full_crc32() const { return full_crc32(flags); } - /** Determine the logical page size. - @param flags tablespace flags (FSP_FLAGS) - @return the logical page size - @retval 0 if the flags are invalid */ - static unsigned logical_size(ulint flags) { - - ulint page_ssize = 0; - - if (full_crc32(flags)) { - page_ssize = FSP_FLAGS_FCRC32_GET_PAGE_SSIZE(flags); - } else { - page_ssize = FSP_FLAGS_GET_PAGE_SSIZE(flags); - } - - switch (page_ssize) { - case 3: return 4096; - case 4: return 8192; - case 5: - { ut_ad(full_crc32(flags)); return 16384; } - case 0: - { ut_ad(!full_crc32(flags)); return 16384; } - case 6: return 32768; - case 7: return 65536; - default: return 0; - } - } - /** Determine the ROW_FORMAT=COMPRESSED page size. - @param flags tablespace flags (FSP_FLAGS) - @return the ROW_FORMAT=COMPRESSED page size - @retval 0 if ROW_FORMAT=COMPRESSED is not used */ - static unsigned zip_size(ulint flags) { - - if (full_crc32(flags)) { - return 0; - } - - ulint zip_ssize = FSP_FLAGS_GET_ZIP_SSIZE(flags); - return zip_ssize - ? (UNIV_ZIP_SIZE_MIN >> 1) << zip_ssize : 0; - } - /** Determine the physical page size. - @param flags tablespace flags (FSP_FLAGS) - @return the physical page size */ - static unsigned physical_size(ulint flags) { - - if (full_crc32(flags)) { - return logical_size(flags); - } - - ulint zip_ssize = FSP_FLAGS_GET_ZIP_SSIZE(flags); - return zip_ssize - ? (UNIV_ZIP_SIZE_MIN >> 1) << zip_ssize - : unsigned(srv_page_size); - } - /** @return the ROW_FORMAT=COMPRESSED page size - @retval 0 if ROW_FORMAT=COMPRESSED is not used */ - unsigned zip_size() const { return zip_size(flags); } - /** @return the physical page size */ - unsigned physical_size() const { return physical_size(flags); } - /** Check whether the compression enabled in tablespace. - @param[in] flags tablespace flags */ - static bool is_compressed(ulint flags) { - - if (full_crc32(flags)) { - ulint algo = FSP_FLAGS_FCRC32_GET_COMPRESSED_ALGO( - flags); - DBUG_ASSERT(algo <= PAGE_ALGORITHM_LAST); - return algo > 0; - } - - return FSP_FLAGS_HAS_PAGE_COMPRESSION(flags); - } - /** @return whether the compression enabled for the tablespace. */ - bool is_compressed() const { return is_compressed(flags); } - - /** Get the compression algorithm for full crc32 format. - @param[in] flags tablespace flags - @return algorithm type of tablespace */ - static ulint get_compression_algo(ulint flags) - { - return full_crc32(flags) - ? FSP_FLAGS_FCRC32_GET_COMPRESSED_ALGO(flags) - : 0; - } - /** @return the page_compressed algorithm - @retval 0 if not page_compressed */ - ulint get_compression_algo() const { - return fil_space_t::get_compression_algo(flags); - } - /** Determine if the page_compressed page contains an extra byte - for exact compressed stream length - @param[in] flags tablespace flags - @return whether the extra byte is needed */ - static bool full_crc32_page_compressed_len(ulint flags) - { - DBUG_ASSERT(full_crc32(flags)); - switch (get_compression_algo(flags)) { - case PAGE_LZ4_ALGORITHM: - case PAGE_LZO_ALGORITHM: - case PAGE_SNAPPY_ALGORITHM: - return true; - } - return false; - } - - /** Whether the full checksum matches with non full checksum flags. - @param[in] flags flags present - @param[in] expected expected flags - @return true if it is equivalent */ - static bool is_flags_full_crc32_equal(ulint flags, ulint expected) - { - ut_ad(full_crc32(flags)); - ulint fcrc32_psize = FSP_FLAGS_FCRC32_GET_PAGE_SSIZE(flags); - - if (full_crc32(expected)) { - /* The data file may have been created with a - different innodb_compression_algorithm. But - we only support one innodb_page_size for all files. */ - return fcrc32_psize - == FSP_FLAGS_FCRC32_GET_PAGE_SSIZE(expected); - } - - ulint non_fcrc32_psize = FSP_FLAGS_GET_PAGE_SSIZE(expected); - - if (!non_fcrc32_psize) { - if (fcrc32_psize != 5) { - return false; - } - } else if (fcrc32_psize != non_fcrc32_psize) { - return false; - } - - return true; - } - /** Whether old tablespace flags match full_crc32 flags. - @param[in] flags flags present - @param[in] expected expected flags - @return true if it is equivalent */ - static bool is_flags_non_full_crc32_equal(ulint flags, ulint expected) - { - ut_ad(!full_crc32(flags)); - - if (!full_crc32(expected)) { - return false; - } - - ulint non_fcrc32_psize = FSP_FLAGS_GET_PAGE_SSIZE(flags); - ulint fcrc32_psize = FSP_FLAGS_FCRC32_GET_PAGE_SSIZE( - expected); - - if (!non_fcrc32_psize) { - if (fcrc32_psize != 5) { - return false; - } - } else if (fcrc32_psize != non_fcrc32_psize) { - return false; - } - - return true; - } - /** Whether both fsp flags are equivalent */ - static bool is_flags_equal(ulint flags, ulint expected) - { - if (!((flags ^ expected) & ~(1U << FSP_FLAGS_POS_RESERVED))) { - return true; - } + /** FSP_SPACE_FLAGS and FSP_FLAGS_MEM_ flags; + check fsp0types.h to more info about flags. */ + uint32_t flags; + + /** Determine if full_crc32 is used for a data file + @param[in] flags tablespace flags (FSP_SPACE_FLAGS) + @return whether the full_crc32 algorithm is active */ + static bool full_crc32(uint32_t flags) + { return flags & FSP_FLAGS_FCRC32_MASK_MARKER; } + /** @return whether innodb_checksum_algorithm=full_crc32 is active */ + bool full_crc32() const { return full_crc32(flags); } + /** Determine the logical page size. + @param flags tablespace flags (FSP_SPACE_FLAGS) + @return the logical page size + @retval 0 if the flags are invalid */ + static unsigned logical_size(uint32_t flags) + { + switch (full_crc32(flags) + ? FSP_FLAGS_FCRC32_GET_PAGE_SSIZE(flags) + : FSP_FLAGS_GET_PAGE_SSIZE(flags)) { + case 3: return 4096; + case 4: return 8192; + case 5: return full_crc32(flags) ? 16384 : 0; + case 0: return full_crc32(flags) ? 0 : 16384; + case 6: return 32768; + case 7: return 65536; + default: return 0; + } + } + /** Determine the ROW_FORMAT=COMPRESSED page size. + @param flags tablespace flags (FSP_SPACE_FLAGS) + @return the ROW_FORMAT=COMPRESSED page size + @retval 0 if ROW_FORMAT=COMPRESSED is not used */ + static unsigned zip_size(uint32_t flags) + { + if (full_crc32(flags)) + return 0; + const uint32_t zip_ssize= FSP_FLAGS_GET_ZIP_SSIZE(flags); + return zip_ssize ? (UNIV_ZIP_SIZE_MIN >> 1) << zip_ssize : 0; + } + /** Determine the physical page size. + @param flags tablespace flags (FSP_SPACE_FLAGS) + @return the physical page size */ + static unsigned physical_size(uint32_t flags) + { + if (full_crc32(flags)) + return logical_size(flags); - return full_crc32(flags) - ? is_flags_full_crc32_equal(flags, expected) - : is_flags_non_full_crc32_equal(flags, expected); - } - /** Validate the tablespace flags for full crc32 format. - @param[in] flags the content of FSP_SPACE_FLAGS - @return whether the flags are correct in full crc32 format */ - static bool is_fcrc32_valid_flags(ulint flags) - { - ut_ad(flags & FSP_FLAGS_FCRC32_MASK_MARKER); - const ulint page_ssize = physical_size(flags); - if (page_ssize < 3 || page_ssize & 8) { - return false; - } + const uint32_t zip_ssize= FSP_FLAGS_GET_ZIP_SSIZE(flags); + return zip_ssize + ? (UNIV_ZIP_SIZE_MIN >> 1) << zip_ssize + : unsigned(srv_page_size); + } - flags >>= FSP_FLAGS_FCRC32_POS_COMPRESSED_ALGO; + /** @return the ROW_FORMAT=COMPRESSED page size + @retval 0 if ROW_FORMAT=COMPRESSED is not used */ + unsigned zip_size() const { return zip_size(flags); } + /** @return the physical page size */ + unsigned physical_size() const { return physical_size(flags); } + /** Check whether the the tablespace is PAGE_COMPRESSED. + @param flags contents of FSP_SPACE_FLAGS */ + static bool is_compressed(uint32_t flags) + { + if (!full_crc32(flags)) + return FSP_FLAGS_HAS_PAGE_COMPRESSION(flags); + const uint32_t algo= FSP_FLAGS_FCRC32_GET_COMPRESSED_ALGO(flags); + DBUG_ASSERT(algo <= PAGE_ALGORITHM_LAST); + return algo > 0; + } - return flags <= PAGE_ALGORITHM_LAST; - } - /** Validate the tablespace flags. - @param[in] flags content of FSP_SPACE_FLAGS - @param[in] is_ibd whether this is an .ibd file - (not system tablespace) - @return whether the flags are correct. */ - static bool is_valid_flags(ulint flags, bool is_ibd) - { - DBUG_EXECUTE_IF("fsp_flags_is_valid_failure", - return false;); + /** @return whether the compression enabled for the tablespace. */ + bool is_compressed() const { return is_compressed(flags); } - if (full_crc32(flags)) { - return is_fcrc32_valid_flags(flags); - } + /** Get the compression algorithm for full crc32 format. + @param flags contents of FSP_SPACE_FLAGS + @return PAGE_COMPRESSED algorithm of full_crc32 tablespace + @retval 0 if not PAGE_COMPRESSED or not full_crc32 */ + static unsigned get_compression_algo(uint32_t flags) + { + return full_crc32(flags) + ? FSP_FLAGS_FCRC32_GET_COMPRESSED_ALGO(flags) + : 0; + } + /** @return the page_compressed algorithm + @retval 0 if not page_compressed */ + unsigned get_compression_algo() const { return get_compression_algo(flags); } + /** Determine if the page_compressed page contains an extra byte + for exact compressed stream length + @param flags contents of FSP_SPACE_FLAGS + @return whether the extra byte is needed */ + static bool full_crc32_page_compressed_len(uint32_t flags) + { + DBUG_ASSERT(full_crc32(flags)); + switch (get_compression_algo(flags)) { + case PAGE_LZ4_ALGORITHM: + case PAGE_LZO_ALGORITHM: + case PAGE_SNAPPY_ALGORITHM: + return true; + } + return false; + } - if (flags == 0) { - return true; - } + /** Whether the full checksum matches with non full checksum flags. + @param flags contents of FSP_SPACE_FLAGS + @param expected expected flags + @return true if it is equivalent */ + static bool is_flags_full_crc32_equal(uint32_t flags, uint32_t expected) + { + ut_ad(full_crc32(flags)); + uint32_t fcrc32_psize= FSP_FLAGS_FCRC32_GET_PAGE_SSIZE(flags); + + if (full_crc32(expected)) + /* The data file may have been created with a + different innodb_compression_algorithm. But + we only support one innodb_page_size for all files. */ + return fcrc32_psize == FSP_FLAGS_FCRC32_GET_PAGE_SSIZE(expected); + + uint32_t non_fcrc32_psize = FSP_FLAGS_GET_PAGE_SSIZE(expected); + if (!non_fcrc32_psize) + return fcrc32_psize == 5; + return fcrc32_psize == non_fcrc32_psize; + } - if (flags & ~FSP_FLAGS_MASK) { - return false; - } + /** Whether old tablespace flags match full_crc32 flags. + @param flags contents of FSP_SPACE_FLAGS + @param expected expected flags + @return true if it is equivalent */ + static bool is_flags_non_full_crc32_equal(uint32_t flags, uint32_t expected) + { + ut_ad(!full_crc32(flags)); + if (!full_crc32(expected)) + return false; - if ((flags & (FSP_FLAGS_MASK_POST_ANTELOPE - | FSP_FLAGS_MASK_ATOMIC_BLOBS)) - == FSP_FLAGS_MASK_ATOMIC_BLOBS) { - /* If the "atomic blobs" flag (indicating - ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED) flag - is set, then the "post Antelope" - (ROW_FORMAT!=REDUNDANT) flag must also be set. */ - return false; - } + uint32_t non_fcrc32_psize= FSP_FLAGS_GET_PAGE_SSIZE(flags); + uint32_t fcrc32_psize = FSP_FLAGS_FCRC32_GET_PAGE_SSIZE(expected); - /* Bits 10..14 should be 0b0000d where d is the DATA_DIR flag - of MySQL 5.6 and MariaDB 10.0, which we ignore. - In the buggy FSP_SPACE_FLAGS written by MariaDB 10.1.0 to 10.1.20, - bits 10..14 would be nonzero 0bsssaa where sss is - nonzero PAGE_SSIZE (3, 4, 6, or 7) - and aa is ATOMIC_WRITES (not 0b11). */ - if (FSP_FLAGS_GET_RESERVED(flags) & ~1U) { - return false; - } + if (!non_fcrc32_psize) + return fcrc32_psize == 5; + return fcrc32_psize == non_fcrc32_psize; + } - const ulint ssize = FSP_FLAGS_GET_PAGE_SSIZE(flags); - if (ssize == 1 || ssize == 2 || ssize == 5 || ssize & 8) { - /* the page_size is not between 4k and 64k; - 16k should be encoded as 0, not 5 */ - return false; - } + /** Whether both fsp flags are equivalent */ + static bool is_flags_equal(uint32_t flags, uint32_t expected) + { + if (!((flags ^ expected) & ~(1U << FSP_FLAGS_POS_RESERVED))) + return true; + return full_crc32(flags) + ? is_flags_full_crc32_equal(flags, expected) + : is_flags_non_full_crc32_equal(flags, expected); + } - const ulint zssize = FSP_FLAGS_GET_ZIP_SSIZE(flags); - if (zssize == 0) { - /* not ROW_FORMAT=COMPRESSED */ - } else if (zssize > (ssize ? ssize : 5)) { - /* Invalid KEY_BLOCK_SIZE */ - return false; - } else if (~flags & (FSP_FLAGS_MASK_POST_ANTELOPE - | FSP_FLAGS_MASK_ATOMIC_BLOBS)) { - /* both these flags should be set for - ROW_FORMAT=COMPRESSED */ - return false; - } + /** Validate the tablespace flags for full crc32 format. + @param flags contents of FSP_SPACE_FLAGS + @return whether the flags are correct in full crc32 format */ + static bool is_fcrc32_valid_flags(uint32_t flags) + { + ut_ad(flags & FSP_FLAGS_FCRC32_MASK_MARKER); + const ulint page_ssize= physical_size(flags); + if (page_ssize < 3 || page_ssize & 8) + return false; + flags >>= FSP_FLAGS_FCRC32_POS_COMPRESSED_ALGO; + return flags <= PAGE_ALGORITHM_LAST; + } + /** Validate the tablespace flags. + @param flags contents of FSP_SPACE_FLAGS + @param is_ibd whether this is an .ibd file (not system tablespace) + @return whether the flags are correct */ + static bool is_valid_flags(uint32_t flags, bool is_ibd) + { + DBUG_EXECUTE_IF("fsp_flags_is_valid_failure", return false;); + if (full_crc32(flags)) + return is_fcrc32_valid_flags(flags); - /* The flags do look valid. But, avoid misinterpreting - buggy MariaDB 10.1 format flags for - PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL={0,2,3} - as valid-looking PAGE_SSIZE if this is known to be - an .ibd file and we are using the default innodb_page_size=16k. */ - return(ssize == 0 || !is_ibd - || srv_page_size != UNIV_PAGE_SIZE_ORIG); - } + if (flags == 0) + return true; + if (~FSP_FLAGS_MASK & flags) + return false; + + if (FSP_FLAGS_MASK_ATOMIC_BLOBS == + (flags & (FSP_FLAGS_MASK_POST_ANTELOPE | FSP_FLAGS_MASK_ATOMIC_BLOBS))) + /* If the "atomic blobs" flag (indicating + ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED) flag is set, then the + ROW_FORMAT!=REDUNDANT flag must also be set. */ + return false; + + /* Bits 10..14 should be 0b0000d where d is the DATA_DIR flag + of MySQL 5.6 and MariaDB 10.0, which we ignore. + In the buggy FSP_SPACE_FLAGS written by MariaDB 10.1.0 to 10.1.20, + bits 10..14 would be nonzero 0bsssaa where sss is + nonzero PAGE_SSIZE (3, 4, 6, or 7) + and aa is ATOMIC_WRITES (not 0b11). */ + if (FSP_FLAGS_GET_RESERVED(flags) & ~1U) + return false; + + const uint32_t ssize= FSP_FLAGS_GET_PAGE_SSIZE(flags); + if (ssize == 1 || ssize == 2 || ssize == 5 || ssize & 8) + /* the page_size is not between 4k and 64k; + 16k should be encoded as 0, not 5 */ + return false; + + const uint32_t zssize= FSP_FLAGS_GET_ZIP_SSIZE(flags); + if (zssize == 0) + /* not ROW_FORMAT=COMPRESSED */; + else if (zssize > (ssize ? ssize : 5)) + /* Invalid KEY_BLOCK_SIZE */ + return false; + else if (~flags & + (FSP_FLAGS_MASK_POST_ANTELOPE | FSP_FLAGS_MASK_ATOMIC_BLOBS)) + /* both these flags must set for ROW_FORMAT=COMPRESSED */ + return false; + + /* The flags do look valid. But, avoid misinterpreting + buggy MariaDB 10.1 format flags for + PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL={0,2,3} + as valid-looking PAGE_SSIZE if this is known to be + an .ibd file and we are using the default innodb_page_size=16k. */ + return(ssize == 0 || !is_ibd || srv_page_size != UNIV_PAGE_SIZE_ORIG); + } #ifndef UNIV_INNOCHECKSUM MY_ATTRIBUTE((warn_unused_result)) @@ -947,7 +897,7 @@ public: @param mode encryption mode @return pointer to created tablespace, to be filled in with add() @retval nullptr on failure (such as when the same tablespace exists) */ - static fil_space_t *create(ulint id, ulint flags, + static fil_space_t *create(uint32_t id, uint32_t flags, fil_type_t purpose, fil_space_crypt_t *crypt_data, fil_encryption_t mode= FIL_ENCRYPTION_DEFAULT); @@ -956,7 +906,7 @@ public: @param id tablespace identifier @return tablespace @retval nullptr if the tablespace is missing or inaccessible */ - static fil_space_t *get(ulint id); + static fil_space_t *get(uint32_t id); /** Add/remove the free page in the freed ranges list. @param[in] offset page number to be added @@ -1409,14 +1359,12 @@ or the caller should be in single-threaded crash recovery mode Normally, fil_space_t::get() should be used instead. @param[in] id tablespace ID @return tablespace, or NULL if not found */ -fil_space_t* -fil_space_get( - ulint id) - MY_ATTRIBUTE((warn_unused_result)); +fil_space_t *fil_space_get(uint32_t id) + MY_ATTRIBUTE((warn_unused_result)); -/** The tablespace memory cache; also the totality of logs (the log -data space) is stored here; below we talk about tablespaces */ -struct fil_system_t { +/** The tablespace memory cache */ +struct fil_system_t +{ /** Constructor. @@ -1475,12 +1423,8 @@ public: ulint n_open; /** last time we noted n_open exceeding the limit; protected by mutex */ time_t n_open_exceeded_time; - ulint max_assigned_id;/*!< maximum space id in the existing - tables, or assigned during the time - mysqld has been up; at an InnoDB - startup we scan the data dictionary - and set here the maximum of the - space id's of the tables there */ + /** maximum persistent tablespace id that has ever been assigned */ + uint32_t max_assigned_id; /** nonzero if fil_node_open_file_low() should avoid moving the tablespace to the end of space_list, for FIFO policy of try_to_close() */ ulint freeze_space_list; @@ -1493,13 +1437,13 @@ public: the latest redo log checkpoint. Protected only by log_sys.mutex. */ - /** List of all file spaces need key rotation */ - ilist<fil_space_t, rotation_list_tag_t> default_encrypt_tables; + /** list of all ENCRYPTED=DEFAULT tablespaces that need + to be converted to the current value of innodb_encrypt_tables */ + ilist<fil_space_t, default_encrypt_tag_t> default_encrypt_tables; - bool space_id_reuse_warned; - /*!< whether fil_space_t::create() - has issued a warning about - potential space_id reuse */ + /** whether fil_space_t::create() has issued a warning about + potential space_id reuse */ + bool space_id_reuse_warned; /** Return the next tablespace from default_encrypt_tables list. @param space previous tablespace (nullptr to start from the start) @@ -1618,36 +1562,27 @@ Assigns a new space id for a new single-table tablespace. This works simply by incrementing the global counter. If 4 billion id's is not enough, we may need to recycle id's. @return true if assigned, false if not */ -bool -fil_assign_new_space_id( -/*====================*/ - ulint* space_id); /*!< in/out: space id */ +bool fil_assign_new_space_id(uint32_t *space_id); /** Frees a space object from the tablespace memory cache. Closes the files in the chain but does not delete them. There must not be any pending i/o's or flushes on the files. -@param[in] id tablespace identifier -@param[in] x_latched whether the caller holds X-mode space->latch +@param id tablespace identifier +@param x_latched whether the caller holds exclusive fil_space_t::latch @return true if success */ -bool -fil_space_free( - ulint id, - bool x_latched); +bool fil_space_free(uint32_t id, bool x_latched); /** Set the recovered size of a tablespace in pages. @param id tablespace ID @param size recovered size in pages @param flags tablespace flags */ -void fil_space_set_recv_size_and_flags(ulint id, uint32_t size, +void fil_space_set_recv_size_and_flags(uint32_t id, uint32_t size, uint32_t flags); /*******************************************************************//** Sets the max tablespace id counter if the given number is bigger than the previous value. */ -void -fil_set_max_space_id_if_bigger( -/*===========================*/ - ulint max_id);/*!< in: maximum known id */ +void fil_set_max_space_id_if_bigger(uint32_t max_id); /** Write the flushed LSN to the page header of the first page in the system tablespace. @@ -1663,12 +1598,12 @@ MY_ATTRIBUTE((warn_unused_result)) @param id tablespace identifier @return detached file handle (to be closed by the caller) @return OS_FILE_CLOSED if no file existed */ -pfs_os_file_t fil_delete_tablespace(ulint id); +pfs_os_file_t fil_delete_tablespace(uint32_t id); /** Close a single-table tablespace on failed IMPORT TABLESPACE. The tablespace must be cached in the memory cache. Free all pages used by the tablespace. */ -void fil_close_tablespace(ulint id); +void fil_close_tablespace(uint32_t id); /*******************************************************************//** Allocates and builds a file name from a path, a table or tablespace name @@ -1698,10 +1633,10 @@ must be >= FIL_IBD_FILE_INITIAL_SIZE @retval NULL on error */ fil_space_t* fil_ibd_create( - ulint space_id, + uint32_t space_id, const table_name_t name, const char* path, - ulint flags, + uint32_t flags, uint32_t size, fil_encryption_t mode, uint32_t key_id, @@ -1712,7 +1647,7 @@ fil_ibd_create( (Typically when upgrading from MariaDB 10.1.0..10.1.20.) @param[in,out] space tablespace @param[in] flags desired tablespace flags */ -void fsp_flags_try_adjust(fil_space_t* space, ulint flags); +void fsp_flags_try_adjust(fil_space_t *space, uint32_t flags); /********************************************************************//** Tries to open a single-table tablespace and optionally checks the space id is @@ -1748,8 +1683,8 @@ fil_space_t* fil_ibd_open( bool validate, fil_type_t purpose, - ulint id, - ulint flags, + uint32_t id, + uint32_t flags, fil_space_t::name_type name, const char* path_in, dberr_t* err = NULL) @@ -1774,12 +1709,8 @@ enum fil_load_status { @param[out] space the tablespace, or NULL on error @return status of the operation */ enum fil_load_status -fil_ibd_load( - ulint space_id, - const char* filename, - fil_space_t*& space) - MY_ATTRIBUTE((warn_unused_result)); - +fil_ibd_load(uint32_t space_id, const char *filename, fil_space_t *&space) + MY_ATTRIBUTE((warn_unused_result)); /** Determine if a matching tablespace exists in the InnoDB tablespace memory cache. Note that if we have not done a crash recovery at the database @@ -1788,7 +1719,8 @@ startup, there may be many tablespaces which are not yet in the memory cache. @param[in] table_flags table flags @return the tablespace @retval NULL if no matching tablespace exists in the memory cache */ -fil_space_t *fil_space_for_table_exists_in_mem(ulint id, ulint table_flags); +fil_space_t *fil_space_for_table_exists_in_mem(uint32_t id, + uint32_t table_flags); /** Try to extend a tablespace if it is smaller than the specified size. @param[in,out] space tablespace @@ -1819,12 +1751,11 @@ fil_delete_file( /*============*/ const char* path); /*!< in: filepath of the ibd tablespace */ -/*******************************************************************//** -Returns the table space by a given id, NULL if not found. */ -fil_space_t* -fil_space_get_by_id( -/*================*/ - ulint id); /*!< in: space id */ +/** Look up a tablespace. +@param tablespace identifier +@return tablespace +@retval nullptr if not found */ +fil_space_t *fil_space_get_by_id(uint32_t id); /** Note that a non-predefined persistent tablespace has been modified by redo log. diff --git a/storage/innobase/include/fil0pagecompress.h b/storage/innobase/include/fil0pagecompress.h index a22867ad56a..2927da3c2fb 100644 --- a/storage/innobase/include/fil0pagecompress.h +++ b/storage/innobase/include/fil0pagecompress.h @@ -40,7 +40,7 @@ Created 11/12/2013 Jan Lindström jan.lindstrom@skysql.com ulint fil_page_compress( const byte* buf, byte* out_buf, - ulint flags, + uint32_t flags, ulint block_size, bool encrypted) MY_ATTRIBUTE((nonnull, warn_unused_result)); @@ -52,9 +52,6 @@ ulint fil_page_compress( @return size of the compressed data @retval 0 if decompression failed @retval srv_page_size if the page was not compressed */ -ulint fil_page_decompress( - byte* tmp_buf, - byte* buf, - ulint flags) - MY_ATTRIBUTE((nonnull, warn_unused_result)); +ulint fil_page_decompress(byte *tmp_buf, byte *buf, uint32_t flags) + MY_ATTRIBUTE((nonnull, warn_unused_result)); #endif diff --git a/storage/innobase/include/fsp0file.h b/storage/innobase/include/fsp0file.h index 8c11d61c5aa..9dfb3cc7561 100644 --- a/storage/innobase/include/fsp0file.h +++ b/storage/innobase/include/fsp0file.h @@ -56,7 +56,7 @@ public: m_size(), m_order(), m_type(SRV_NOT_RAW), - m_space_id(ULINT_UNDEFINED), + m_space_id(UINT32_MAX), m_flags(), m_exists(), m_is_valid(), @@ -67,7 +67,7 @@ public: /* No op */ } - Datafile(ulint flags, uint32_t size, ulint order) + Datafile(uint32_t flags, uint32_t size, ulint order) : m_filepath(), m_filename(), @@ -76,7 +76,7 @@ public: m_size(size), m_order(order), m_type(SRV_NOT_RAW), - m_space_id(ULINT_UNDEFINED), + m_space_id(UINT32_MAX), m_flags(flags), m_exists(), m_is_valid(), @@ -154,7 +154,7 @@ public: } /** Initialize the tablespace flags */ - void init(ulint flags) { m_flags= flags; } + void init(uint32_t flags) { m_flags= flags; } /** Release the resources. */ virtual void shutdown(); @@ -198,7 +198,7 @@ public: @param[in] flags The expected tablespace flags. @retval DB_SUCCESS if tablespace is valid, DB_ERROR if not. m_is_valid is also set true on success, else false. */ - dberr_t validate_to_dd(ulint space_id, ulint flags) + dberr_t validate_to_dd(uint32_t space_id, uint32_t flags) MY_ATTRIBUTE((warn_unused_result)); /** Validates this datafile for the purpose of recovery. @@ -254,24 +254,15 @@ public: /** Get Datafile::m_space_id. @return m_space_id */ - ulint space_id() const - { - return(m_space_id); - } + uint32_t space_id() const { return m_space_id; } /** Get Datafile::m_flags. @return m_flags */ - ulint flags() const - { - return(m_flags); - } + uint32_t flags() const { return m_flags; } /** @return true if m_handle is open, false if not */ - bool is_open() const - { - return(m_handle != OS_FILE_CLOSED); - } + bool is_open() const { return m_handle != OS_FILE_CLOSED; } /** Get Datafile::m_is_valid. @return m_is_valid */ @@ -324,9 +315,9 @@ public: @return the first data page */ const byte* get_first_page() const { return(m_first_page); } - void set_space_id(ulint space_id) { m_space_id= space_id; } + void set_space_id(uint32_t space_id) { m_space_id= space_id; } - void set_flags(ulint flags) { m_flags = flags; } + void set_flags(uint32_t flags) { m_flags = flags; } private: /** Free the filepath buffer. */ void free_filepath(); @@ -425,12 +416,12 @@ private: /** Tablespace ID. Contained in the datafile header. If this is a system tablespace, FSP_SPACE_ID is only valid in the first datafile. */ - ulint m_space_id; + uint32_t m_space_id; /** Tablespace flags. Contained in the datafile header. If this is a system tablespace, FSP_SPACE_FLAGS are only valid in the first datafile. */ - ulint m_flags; + uint32_t m_flags; /** true if file already existed on startup */ bool m_exists; diff --git a/storage/innobase/include/fsp0fsp.h b/storage/innobase/include/fsp0fsp.h index 51333cb5955..1f8f4081163 100644 --- a/storage/innobase/include/fsp0fsp.h +++ b/storage/innobase/include/fsp0fsp.h @@ -596,14 +596,11 @@ fseg_print( /** Convert FSP_SPACE_FLAGS from the buggy MariaDB 10.1.0..10.1.20 format. @param[in] flags the contents of FSP_SPACE_FLAGS @return the flags corrected from the buggy MariaDB 10.1 format -@retval ULINT_UNDEFINED if the flags are not in the buggy 10.1 format */ +@retval UINT32_MAX if the flags are not in the buggy 10.1 format */ MY_ATTRIBUTE((warn_unused_result, const)) -UNIV_INLINE -ulint -fsp_flags_convert_from_101(ulint flags) +inline uint32_t fsp_flags_convert_from_101(uint32_t flags) { - DBUG_EXECUTE_IF("fsp_flags_is_valid_failure", - return(ULINT_UNDEFINED);); + DBUG_EXECUTE_IF("fsp_flags_is_valid_failure", return UINT32_MAX;); if (flags == 0 || fil_space_t::full_crc32(flags)) { return(flags); } @@ -612,7 +609,7 @@ fsp_flags_convert_from_101(ulint flags) /* The most significant FSP_SPACE_FLAGS bit that was ever set by MariaDB 10.1.0 to 10.1.20 was bit 17 (misplaced DATA_DIR flag). The flags must be less than 1<<18 in order to be valid. */ - return(ULINT_UNDEFINED); + return UINT32_MAX; } if ((flags & (FSP_FLAGS_MASK_POST_ANTELOPE | FSP_FLAGS_MASK_ATOMIC_BLOBS)) @@ -621,7 +618,7 @@ fsp_flags_convert_from_101(ulint flags) ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED) flag is set, then the "post Antelope" (ROW_FORMAT!=REDUNDANT) flag must also be set. */ - return(ULINT_UNDEFINED); + return UINT32_MAX; } /* Bits 6..10 denote compression in MariaDB 10.1.0 to 10.1.20. @@ -650,19 +647,19 @@ fsp_flags_convert_from_101(ulint flags) invalid (COMPRESSION_LEVEL=3 but COMPRESSION=0) +0b00000: innodb_page_size=16k (looks like COMPRESSION=0) ??? Could actually be compressed; see PAGE_SSIZE below */ - const ulint level = FSP_FLAGS_GET_PAGE_COMPRESSION_LEVEL_MARIADB101( + const uint32_t level = FSP_FLAGS_GET_PAGE_COMPRESSION_LEVEL_MARIADB101( flags); if (FSP_FLAGS_GET_PAGE_COMPRESSION_MARIADB101(flags) != (level != 0) || level > 9) { /* The compression flags are not in the buggy MariaDB 10.1 format. */ - return(ULINT_UNDEFINED); + return UINT32_MAX; } if (!(~flags & FSP_FLAGS_MASK_ATOMIC_WRITES_MARIADB101)) { /* The ATOMIC_WRITES flags cannot be 0b11. (The bits 11..12 should actually never be 0b11, because in MySQL they would be SHARED|TEMPORARY.) */ - return(ULINT_UNDEFINED); + return UINT32_MAX; } /* Bits 13..16 are the wrong position for PAGE_SSIZE, and they @@ -677,23 +674,23 @@ fsp_flags_convert_from_101(ulint flags) will be properly rejected by older MariaDB 10.1.x because they would read as PAGE_SSIZE>=8 which is not valid. */ - const ulint ssize = FSP_FLAGS_GET_PAGE_SSIZE_MARIADB101(flags); + const uint32_t ssize = FSP_FLAGS_GET_PAGE_SSIZE_MARIADB101(flags); if (ssize == 1 || ssize == 2 || ssize == 5 || ssize & 8) { /* the page_size is not between 4k and 64k; 16k should be encoded as 0, not 5 */ - return(ULINT_UNDEFINED); + return UINT32_MAX; } - const ulint zssize = FSP_FLAGS_GET_ZIP_SSIZE(flags); + const uint32_t zssize = FSP_FLAGS_GET_ZIP_SSIZE(flags); if (zssize == 0) { /* not ROW_FORMAT=COMPRESSED */ } else if (zssize > (ssize ? ssize : 5)) { /* invalid KEY_BLOCK_SIZE */ - return(ULINT_UNDEFINED); + return UINT32_MAX; } else if (~flags & (FSP_FLAGS_MASK_POST_ANTELOPE | FSP_FLAGS_MASK_ATOMIC_BLOBS)) { /* both these flags should be set for ROW_FORMAT=COMPRESSED */ - return(ULINT_UNDEFINED); + return UINT32_MAX; } flags = ((flags & 0x3f) | ssize << FSP_FLAGS_POS_PAGE_SSIZE @@ -708,19 +705,11 @@ fsp_flags_convert_from_101(ulint flags) @param[in] actual flags read from FSP_SPACE_FLAGS @return whether the flags match */ MY_ATTRIBUTE((warn_unused_result)) -UNIV_INLINE -bool -fsp_flags_match(ulint expected, ulint actual) +inline bool fsp_flags_match(uint32_t expected, uint32_t actual) { - expected &= ~FSP_FLAGS_MEM_MASK; - ut_ad(fil_space_t::is_valid_flags(expected, false)); - - if (actual == expected) { - return(true); - } - - actual = fsp_flags_convert_from_101(actual); - return(actual == expected); + expected&= ~FSP_FLAGS_MEM_MASK; + ut_ad(fil_space_t::is_valid_flags(expected, false)); + return actual == expected || fsp_flags_convert_from_101(actual) == expected; } /** Determine the descriptor index within a descriptor page. diff --git a/storage/innobase/include/fsp0space.h b/storage/innobase/include/fsp0space.h index ed65af52bc8..a2bb46d3125 100644 --- a/storage/innobase/include/fsp0space.h +++ b/storage/innobase/include/fsp0space.h @@ -47,22 +47,13 @@ public: /** Data file iterator */ typedef files_t::const_iterator const_iterator; - Tablespace() - : - m_files(), - m_space_id(ULINT_UNDEFINED), - m_path(), - m_flags(), - m_ignore_read_only(false) - { - /* No op */ - } + Tablespace() {} virtual ~Tablespace() { shutdown(); ut_ad(m_files.empty()); - ut_ad(m_space_id == ULINT_UNDEFINED); + ut_ad(m_space_id == UINT32_MAX); } // Disable copying @@ -104,22 +95,19 @@ public: /** Set the space id of the tablespace @param[in] space_id tablespace ID to set */ - void set_space_id(ulint space_id) + void set_space_id(uint32_t space_id) { - ut_ad(m_space_id == ULINT_UNDEFINED); + ut_ad(m_space_id == UINT32_MAX); m_space_id = space_id; } /** Get the space id of the tablespace @return m_space_id space id of the tablespace */ - ulint space_id() const - { - return(m_space_id); - } + uint32_t space_id() const { return m_space_id; } /** Set the tablespace flags @param[in] fsp_flags tablespace flags */ - void set_flags(ulint fsp_flags) + void set_flags(uint32_t fsp_flags) { ut_ad(fil_space_t::is_valid_flags(fsp_flags, false)); m_flags = fsp_flags; @@ -127,24 +115,15 @@ public: /** Get the tablespace flags @return m_flags tablespace flags */ - ulint flags() const - { - return(m_flags); - } + uint32_t flags() const { return m_flags; } /** Get the tablespace encryption mode @return m_mode tablespace encryption mode */ - fil_encryption_t encryption_mode() const - { - return (m_mode); - } + fil_encryption_t encryption_mode() const { return m_mode; } /** Get the tablespace encryption key_id @return m_key_id tablespace encryption key_id */ - uint32_t key_id() const - { - return (m_key_id); - } + uint32_t key_id() const { return m_key_id; } /** Set Ignore Read Only Status for tablespace. @param[in] read_only_status read only status indicator */ @@ -210,24 +189,21 @@ private: @param[in] file data file object */ void file_found(Datafile& file); - /* DATA MEMBERS */ - /** Tablespace ID */ - ulint m_space_id; + uint32_t m_space_id = UINT32_MAX; + /** Tablespace flags */ + uint32_t m_flags = UINT32_MAX; - /** Path where tablespace files will reside, not including a filename.*/ + /** Path where tablespace files will reside, excluding a filename */ char* m_path; - /** Tablespace flags */ - ulint m_flags; - /** Encryption mode and key_id */ fil_encryption_t m_mode; uint32_t m_key_id; protected: /** Ignore server read only configuration for this tablespace. */ - bool m_ignore_read_only; + bool m_ignore_read_only = false; }; #endif /* fsp0space_h */ diff --git a/storage/innobase/include/fsp0sysspace.h b/storage/innobase/include/fsp0sysspace.h index 2e0a395f71c..b6bdadd3501 100644 --- a/storage/innobase/include/fsp0sysspace.h +++ b/storage/innobase/include/fsp0sysspace.h @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 2013, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2016, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -266,24 +267,15 @@ extern SysTablespace srv_tmp_space; /** Check if the space_id is for a system-tablespace (shared + temp). @param[in] id Space ID to check @return true if id is a system tablespace, false if not. */ -UNIV_INLINE -bool -is_system_tablespace(ulint id) +inline bool is_system_tablespace(uint32_t id) { - return(id == TRX_SYS_SPACE || id == SRV_TMP_SPACE_ID); + return id == TRX_SYS_SPACE || id == SRV_TMP_SPACE_ID; } /** Check if predefined shared tablespace. @return true if predefined shared tablespace */ -UNIV_INLINE -bool -is_predefined_tablespace( - ulint id) +inline bool is_predefined_tablespace(uint32_t id) { - ut_ad(srv_sys_space.space_id() == TRX_SYS_SPACE); - ut_ad(TRX_SYS_SPACE == 0); - return(id == TRX_SYS_SPACE - || id == SRV_TMP_SPACE_ID - || srv_is_undo_tablespace(id)); + return is_system_tablespace(id) || srv_is_undo_tablespace(id); } #endif /* fsp0sysspace_h */ diff --git a/storage/innobase/include/fsp0types.h b/storage/innobase/include/fsp0types.h index f8e4c06baae..4f23b403050 100644 --- a/storage/innobase/include/fsp0types.h +++ b/storage/innobase/include/fsp0types.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2014, 2020, MariaDB Corporation. +Copyright (c) 2014, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -25,15 +25,12 @@ Created May 26, 2009 Vasil Dimov *******************************************************/ #pragma once -#include <cstddef> +#include "ut0byte.h" -/** The fil_space_t::id of the redo log. All persistent tablespaces -have a smaller fil_space_t::id. */ -static constexpr size_t SRV_SPACE_ID_UPPER_BOUND= 0xFFFFFFF0; +/** All persistent tablespaces have a smaller fil_space_t::id than this. */ +constexpr uint32_t SRV_SPACE_ID_UPPER_BOUND= 0xFFFFFFF0U; /** The fil_space_t::id of the innodb_temporary tablespace. */ -#define SRV_TMP_SPACE_ID 0xFFFFFFFEU - -#include "ut0byte.h" +constexpr uint32_t SRV_TMP_SPACE_ID= 0xFFFFFFFEU; /* Possible values of innodb_compression_algorithm */ #define PAGE_UNCOMPRESSED 0 diff --git a/storage/innobase/include/fut0fut.h b/storage/innobase/include/fut0fut.h index 5169db95549..1ac670bbc70 100644 --- a/storage/innobase/include/fut0fut.h +++ b/storage/innobase/include/fut0fut.h @@ -42,7 +42,7 @@ bufferfixed and latched */ inline byte* fut_get_ptr( - ulint space, + uint32_t space, ulint zip_size, fil_addr_t addr, rw_lock_type_t rw_latch, diff --git a/storage/innobase/include/ibuf0ibuf.h b/storage/innobase/include/ibuf0ibuf.h index c5849a43d3e..3ffa9facdbf 100644 --- a/storage/innobase/include/ibuf0ibuf.h +++ b/storage/innobase/include/ibuf0ibuf.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2016, 2020, MariaDB Corporation. +Copyright (c) 2016, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -334,7 +334,7 @@ void ibuf_merge_or_delete_for_page(buf_block_t *block, const page_id_t page_id, /** Delete all change buffer entries for a tablespace, in DISCARD TABLESPACE, IMPORT TABLESPACE, or crash recovery. @param[in] space missing or to-be-discarded tablespace */ -void ibuf_delete_for_discarded_space(ulint space); +void ibuf_delete_for_discarded_space(uint32_t space); /** Contract the change buffer by reading pages to the buffer pool. @return a lower limit for the combined size in bytes of entries which diff --git a/storage/innobase/include/log0recv.h b/storage/innobase/include/log0recv.h index 46c09fecf7a..8273a8981bd 100644 --- a/storage/innobase/include/log0recv.h +++ b/storage/innobase/include/log0recv.h @@ -87,7 +87,7 @@ void recv_sys_justify_left_parsing_buf(); @param[in] len length of name, in bytes @param[in] new_name new file name (NULL if not rename) @param[in] new_len length of new_name, in bytes (0 if NULL) */ -extern void (*log_file_op)(ulint space_id, bool create, +extern void (*log_file_op)(uint32_t space_id, bool create, const byte* name, ulint len, const byte* new_name, ulint new_len); diff --git a/storage/innobase/include/mtr0mtr.h b/storage/innobase/include/mtr0mtr.h index 5551cb7b587..f72a94d4a39 100644 --- a/storage/innobase/include/mtr0mtr.h +++ b/storage/innobase/include/mtr0mtr.h @@ -174,10 +174,10 @@ struct mtr_t { (needed for generating a FILE_MODIFY record) @param[in] space_id user or system tablespace ID @return the tablespace */ - fil_space_t* set_named_space_id(ulint space_id) + fil_space_t* set_named_space_id(uint32_t space_id) { ut_ad(!m_user_space_id); - ut_d(m_user_space_id = static_cast<uint32_t>(space_id)); + ut_d(m_user_space_id = space_id); if (!space_id) { return fil_system.sys_space; } else { @@ -195,7 +195,7 @@ struct mtr_t { void set_named_space(fil_space_t* space) { ut_ad(!m_user_space_id); - ut_d(m_user_space_id = static_cast<uint32_t>(space->id)); + ut_d(m_user_space_id = space->id); if (space->id) { m_user_space = space; } @@ -206,7 +206,7 @@ struct mtr_t { (needed for generating a FILE_MODIFY record) @param[in] space tablespace @return whether the mini-transaction is associated with the space */ - bool is_named_space(ulint space) const; + bool is_named_space(uint32_t space) const; /** Check the tablespace associated with the mini-transaction (needed for generating a FILE_MODIFY record) @param[in] space tablespace @@ -214,10 +214,10 @@ struct mtr_t { bool is_named_space(const fil_space_t* space) const; #endif /* UNIV_DEBUG */ - /** Acquire a tablespace X-latch. - @param[in] space_id tablespace ID - @return the tablespace object (never NULL) */ - fil_space_t* x_lock_space(ulint space_id); + /** Acquire a tablespace X-latch. + @param space_id tablespace ID + @return the tablespace object (never NULL) */ + fil_space_t *x_lock_space(uint32_t space_id); /** Acquire a shared rw-latch. */ void s_lock( @@ -563,7 +563,7 @@ public: @param space_id tablespace identifier @param path file path @param new_path new file path for type=FILE_RENAME */ - inline void log_file_op(mfile_type_t type, ulint space_id, + inline void log_file_op(mfile_type_t type, uint32_t space_id, const char *path, const char *new_path= nullptr); diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 0c32d5d686a..df939afd314 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -261,12 +261,12 @@ extern bool srv_was_started; extern char* srv_undo_dir; /** Number of undo tablespaces to use. */ -extern ulong srv_undo_tablespaces; +extern uint srv_undo_tablespaces; /** The number of UNDO tablespaces that are active (hosting some rollback segment). It is quite possible that some of the tablespaces doesn't host any of the rollback-segment based on configuration used. */ -extern ulint srv_undo_tablespaces_active; +extern uint32_t srv_undo_tablespaces_active; /** Maximum size of undo tablespace. */ extern unsigned long long srv_max_undo_log_size; diff --git a/storage/innobase/include/trx0rseg.h b/storage/innobase/include/trx0rseg.h index 6ad897ca515..ba2537715c4 100644 --- a/storage/innobase/include/trx0rseg.h +++ b/storage/innobase/include/trx0rseg.h @@ -40,18 +40,6 @@ UNIV_INLINE buf_block_t* trx_rsegf_get(fil_space_t* space, uint32_t page_no, mtr_t* mtr); -/** Gets a newly created rollback segment header. -@param[in] space space where placed -@param[in] page_no page number of the header -@param[in,out] mtr mini-transaction -@return rollback segment header, page x-latched */ -UNIV_INLINE -buf_block_t* -trx_rsegf_get_new( - ulint space, - uint32_t page_no, - mtr_t* mtr); - /** Create a rollback segment header. @param[in,out] space system, undo, or temporary tablespace @param[in] rseg_id rollback segment identifier diff --git a/storage/innobase/include/trx0rseg.ic b/storage/innobase/include/trx0rseg.ic index 8805a4c8ac3..af63d6acbf2 100644 --- a/storage/innobase/include/trx0rseg.ic +++ b/storage/innobase/include/trx0rseg.ic @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2020, MariaDB Corporation. +Copyright (c) 2017, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -43,22 +43,3 @@ trx_rsegf_get(fil_space_t* space, uint32_t page_no, mtr_t* mtr) return buf_page_get(page_id_t(space->id, page_no), 0, RW_X_LATCH, mtr); } - -/** Gets a newly created rollback segment header. -@param[in] space space where placed -@param[in] page_no page number of the header -@param[in,out] mtr mini-transaction -@return rollback segment header, page x-latched */ -UNIV_INLINE -buf_block_t* -trx_rsegf_get_new( - ulint space, - uint32_t page_no, - mtr_t* mtr) -{ - ut_ad(space <= srv_undo_tablespaces_active || space == SRV_TMP_SPACE_ID - || !srv_was_started); - ut_ad(space <= TRX_SYS_MAX_UNDO_SPACES || space == SRV_TMP_SPACE_ID); - - return buf_page_get(page_id_t(space, page_no), 0, RW_X_LATCH, mtr); -} diff --git a/storage/innobase/include/trx0types.h b/storage/innobase/include/trx0types.h index 07c1c6a756b..d6ce902977c 100644 --- a/storage/innobase/include/trx0types.h +++ b/storage/innobase/include/trx0types.h @@ -38,7 +38,7 @@ the terminating NUL character. */ static const ulint TRX_ID_MAX_LEN = 17; /** Space id of the transaction system page (the system tablespace) */ -static const ulint TRX_SYS_SPACE = 0; +static constexpr uint32_t TRX_SYS_SPACE= 0; /** Page number of the transaction system page */ #define TRX_SYS_PAGE_NO FSP_TRX_SYS_PAGE_NO diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index 88f0b2d185b..f851db62d18 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -524,7 +524,7 @@ it is read or written. */ #include "ut0lst.h" #include "ut0ut.h" -extern ulong srv_page_size_shift; +extern uint32_t srv_page_size_shift; extern ulong srv_page_size; /* Dimension of spatial object we support so far. It has its root in diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 05f7b1d053b..f76183e5a35 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -577,10 +577,10 @@ struct file_name_t { /** Map of dirty tablespaces during recovery */ typedef std::map< - ulint, + uint32_t, file_name_t, - std::less<ulint>, - ut_allocator<std::pair<const ulint, file_name_t> > > recv_spaces_t; + std::less<uint32_t>, + ut_allocator<std::pair<const uint32_t, file_name_t> > > recv_spaces_t; static recv_spaces_t recv_spaces; @@ -877,7 +877,7 @@ fail: @param[in] len length of name, in bytes @param[in] new_name new file name (NULL if not rename) @param[in] new_len length of new_name, in bytes (0 if NULL) */ -void (*log_file_op)(ulint space_id, bool create, +void (*log_file_op)(uint32_t space_id, bool create, const byte* name, ulint len, const byte* new_name, ulint new_len); @@ -1079,7 +1079,7 @@ inline size_t recv_sys_t::files_size() stored */ static void -fil_name_process(char* name, ulint len, ulint space_id, +fil_name_process(char* name, ulint len, uint32_t space_id, bool deleted, lsn_t lsn, store_t *store) { if (srv_operation == SRV_OPERATION_BACKUP) { @@ -2870,8 +2870,7 @@ static void recv_read_in_area(page_id_t page_id) if (p != page_nos) { mysql_mutex_unlock(&recv_sys.mutex); - buf_read_recv_pages(page_id.space(), page_nos, - ulint(p - page_nos)); + buf_read_recv_pages(page_id.space(), {page_nos, p}); mysql_mutex_lock(&recv_sys.mutex); } } @@ -3621,7 +3620,7 @@ recv_validate_tablespace(bool rescan, bool& missing_tablespace) for (recv_sys_t::map::iterator p = recv_sys.pages.begin(); p != recv_sys.pages.end();) { ut_ad(!p->second.log.empty()); - const ulint space = p->first.space(); + const uint32_t space = p->first.space(); if (is_predefined_tablespace(space)) { next: p++; @@ -4157,11 +4156,11 @@ bool recv_dblwr_t::validate_page(const page_id_t page_id, { if (page_id.page_no() == 0) { - ulint flags= fsp_header_get_flags(page); + uint32_t flags= fsp_header_get_flags(page); if (!fil_space_t::is_valid_flags(flags, page_id.space())) { - ulint cflags= fsp_flags_convert_from_101(flags); - if (cflags == ULINT_UNDEFINED) + uint32_t cflags= fsp_flags_convert_from_101(flags); + if (cflags == UINT32_MAX) { ib::warn() << "Ignoring a doublewrite copy of page " << page_id << "due to invalid flags " << ib::hex(flags); diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc index ae3183703c2..3a63749695a 100644 --- a/storage/innobase/mtr/mtr0mtr.cc +++ b/storage/innobase/mtr/mtr0mtr.cc @@ -615,7 +615,7 @@ void mtr_t::commit_files(lsn_t checkpoint_lsn) @param[in] space tablespace @return whether the mini-transaction is associated with the space */ bool -mtr_t::is_named_space(ulint space) const +mtr_t::is_named_space(uint32_t space) const { ut_ad(!m_user_space || m_user_space->id != TRX_SYS_SPACE); @@ -655,8 +655,7 @@ bool mtr_t::is_named_space(const fil_space_t* space) const /** Acquire a tablespace X-latch. @param[in] space_id tablespace ID @return the tablespace object (never NULL) */ -fil_space_t* -mtr_t::x_lock_space(ulint space_id) +fil_space_t *mtr_t::x_lock_space(uint32_t space_id) { fil_space_t* space; diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 7f99b6ef26b..613bef9b724 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -4237,14 +4237,14 @@ corrupted: FSP_HEADER_OFFSET + FSP_SPACE_ID + page, 4) ? ULINT_UNDEFINED : mach_read_from_4(FIL_PAGE_SPACE_ID + page); - ulint flags= fsp_header_get_flags(page); + uint32_t flags= fsp_header_get_flags(page); const uint32_t size= fsp_header_get_field(page, FSP_SIZE); const uint32_t free_limit= fsp_header_get_field(page, FSP_FREE_LIMIT); const uint32_t free_len= flst_get_len(FSP_HEADER_OFFSET + FSP_FREE + page); if (!fil_space_t::is_valid_flags(flags, space->id)) { - ulint cflags= fsp_flags_convert_from_101(flags); - if (cflags == ULINT_UNDEFINED) + uint32_t cflags= fsp_flags_convert_from_101(flags); + if (cflags == UINT32_MAX) { invalid: ib::error() << "Expected tablespace flags " @@ -4254,8 +4254,8 @@ invalid: goto corrupted; } - ulint cf= cflags & ~FSP_FLAGS_MEM_MASK; - ulint sf= space->flags & ~FSP_FLAGS_MEM_MASK; + uint32_t cf= cflags & ~FSP_FLAGS_MEM_MASK; + uint32_t sf= space->flags & ~FSP_FLAGS_MEM_MASK; if (!fil_space_t::is_flags_equal(cf, sf) && !fil_space_t::is_flags_equal(sf, cf)) diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc index b9245eb4325..203cbb5ceed 100644 --- a/storage/innobase/row/row0import.cc +++ b/storage/innobase/row/row0import.cc @@ -81,9 +81,9 @@ struct row_index_t { in the exporting server */ byte* m_name; /*!< Index name */ - ulint m_space; /*!< Space where it is placed */ + uint32_t m_space; /*!< Space where it is placed */ - ulint m_page_no; /*!< Root page number */ + uint32_t m_page_no; /*!< Root page number */ ulint m_type; /*!< Index type */ @@ -404,14 +404,14 @@ class AbstractCallback public: /** Constructor @param trx covering transaction */ - AbstractCallback(trx_t* trx, ulint space_id) + AbstractCallback(trx_t* trx, uint32_t space_id) : m_zip_size(0), m_trx(trx), m_space(space_id), m_xdes(), - m_xdes_page_no(ULINT_UNDEFINED), - m_space_flags(ULINT_UNDEFINED) UNIV_NOTHROW { } + m_xdes_page_no(UINT32_MAX), + m_space_flags(UINT32_MAX) UNIV_NOTHROW { } /** Free any extent descriptor instance */ virtual ~AbstractCallback() @@ -434,10 +434,7 @@ public: } /** @return the tablespace flags */ - ulint get_space_flags() const - { - return(m_space_flags); - } + uint32_t get_space_flags() const { return m_space_flags; } /** Set the name of the physical file and the file handle that is used @@ -468,7 +465,7 @@ public: virtual dberr_t operator()(buf_block_t* block) UNIV_NOTHROW = 0; /** @return the tablespace identifier */ - ulint get_space_id() const { return m_space; } + uint32_t get_space_id() const { return m_space; } bool is_interrupted() const { return trx_is_interrupted(m_trx); } @@ -511,7 +508,7 @@ protected: @param page page contents @return DB_SUCCESS or error code. */ dberr_t set_current_xdes( - ulint page_no, + uint32_t page_no, const page_t* page) UNIV_NOTHROW { m_xdes_page_no = page_no; @@ -576,19 +573,16 @@ protected: trx_t* m_trx; /** Space id of the file being iterated over. */ - ulint m_space; - - /** Current size of the space in pages */ - ulint m_size; + uint32_t m_space; /** Current extent descriptor page */ xdes_t* m_xdes; /** Physical page offset in the file of the extent descriptor */ - ulint m_xdes_page_no; + uint32_t m_xdes_page_no; /** Flags value read from the header page */ - ulint m_space_flags; + uint32_t m_space_flags; }; /** Determine the page size to use for traversing the tablespace @@ -604,8 +598,8 @@ AbstractCallback::init( m_space_flags = fsp_header_get_flags(page); if (!fil_space_t::is_valid_flags(m_space_flags, true)) { - ulint cflags = fsp_flags_convert_from_101(m_space_flags); - if (cflags == ULINT_UNDEFINED) { + uint32_t cflags = fsp_flags_convert_from_101(m_space_flags); + if (cflags == UINT32_MAX) { ib::error() << "Invalid FSP_SPACE_FLAGS=" << ib::hex(m_space_flags); return(DB_CORRUPTION); @@ -636,8 +630,7 @@ AbstractCallback::init( return(DB_CORRUPTION); } - m_size = mach_read_from_4(page + FSP_SIZE); - if (m_space == ULINT_UNDEFINED) { + if (m_space == UINT32_MAX) { m_space = mach_read_from_4(FSP_HEADER_OFFSET + FSP_SPACE_ID + page); } @@ -671,13 +664,13 @@ struct FetchIndexRootPages : public AbstractCallback { /** Index information gathered from the .ibd file. */ struct Index { - Index(index_id_t id, ulint page_no) + Index(index_id_t id, uint32_t page_no) : m_id(id), m_page_no(page_no) { } index_id_t m_id; /*!< Index id */ - ulint m_page_no; /*!< Root page number */ + uint32_t m_page_no; /*!< Root page number */ }; /** Constructor @@ -685,7 +678,7 @@ struct FetchIndexRootPages : public AbstractCallback { @param table table definition in server .*/ FetchIndexRootPages(const dict_table_t* table, trx_t* trx) : - AbstractCallback(trx, ULINT_UNDEFINED), + AbstractCallback(trx, UINT32_MAX), m_table(table), m_index(0, 0) UNIV_NOTHROW { } /** Destructor */ @@ -730,7 +723,7 @@ dberr_t FetchIndexRootPages::operator()(buf_block_t* block) UNIV_NOTHROW m_index.m_page_no = block->page.id().page_no(); /* Check that the tablespace flags match the table flags. */ - ulint expected = dict_tf_to_fsp_flags(m_table->flags); + const uint32_t expected = dict_tf_to_fsp_flags(m_table->flags); if (!fsp_flags_match(expected, m_space_flags)) { ib_errf(m_trx->mysql_thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH, @@ -847,7 +840,7 @@ public: @param cfg config of table being imported. @param space_id tablespace identifier @param trx transaction covering the import */ - PageConverter(row_import* cfg, ulint space_id, trx_t* trx) + PageConverter(row_import* cfg, uint32_t space_id, trx_t* trx) : AbstractCallback(trx, space_id), m_cfg(cfg), @@ -1424,7 +1417,7 @@ row_import::set_root_by_name() UNIV_NOTHROW /* We've already checked that it exists. */ ut_a(index != 0); - index->page = static_cast<uint32_t>(cfg_index->m_page_no); + index->page = cfg_index->m_page_no; } } @@ -1481,8 +1474,7 @@ row_import::set_root_by_heuristic() UNIV_NOTHROW cfg_index[i].m_srv_index = index; - index->page = static_cast<uint32_t>( - cfg_index[i++].m_page_no); + index->page = cfg_index[i++].m_page_no; } } @@ -3465,8 +3457,8 @@ page_corrupted: if (!buf_page_verify_crypt_checksum(readptr, m_space_flags)) goto page_corrupted; - if (!fil_space_decrypt(get_space_id(), iter.crypt_data, readptr, - size, m_space_flags, readptr, &err) || + if (!fil_space_decrypt(get_space_id(), m_space_flags, iter.crypt_data, + readptr, size, readptr, &err) || err != DB_SUCCESS) goto func_exit; } @@ -3517,7 +3509,7 @@ static dberr_t fil_iterate( return DB_OUT_OF_MEMORY; } - ulint actual_space_id = 0; + uint32_t actual_space_id = 0; const bool full_crc32 = fil_space_t::full_crc32( callback.get_space_flags()); @@ -3646,9 +3638,9 @@ not_encrypted: decrypted = fil_space_decrypt( actual_space_id, + callback.get_space_flags(), iter.crypt_data, dst, callback.physical_size(), - callback.get_space_flags(), src, &err); if (err != DB_SUCCESS) { @@ -4187,11 +4179,9 @@ row_import_for_mysql( we will not be writing any redo log for it before we have invoked fil_space_t::set_imported() to declare it a persistent tablespace. */ - ulint fsp_flags = dict_tf_to_fsp_flags(table->flags); - table->space = fil_ibd_open( true, FIL_TYPE_IMPORT, table->space_id, - fsp_flags, name, filepath, &err); + dict_tf_to_fsp_flags(table->flags), name, filepath, &err); ut_ad((table->space == NULL) == (err != DB_SUCCESS)); DBUG_EXECUTE_IF("ib_import_open_tablespace_failure", diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index f8a4d838a98..15f7796e0da 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -94,15 +94,15 @@ char* srv_data_home; char* srv_undo_dir; /** The number of tablespaces to use for rollback segments. */ -ulong srv_undo_tablespaces; +uint srv_undo_tablespaces; /** The number of UNDO tablespaces that are open and ready to use. */ -ulint srv_undo_tablespaces_open; +uint32_t srv_undo_tablespaces_open; /** The number of UNDO tablespaces that are active (hosting some rollback segment). It is quite possible that some of the tablespaces doesn't host any of the rollback-segment based on configuration used. */ -ulint srv_undo_tablespaces_active; +uint32_t srv_undo_tablespaces_active; /** Rate at which UNDO records should be purged. */ ulong srv_purge_rseg_truncate_frequency; @@ -166,7 +166,7 @@ uint srv_flush_log_at_timeout; /** innodb_page_size */ ulong srv_page_size; /** log2 of innodb_page_size; @see innodb_init_params() */ -ulong srv_page_size_shift; +uint32_t srv_page_size_shift; /** innodb_log_write_ahead_size */ ulong srv_log_write_ahead_size; @@ -1723,7 +1723,8 @@ std::mutex purge_thread_count_mtx; void srv_update_purge_thread_count(uint n) { std::lock_guard<std::mutex> lk(purge_thread_count_mtx); - purge_create_background_thds(n); + ut_ad(n > 0); + ut_ad(n <= innodb_purge_threads_MAX); srv_n_purge_threads = n; srv_purge_thread_count_changed = 1; } @@ -1966,7 +1967,7 @@ static void purge_coordinator_callback(void*) void srv_init_purge_tasks() { - purge_create_background_thds(srv_n_purge_threads); + purge_create_background_thds(innodb_purge_threads_MAX); purge_coordinator_timer= srv_thread_pool->create_timer (purge_coordinator_callback, nullptr); } diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 3f0ccf44b1e..8827605f04f 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -113,7 +113,7 @@ ibool srv_start_raw_disk_in_use; uint srv_n_file_io_threads; /** UNDO tablespaces starts with space id. */ -ulint srv_undo_space_id_start; +uint32_t srv_undo_space_id_start; /** TRUE if the server is being started, before rolling back any incomplete transactions */ @@ -455,7 +455,7 @@ static dberr_t srv_validate_undo_tablespaces() } /** @return the number of active undo tablespaces (except system tablespace) */ -static ulint trx_rseg_get_n_undo_tablespaces() +static uint32_t trx_rseg_get_n_undo_tablespaces() { std::set<uint32_t> space_ids; mtr_t mtr; @@ -467,7 +467,7 @@ static ulint trx_rseg_get_n_undo_tablespaces() if (uint32_t space= trx_sysf_rseg_get_space(sys_header, rseg_id)) space_ids.insert(space); mtr.commit(); - return space_ids.size(); + return static_cast<uint32_t>(space_ids.size()); } /** Open an undo tablespace. @@ -476,11 +476,12 @@ static ulint trx_rseg_get_n_undo_tablespaces() @param[in] i undo tablespace count @return undo tablespace identifier @retval 0 on failure */ -static ulint srv_undo_tablespace_open(bool create, const char* name, ulint i) +static uint32_t srv_undo_tablespace_open(bool create, const char *name, + uint32_t i) { bool success; - ulint space_id= 0; - ulint fsp_flags= 0; + uint32_t space_id= 0; + uint32_t fsp_flags= 0; if (create) { @@ -636,20 +637,21 @@ srv_check_undo_redo_logs_exists() return(DB_SUCCESS); } -static dberr_t srv_all_undo_tablespaces_open(bool create_new_db, ulint n_undo) +static dberr_t srv_all_undo_tablespaces_open(bool create_new_db, + uint32_t n_undo) { /* Open all the undo tablespaces that are currently in use. If we fail to open any of these it is a fatal error. The tablespace ids should be contiguous. It is a fatal error because they are required for recovery and are referenced by the UNDO logs (a.k.a RBS). */ - ulint prev_id= create_new_db ? srv_undo_space_id_start - 1 : 0; + uint32_t prev_id= create_new_db ? srv_undo_space_id_start - 1 : 0; - for (ulint i= 0; i < n_undo; ++i) + for (uint32_t i= 0; i < n_undo; ++i) { char name[OS_FILE_MAX_PATH]; - snprintf(name, sizeof name, "%s/undo%03zu", srv_undo_dir, i + 1); - ulint space_id= srv_undo_tablespace_open(create_new_db, name, i); + snprintf(name, sizeof name, "%s/undo%03u", srv_undo_dir, i + 1); + uint32_t space_id= srv_undo_tablespace_open(create_new_db, name, i); if (!space_id) { if (!create_new_db) @@ -674,11 +676,11 @@ static dberr_t srv_all_undo_tablespaces_open(bool create_new_db, ulint n_undo) not in use and therefore not required by recovery. We only check that there are no gaps. */ - for (ulint i= prev_id + 1; i < srv_undo_space_id_start + TRX_SYS_N_RSEGS; + for (uint32_t i= prev_id + 1; i < srv_undo_space_id_start + TRX_SYS_N_RSEGS; ++i) { char name[OS_FILE_MAX_PATH]; - snprintf(name, sizeof name, "%s/undo%03zu", srv_undo_dir, i); + snprintf(name, sizeof name, "%s/undo%03u", srv_undo_dir, i); if (!srv_undo_tablespace_open(create_new_db, name, i)) break; ++srv_undo_tablespaces_open; @@ -690,8 +692,7 @@ static dberr_t srv_all_undo_tablespaces_open(bool create_new_db, ulint n_undo) /** Open the configured number of dedicated undo tablespaces. @param[in] create_new_db whether the database is being initialized @return DB_SUCCESS or error code */ -dberr_t -srv_undo_tablespaces_init(bool create_new_db) +dberr_t srv_undo_tablespaces_init(bool create_new_db) { srv_undo_tablespaces_open= 0; @@ -727,8 +728,8 @@ srv_undo_tablespaces_init(bool create_new_db) already exist. */ srv_undo_tablespaces_active= srv_undo_tablespaces; - ulint n_undo= (create_new_db || srv_operation == SRV_OPERATION_BACKUP || - srv_operation == SRV_OPERATION_RESTORE_DELTA) + uint32_t n_undo= (create_new_db || srv_operation == SRV_OPERATION_BACKUP || + srv_operation == SRV_OPERATION_RESTORE_DELTA) ? srv_undo_tablespaces : TRX_SYS_N_RSEGS; if (dberr_t err= srv_all_undo_tablespaces_open(create_new_db, n_undo)) @@ -742,7 +743,7 @@ srv_undo_tablespaces_init(bool create_new_db) if (create_new_db) { mtr_t mtr; - for (ulint i= 0; i < srv_undo_tablespaces; ++i) + for (uint32_t i= 0; i < srv_undo_tablespaces; ++i) { mtr.start(); fsp_header_init(fil_space_get(srv_undo_space_id_start + i), @@ -1501,8 +1502,9 @@ file_checked: fil_system.space_id_reuse_warned = false; if (!srv_read_only_mode) { - const ulint flags = FSP_FLAGS_PAGE_SSIZE(); - for (ulint id = 0; id <= srv_undo_tablespaces; id++) { + const uint32_t flags = FSP_FLAGS_PAGE_SSIZE(); + for (uint32_t id = 0; id <= srv_undo_tablespaces; + id++) { if (fil_space_t* space = fil_space_get(id)) { fsp_flags_try_adjust(space, flags); } diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index 3dd1b093cf6..77354a8da91 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -576,11 +576,11 @@ static void trx_purge_truncate_history() { const ulint threshold= ulint(srv_max_undo_log_size >> srv_page_size_shift); - for (ulint i= purge_sys.truncate.last + for (uint32_t i= purge_sys.truncate.last ? purge_sys.truncate.last->id - srv_undo_space_id_start : 0, j= i;; ) { - const auto space_id= srv_undo_space_id_start + i; + const uint32_t space_id= srv_undo_space_id_start + i; ut_ad(srv_is_undo_tablespace(space_id)); fil_space_t *space= fil_space_get(space_id); ut_a(UT_LIST_GET_LEN(space->chain) == 1); @@ -969,8 +969,7 @@ trx_purge_get_next_rec( ut_ad(purge_sys.next_stored); ut_ad(purge_sys.tail.trx_no < purge_sys.low_limit_no()); - const ulint space = purge_sys.rseg->space->id; - const uint32_t page_no = purge_sys.page_no; + const page_id_t page_id{purge_sys.rseg->space->id, purge_sys.page_no}; const uint16_t offset = purge_sys.offset; if (offset == 0) { @@ -988,8 +987,7 @@ trx_purge_get_next_rec( mtr_start(&mtr); - buf_block_t* undo_page = trx_undo_page_get_s_latched( - page_id_t(space, page_no), &mtr); + buf_block_t* undo_page = trx_undo_page_get_s_latched(page_id, &mtr); buf_block_t* rec2_page = undo_page; const trx_undo_rec_t* rec2 = trx_undo_page_get_next_rec( @@ -1012,8 +1010,7 @@ trx_purge_get_next_rec( mtr_start(&mtr); - undo_page = trx_undo_page_get_s_latched( - page_id_t(space, page_no), &mtr); + undo_page = trx_undo_page_get_s_latched(page_id, &mtr); } else { purge_sys.offset = page_offset(rec2); purge_sys.page_no = rec2_page->page.id().page_no(); diff --git a/storage/innobase/trx/trx0rseg.cc b/storage/innobase/trx/trx0rseg.cc index ace1d8531fc..3e392e1df48 100644 --- a/storage/innobase/trx/trx0rseg.cc +++ b/storage/innobase/trx/trx0rseg.cc @@ -31,6 +31,22 @@ Created 3/26/1996 Heikki Tuuri #include "trx0purge.h" #include "srv0mon.h" +/** Get a newly created rollback segment header. +@param page_id header page location +@param mtr mini-transaction +@return rollback segment header, page x-latched */ +static buf_block_t *trx_rsegf_get_new(page_id_t page_id, mtr_t *mtr) +{ +#ifdef UNIV_DEBUG + if (page_id.space() != SRV_TMP_SPACE_ID) + { + ut_ad(page_id.space() <= srv_undo_tablespaces_active || !srv_was_started); + ut_ad(page_id.space() <= TRX_SYS_MAX_UNDO_SPACES); + } +#endif + return buf_page_get(page_id, 0, RW_X_LATCH, mtr); +} + #ifdef WITH_WSREP #include <mysql/service_wsrep.h> @@ -258,7 +274,8 @@ bool trx_rseg_read_wsrep_checkpoint(XID& xid) } const buf_block_t* rseg_header = trx_rsegf_get_new( - trx_sysf_rseg_get_space(sys, rseg_id), page_no, &mtr); + page_id_t(trx_sysf_rseg_get_space(sys, rseg_id), + page_no), &mtr); if (mach_read_from_4(TRX_RSEG + TRX_RSEG_FORMAT + rseg_header->frame)) { @@ -453,7 +470,7 @@ static dberr_t trx_rseg_mem_restore(trx_rseg_t *rseg, trx_id_t &max_trx_id, mtr_t *mtr) { buf_block_t* rseg_hdr = trx_rsegf_get_new( - rseg->space->id, rseg->page_no, mtr); + page_id_t(rseg->space->id, rseg->page_no), mtr); if (!mach_read_from_4(TRX_RSEG + TRX_RSEG_FORMAT + rseg_hdr->frame)) { trx_id_t id = mach_read_from_8(TRX_RSEG + TRX_RSEG_MAX_TRX_ID diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc index 52e246c5c4f..65ac991bb68 100644 --- a/storage/innobase/trx/trx0sys.cc +++ b/storage/innobase/trx/trx0sys.cc @@ -279,7 +279,7 @@ trx_sys_create_sys_pages(void) @param space_id system or undo tablespace id @return pointer to new rollback segment @retval nullptr on failure */ -static trx_rseg_t *trx_rseg_create(ulint space_id) +static trx_rseg_t *trx_rseg_create(uint32_t space_id) { trx_rseg_t *rseg= nullptr; mtr_t mtr; @@ -333,11 +333,11 @@ bool trx_sys_create_rsegs() in the system tablespace. */ ut_a(srv_available_undo_logs > 0); - for (ulint i = 0; srv_available_undo_logs < TRX_SYS_N_RSEGS; + for (uint32_t i = 0; srv_available_undo_logs < TRX_SYS_N_RSEGS; i++, srv_available_undo_logs++) { /* Tablespace 0 is the system tablespace. Dedicated undo log tablespaces start from 1. */ - ulint space = srv_undo_tablespaces > 0 + uint32_t space = srv_undo_tablespaces > 0 ? (i % srv_undo_tablespaces) + srv_undo_space_id_start : TRX_SYS_SPACE; diff --git a/storage/innobase/trx/trx0undo.cc b/storage/innobase/trx/trx0undo.cc index da3f6b592fa..12374fdf1e2 100644 --- a/storage/innobase/trx/trx0undo.cc +++ b/storage/innobase/trx/trx0undo.cc @@ -607,7 +607,7 @@ trx_undo_free_page( undo log page; the caller must have reserved the rollback segment mutex */ { - const ulint space = rseg->space->id; + const uint32_t space = rseg->space->id; ut_a(hdr_page_no != page_no); diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c index f84f0b8e938..4a1ee8b0505 100644 --- a/storage/maria/ma_open.c +++ b/storage/maria/ma_open.c @@ -156,8 +156,7 @@ static MARIA_HA *maria_clone_internal(MARIA_SHARE *share, info.lock_type= F_WRLCK; _ma_set_data_pagecache_callbacks(&info.dfile, share); - my_bitmap_init(&info.changed_fields, changed_fields_bitmap, - share->base.fields, 0); + my_bitmap_init(&info.changed_fields, changed_fields_bitmap, share->base.fields); if ((*share->init)(&info)) goto err; diff --git a/storage/mroonga/ha_mroonga.cpp b/storage/mroonga/ha_mroonga.cpp index 1cddd8fc4a8..83c2d15a36c 100644 --- a/storage/mroonga/ha_mroonga.cpp +++ b/storage/mroonga/ha_mroonga.cpp @@ -4926,7 +4926,7 @@ int ha_mroonga::open(const char *name, DBUG_RETURN(error); thr_lock_data_init(&share->lock,&thr_lock_data,NULL); - if (bitmap_init(&multiple_column_key_bitmap, NULL, table->s->fields, false)) + if (my_bitmap_init(&multiple_column_key_bitmap, NULL, table->s->fields)) { mrn_free_share(share); share = NULL; @@ -4942,7 +4942,7 @@ int ha_mroonga::open(const char *name, if (error) { - bitmap_free(&multiple_column_key_bitmap); + my_bitmap_free(&multiple_column_key_bitmap); mrn_free_share(share); share = NULL; } @@ -5009,7 +5009,7 @@ int ha_mroonga::close() { error = add_wrap_hton(share->table_name, share->hton); } - bitmap_free(&multiple_column_key_bitmap); + my_bitmap_free(&multiple_column_key_bitmap); if (share->use_count == 1) { mrn_free_long_term_share(share->long_term_share); } diff --git a/storage/mroonga/lib/mrn_smart_bitmap.cpp b/storage/mroonga/lib/mrn_smart_bitmap.cpp index f8fd4f727bb..cdedeb677cd 100644 --- a/storage/mroonga/lib/mrn_smart_bitmap.cpp +++ b/storage/mroonga/lib/mrn_smart_bitmap.cpp @@ -26,7 +26,7 @@ namespace mrn { SmartBitmap::~SmartBitmap() { if (bitmap_) { - bitmap_free(bitmap_); + my_bitmap_free(bitmap_); } } diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc index 70a4d6aa284..d37636abab7 100644 --- a/storage/myisammrg/ha_myisammrg.cc +++ b/storage/myisammrg/ha_myisammrg.cc @@ -121,7 +121,7 @@ ha_myisammrg::ha_myisammrg(handlerton *hton, TABLE_SHARE *table_arg) :handler(hton, table_arg), file(0), is_cloned(0) { init_sql_alloc(rg_key_memory_children, &children_mem_root, - FN_REFLEN + ALLOC_ROOT_MIN_BLOCK_SIZE, 0, MYF(0)); + FN_REFLEN, 0, MYF(0)); } diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 7388f223b1b..ce51c9d325e 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -10786,7 +10786,7 @@ int ha_rocksdb::index_end() { release_scan_iterator(); - bitmap_free(&m_lookup_bitmap); + my_bitmap_free(&m_lookup_bitmap); active_index = MAX_KEY; in_range_check_pushed_down = FALSE; diff --git a/storage/rocksdb/ha_rocksdb.h b/storage/rocksdb/ha_rocksdb.h index 05f0b2bf984..6d2d877c8ec 100644 --- a/storage/rocksdb/ha_rocksdb.h +++ b/storage/rocksdb/ha_rocksdb.h @@ -397,7 +397,7 @@ class ha_rocksdb : public my_core::handler { current lookup to be covered. If the bitmap field is null, that means this index does not cover the current lookup for any record. */ - MY_BITMAP m_lookup_bitmap = {nullptr, nullptr, nullptr, 0, 0}; + MY_BITMAP m_lookup_bitmap = {nullptr, nullptr, 0, 0}; int alloc_key_buffers(const TABLE *const table_arg, const Rdb_tbl_def *const tbl_def_arg, diff --git a/storage/rocksdb/rdb_datadic.cc b/storage/rocksdb/rdb_datadic.cc index 6c3e99be55e..797ef68f72a 100644 --- a/storage/rocksdb/rdb_datadic.cc +++ b/storage/rocksdb/rdb_datadic.cc @@ -1102,12 +1102,12 @@ size_t Rdb_key_def::get_unpack_header_size(char tag) { */ void Rdb_key_def::get_lookup_bitmap(const TABLE *table, MY_BITMAP *map) const { DBUG_ASSERT(map->bitmap == nullptr); - bitmap_init(map, nullptr, MAX_REF_PARTS, false); + my_bitmap_init(map, nullptr, MAX_REF_PARTS); uint curr_bitmap_pos = 0; // Indicates which columns in the read set might be covered. MY_BITMAP maybe_covered_bitmap; - bitmap_init(&maybe_covered_bitmap, nullptr, table->read_set->n_bits, false); + my_bitmap_init(&maybe_covered_bitmap, nullptr, table->read_set->n_bits); for (uint i = 0; i < m_key_parts; i++) { if (table_has_hidden_pk(table) && i + 1 == m_key_parts) { @@ -1135,8 +1135,8 @@ void Rdb_key_def::get_lookup_bitmap(const TABLE *table, MY_BITMAP *map) const { } curr_bitmap_pos++; } else { - bitmap_free(&maybe_covered_bitmap); - bitmap_free(map); + my_bitmap_free(&maybe_covered_bitmap); + my_bitmap_free(map); return; } break; @@ -1144,8 +1144,8 @@ void Rdb_key_def::get_lookup_bitmap(const TABLE *table, MY_BITMAP *map) const { // know this lookup will never be covered. default: if (bitmap_is_set(table->read_set, field->field_index)) { - bitmap_free(&maybe_covered_bitmap); - bitmap_free(map); + my_bitmap_free(&maybe_covered_bitmap); + my_bitmap_free(map); return; } break; @@ -1155,9 +1155,9 @@ void Rdb_key_def::get_lookup_bitmap(const TABLE *table, MY_BITMAP *map) const { // If there are columns which are not covered in the read set, the lookup // can't be covered. if (!bitmap_cmp(table->read_set, &maybe_covered_bitmap)) { - bitmap_free(map); + my_bitmap_free(map); } - bitmap_free(&maybe_covered_bitmap); + my_bitmap_free(&maybe_covered_bitmap); } /* @@ -1187,7 +1187,7 @@ bool Rdb_key_def::covers_lookup(const rocksdb::Slice *const unpack_info, MY_BITMAP covered_bitmap; my_bitmap_map covered_bits; - bitmap_init(&covered_bitmap, &covered_bits, MAX_REF_PARTS, false); + my_bitmap_init(&covered_bitmap, &covered_bits, MAX_REF_PARTS); covered_bits = rdb_netbuf_to_uint16((const uchar *)unpack_header + sizeof(RDB_UNPACK_COVERED_DATA_TAG) + RDB_UNPACK_COVERED_DATA_LEN_SIZE); @@ -1356,7 +1356,7 @@ uint Rdb_key_def::pack_record(const TABLE *const tbl, uchar *const pack_buffer, MY_BITMAP covered_bitmap; my_bitmap_map covered_bits; uint curr_bitmap_pos = 0; - bitmap_init(&covered_bitmap, &covered_bits, MAX_REF_PARTS, false); + my_bitmap_init(&covered_bitmap, &covered_bits, MAX_REF_PARTS); for (uint i = 0; i < n_key_parts; i++) { // Fill hidden pk id into the last key part for secondary keys for tables @@ -1661,7 +1661,7 @@ int Rdb_key_def::unpack_record(TABLE *const table, uchar *const buf, bool has_covered_bitmap = has_unpack_info && (unpack_header[0] == RDB_UNPACK_COVERED_DATA_TAG); if (has_covered_bitmap) { - bitmap_init(&covered_bitmap, &covered_bits, MAX_REF_PARTS, false); + my_bitmap_init(&covered_bitmap, &covered_bits, MAX_REF_PARTS); covered_bits = rdb_netbuf_to_uint16((const uchar *)unpack_header + sizeof(RDB_UNPACK_COVERED_DATA_TAG) + RDB_UNPACK_COVERED_DATA_LEN_SIZE); diff --git a/storage/spider/mysql-test/spider/include/init_spider.inc b/storage/spider/mysql-test/spider/include/init_spider.inc index 6a22ffcc1fd..b3fb4df239b 100644 --- a/storage/spider/mysql-test/spider/include/init_spider.inc +++ b/storage/spider/mysql-test/spider/include/init_spider.inc @@ -149,13 +149,7 @@ if (!$VERSION_COMPILE_OS_WIN) } } -let $SERVER_NAME= - `SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(version(), '-', 2), '-', -1)`; -if (`SELECT IF('$SERVER_NAME' REGEXP '^[0-9]+\$', 1, 0)`) -{ - let $SERVER_NAME= - `SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(version(), '-', 3), '-', -1)`; -} +let $SERVER_NAME=MariaDB; let $SERVER_MAJOR_VERSION= `SELECT SUBSTRING_INDEX(version(), '.', 1)`; let $SERVER_MINOR_VERSION= diff --git a/storage/spider/spd_init_query.h b/storage/spider/spd_init_query.h index 19b04d50b82..0dcbcd50230 100644 --- a/storage/spider/spd_init_query.h +++ b/storage/spider/spd_init_query.h @@ -224,12 +224,7 @@ static LEX_STRING spider_init_queries[] = { {C_STRING_WITH_LEN( "create procedure mysql.spider_fix_system_tables()" "begin" - " select substring_index(substring_index(version(), '-', 2), '-', -1)" - " into @server_name;" - " if @server_name regexp '^[0-9]+$' then" - " select substring_index(substring_index(version(), '-', 3), '-', -1)" - " into @server_name;" - " end if;" + " select 'MariaDB' into @server_name;" " select substring_index(version(), '.', 1)" " into @server_major_version;" " select substring_index(substring_index(version(), '.', 2), '.', -1)" @@ -548,7 +543,7 @@ static LEX_STRING spider_init_queries[] = { " @server_major_version > 10 or" " (" " @server_major_version = 10 and" - " @server_minor_version >= 7" + " @server_minor_version >= 8" " )" " )" " then" @@ -808,7 +803,7 @@ static LEX_STRING spider_init_queries[] = { " @server_major_version > 10 or" " (" " @server_major_version = 10 and" - " @server_minor_version >= 7" + " @server_minor_version >= 8" " )" " )" " then" diff --git a/strings/CMakeLists.txt b/strings/CMakeLists.txt index 0e62f9e34ad..54612256adc 100644 --- a/strings/CMakeLists.txt +++ b/strings/CMakeLists.txt @@ -23,7 +23,7 @@ SET(STRINGS_SOURCES bchange.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c str2int.c strcend.c strend.c strfill.c strmake.c strmov.c strnmov.c strxmov.c strxnmov.c xml.c strmov_overlapp.c - my_strchr.c strcont.c strappend.c json_lib.c) + my_strchr.c strcont.c strappend.c json_lib.c json_normalize.c) IF(NOT HAVE_STRNLEN) # OSX below 10.7 did not have strnlen diff --git a/strings/ctype-ascii.h b/strings/ctype-ascii.h new file mode 100644 index 00000000000..540d01b1a0d --- /dev/null +++ b/strings/ctype-ascii.h @@ -0,0 +1,189 @@ +#ifndef CTYPE_ASCII_INCLUDED +#define CTYPE_ASCII_INCLUDED + +#include "myisampack.h" + +/* + Magic expression. It uses the fact that for any byte value X in + the range 0..31 (0x00..0x1F) the expression (X+31)*5 returns + the 7th bit (0x80) set only for the following six (out of 32) values: + 0x00, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F. + These values correspond to offsets of non-letter characters + in the ASCII table: + + The following macro sets the bit 0x20 for the following characters: + ---------------- -------------------------------- + Magic bit 10000000000000000000000000011111 + ASCII 0x00..0x1F ................................ Control + ASCII 0x20..0x3F ................................ Punctuation, digits + ASCII 0x40..0x5F @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ + ASCII 0x60..0x7F `abcdefghijklmnopqrstuvwxyz{|}~. + ---------------- -------------------------------- + We shift the magic bit 0x80 right twice to make it 0x20. + So on the ranges [40..5F] and [60..7F] the expression + has the bit 0x20 set for all non-letter characters. + Note, other bits contain garbage. + + Requirements: + All bytes must be in the range [00..7F], + to avoid overflow and carry to the next byte. +*/ +#define MY_ASCII_20_IS_SET_IF_NOT_LETTER_MAGIC(i) \ + (((((i)+0x1F1F1F1F1F1F1F1FULL) & 0x1F1F1F1F1F1F1F1F) * 5) >> 2) + + +/* + The following macro returns the bit 0x20 set to: + - 1 for input bytes in the ranges [60..7F] or [E0..FF] + - 0 otherwise + Bytes in the ranges [40..7F] and [C0..FF] have the bit 0x40 set. + Bytes in the ranges [60..7F] and [E0..FF] have the bit 0x20 set. + Hex BinHi BinLo + ---- -1-- ---- + 0x[4C]X .10. .... + 0x[5D]X .10. .... + 0x[6E]X .11. .... + 0x[7F]X .11. .... +*/ +#define MY_ASCII_20_IS_SET_IF_RANGE_60_7F_OR_E0_FF(i) (((i) >> 1) & ((i))) + + +/* + The following macro evaluates to exactly 0x20 for all + lower case ASCII letters [a-z], and to 0x00 otherwise: + + Value Range Character range Subrange + -------- -------- -------------------------------- ------- + 00000000 0x00..0x3F Control, punctuation, digits + 00100000 0x40..0x5F @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ letters A-Z + 00000000 0x40..0x5F @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ non-letters + 00100000 0x60..0x7F `abcdefghijklmnopqrstuvwxyz{|}~. letters a-z + 00000000 0x60..0x7F `abcdefghijklmnopqrstuvwxyz{|}~. non-letters + + Requirements: + All bytes must be in the range [00..7F]. + See the comments in MY_ASCII_20_IS_SET_IF_NOT_LETTER_MAGIC(). +*/ + +#define MY_ASCII_20_IF_IS_LOWER_LETTER(i) \ + (MY_ASCII_20_IS_SET_IF_RANGE_60_7F_OR_E0_FF(i) & \ + ~MY_ASCII_20_IS_SET_IF_NOT_LETTER_MAGIC(i) & \ + 0x2020202020202020) + +/* + Convert lower case ASCII letters to upper case by unsetting + the bit 0x20 with help of the magic expression. + + Requirements: + All bytes must be in the range [00..7F]. + See the comments in MY_ASCII_20_IS_SET_IF_NOT_LETTER_MAGIC() +*/ +#define MY_ASCII_TOUPPER_MAGIC(i) \ + (i ^ MY_ASCII_20_IF_IS_LOWER_LETTER(i)) + + +/* + Convert a string (consisting of 8 bytes stored in uint64) + to upper case algorithmically. + + Requirements: + All bytes must be in the range [00..0x7F]. + See the comments in MY_ASCII_20_IS_SET_IF_NOT_LETTER_MAGIC(). + The result on 8bit data is unpredictable!!! + The caller should make sure not to pass 8bit data. +*/ +static inline ulonglong my_ascii_to_upper_magic_uint64(ulonglong i) +{ + return MY_ASCII_TOUPPER_MAGIC(i); +} + + +/* + Check if: + - both strings "a" and "b" have at least 4 bytes, and + - both strings have only 7bit data. +*/ +static inline int +my_strcoll_ascii_4bytes_found(const uchar *a, const uchar *ae, + const uchar *b, const uchar *be) +{ + return a + 4 <= ae && b + 4 <= be && + (uint4korr(b) & 0x80808080) == 0 && + (uint4korr(a) & 0x80808080) == 0; +} + + +/* + Compare the leading four 7bit ASCII bytes in two strings case insensitively + by converting letters [a-z] to upper case [A-Z]. + + Requirements: + - The input strings must have at least four bytes, and + - The leading four bytes in both strings must be 7bit ASCII. + The caller must make sure to provide only strings that meet + these requirements. The result on 8-bit data is unpredictable + as 8-bit bytes may cause overflow in my_ascii_to_upper_magic_uint64(). + See comments above. +*/ +static inline int +my_strcoll_ascii_toupper_4bytes(const uchar *a, const uchar *b) +{ + ulonglong abn= (((ulonglong) mi_uint4korr(a)) << 32) | mi_uint4korr(b); + abn= my_ascii_to_upper_magic_uint64(abn); + if ((uint32) (abn >> 32) == (uint32) abn) + return 0; + return ((uint32) (abn >> 32)) < ((uint32) abn) ? -1 : + 1; +} + + +/* + Compare the leading eight 7bit ASCII bytes in two strings case insensitively + by converting letters [a-z] to upper case [A-Z]. + + Requirements: + - The input strings must have at least eight bytes, and + - The leading eight bytes in both strings must be 7bit ASCII. + See comments in my_strcoll_ascii_toupper_4bytes(). +*/ +static inline int +my_strcoll_ascii_toupper_8bytes(const uchar *a, const uchar *b) +{ + /* + TODO: + Try to get advantage of SIMD instructions by massive comparison + (16 bytes at a time) of characters against (x>='a' && x<='z') using: + - either explicit intrinsics + - or a loop that can get vectorized automatically by some compilers. + */ + ulonglong an= mi_uint8korr(a); + ulonglong bn= mi_uint8korr(b); + an= my_ascii_to_upper_magic_uint64(an); + bn= my_ascii_to_upper_magic_uint64(bn); + return an == bn ? 0 : an < bn ? -1 : +1; +} + + +/* + Compare the leading four 7bit ASCII bytes in two strings in binary style. +*/ +static inline int +my_strcoll_mb7_bin_4bytes(const uchar *a, const uchar *b) +{ + uint32 an= mi_uint4korr(a); + uint32 bn= mi_uint4korr(b); + return an == bn ? 0 : an < bn ? -1 : +1; +} + + +/* + Compare the leading four 7bit ASCII bytes in two strings in binary style. +*/ +static inline int +my_strcoll_mb7_bin_8bytes(const uchar *a, const uchar *b) +{ + ulonglong an= mi_uint8korr(a); + ulonglong bn= mi_uint8korr(b); + return an == bn ? 0 : an < bn ? -1 : +1; +} + +#endif /* CTYPE_ASCII_INCLUDED */ diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index 989d6b5f1a8..1e1b21aee34 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -6691,6 +6691,7 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)), #define MY_FUNCTION_NAME(x) my_ ## x ## _big5_bin #define WEIGHT_MB1(x) ((uchar) (x)) #define WEIGHT_MB2(x,y) (big5code(x, y)) +#define STRCOLL_MB7_BIN #include "strcoll.ic" @@ -6707,6 +6708,7 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)), #define MY_FUNCTION_NAME(x) my_ ## x ## _big5_nopad_bin #define WEIGHT_MB1(x) ((uchar) (x)) #define WEIGHT_MB2(x,y) (big5code(x, y)) +#define STRCOLL_MB7_BIN #include "strcoll.ic" diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c index e3c29ae1a32..847d3559a39 100644 --- a/strings/ctype-cp932.c +++ b/strings/ctype-cp932.c @@ -34639,6 +34639,7 @@ size_t my_numcells_cp932(CHARSET_INFO *cs __attribute__((unused)), #define WEIGHT_PAD_SPACE (256 * (int) ' ') #define WEIGHT_MB1(x) (256 * (int) sort_order_cp932[(uchar) (x)]) #define WEIGHT_MB2(x,y) (cp932code(x, y)) +#define STRCOLL_MB7_TOUPPER #include "strcoll.ic" @@ -34646,6 +34647,7 @@ size_t my_numcells_cp932(CHARSET_INFO *cs __attribute__((unused)), #define WEIGHT_PAD_SPACE (256 * (int) ' ') #define WEIGHT_MB1(x) (256 * (int) (uchar) (x)) #define WEIGHT_MB2(x,y) (cp932code(x, y)) +#define STRCOLL_MB7_BIN #include "strcoll.ic" @@ -34654,6 +34656,7 @@ size_t my_numcells_cp932(CHARSET_INFO *cs __attribute__((unused)), #define WEIGHT_PAD_SPACE (256 * (int) ' ') #define WEIGHT_MB1(x) (256 * (int) sort_order_cp932[(uchar) (x)]) #define WEIGHT_MB2(x,y) (cp932code(x, y)) +#define STRCOLL_MB7_TOUPPER #include "strcoll.ic" @@ -34662,6 +34665,7 @@ size_t my_numcells_cp932(CHARSET_INFO *cs __attribute__((unused)), #define WEIGHT_PAD_SPACE (256 * (int) ' ') #define WEIGHT_MB1(x) (256 * (int) (uchar) (x)) #define WEIGHT_MB2(x,y) (cp932code(x, y)) +#define STRCOLL_MB7_BIN #include "strcoll.ic" diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c index 3c257acb460..4d2b9090053 100644 --- a/strings/ctype-euc_kr.c +++ b/strings/ctype-euc_kr.c @@ -9932,12 +9932,14 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)), #define MY_FUNCTION_NAME(x) my_ ## x ## _euckr_korean_ci #define WEIGHT_MB1(x) (sort_order_euc_kr[(uchar) (x)]) #define WEIGHT_MB2(x,y) (euckrcode(x, y)) +#define STRCOLL_MB7_TOUPPER #include "strcoll.ic" #define MY_FUNCTION_NAME(x) my_ ## x ## _euckr_bin #define WEIGHT_MB1(x) ((uchar) (x)) #define WEIGHT_MB2(x,y) (euckrcode(x, y)) +#define STRCOLL_MB7_BIN #include "strcoll.ic" @@ -9945,6 +9947,7 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)), #define MY_FUNCTION_NAME(x) my_ ## x ## _euckr_korean_nopad_ci #define WEIGHT_MB1(x) (sort_order_euc_kr[(uchar) (x)]) #define WEIGHT_MB2(x,y) (euckrcode(x, y)) +#define STRCOLL_MB7_TOUPPER #include "strcoll.ic" @@ -9952,6 +9955,7 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)), #define MY_FUNCTION_NAME(x) my_ ## x ## _euckr_nopad_bin #define WEIGHT_MB1(x) ((uchar) (x)) #define WEIGHT_MB2(x,y) (euckrcode(x, y)) +#define STRCOLL_MB7_BIN #include "strcoll.ic" diff --git a/strings/ctype-eucjpms.c b/strings/ctype-eucjpms.c index ca790291a4a..9c2b23ea918 100644 --- a/strings/ctype-eucjpms.c +++ b/strings/ctype-eucjpms.c @@ -212,6 +212,7 @@ static const uchar sort_order_eucjpms[]= #define WEIGHT_MB2(x,y) ((((uint) (uchar)(x)) << 16) | \ (((uint) (uchar) (y)) << 8)) #define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z)) +#define STRCOLL_MB7_TOUPPER #include "strcoll.ic" @@ -221,6 +222,7 @@ static const uchar sort_order_eucjpms[]= #define WEIGHT_MB2(x,y) ((((uint) (uchar)(x)) << 16) | \ (((uint) (uchar) (y)) << 8)) #define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z)) +#define STRCOLL_MB7_BIN #include "strcoll.ic" @@ -231,6 +233,7 @@ static const uchar sort_order_eucjpms[]= #define WEIGHT_MB2(x,y) ((((uint) (uchar)(x)) << 16) | \ (((uint) (uchar) (y)) << 8)) #define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z)) +#define STRCOLL_MB7_TOUPPER #include "strcoll.ic" @@ -241,6 +244,7 @@ static const uchar sort_order_eucjpms[]= #define WEIGHT_MB2(x,y) ((((uint) (uchar)(x)) << 16) | \ (((uint) (uchar) (y)) << 8)) #define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z)) +#define STRCOLL_MB7_BIN #include "strcoll.ic" diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c index a8e42945259..70ac2c9b958 100644 --- a/strings/ctype-gb2312.c +++ b/strings/ctype-gb2312.c @@ -6344,6 +6344,7 @@ my_mb_wc_gb2312(CHARSET_INFO *cs __attribute__((unused)), #define MY_FUNCTION_NAME(x) my_ ## x ## _gb2312_bin #define WEIGHT_MB1(x) ((uchar) (x)) #define WEIGHT_MB2(x,y) (gb2312code(x, y)) +#define STRCOLL_MB7_BIN #include "strcoll.ic" @@ -6358,6 +6359,7 @@ my_mb_wc_gb2312(CHARSET_INFO *cs __attribute__((unused)), #define MY_FUNCTION_NAME(x) my_ ## x ## _gb2312_nopad_bin #define WEIGHT_MB1(x) ((uchar) (x)) #define WEIGHT_MB2(x,y) (gb2312code(x, y)) +#define STRCOLL_MB7_BIN #include "strcoll.ic" diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c index c8aade2eb31..ba5ba02bf5e 100644 --- a/strings/ctype-gbk.c +++ b/strings/ctype-gbk.c @@ -10625,6 +10625,7 @@ my_mb_wc_gbk(CHARSET_INFO *cs __attribute__((unused)), #define MY_FUNCTION_NAME(x) my_ ## x ## _gbk_bin #define WEIGHT_MB1(x) ((uchar) (x)) #define WEIGHT_MB2(x,y) (gbkcode(x,y)) +#define STRCOLL_MB7_BIN #include "strcoll.ic" @@ -10640,6 +10641,7 @@ my_mb_wc_gbk(CHARSET_INFO *cs __attribute__((unused)), #define MY_FUNCTION_NAME(x) my_ ## x ## _gbk_nopad_bin #define WEIGHT_MB1(x) ((uchar) (x)) #define WEIGHT_MB2(x,y) (gbkcode(x,y)) +#define STRCOLL_MB7_BIN #include "strcoll.ic" diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index d26083202fc..abae90008ea 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -34027,6 +34027,7 @@ my_wc_to_printable_sjis(CHARSET_INFO *cs, my_wc_t wc, #define WEIGHT_PAD_SPACE (256 * (int) ' ') #define WEIGHT_MB1(x) (256 * (int) sort_order_sjis[(uchar) (x)]) #define WEIGHT_MB2(x,y) (sjiscode(x, y)) +#define STRCOLL_MB7_TOUPPER #include "strcoll.ic" @@ -34034,6 +34035,7 @@ my_wc_to_printable_sjis(CHARSET_INFO *cs, my_wc_t wc, #define WEIGHT_PAD_SPACE (256 * (int) ' ') #define WEIGHT_MB1(x) (256 * (int) (uchar) (x)) #define WEIGHT_MB2(x,y) (sjiscode(x, y)) +#define STRCOLL_MB7_BIN #include "strcoll.ic" @@ -34042,6 +34044,7 @@ my_wc_to_printable_sjis(CHARSET_INFO *cs, my_wc_t wc, #define WEIGHT_PAD_SPACE (256 * (int) ' ') #define WEIGHT_MB1(x) (256 * (int) sort_order_sjis[(uchar) (x)]) #define WEIGHT_MB2(x,y) (sjiscode(x, y)) +#define STRCOLL_MB7_TOUPPER #include "strcoll.ic" @@ -34050,6 +34053,7 @@ my_wc_to_printable_sjis(CHARSET_INFO *cs, my_wc_t wc, #define WEIGHT_PAD_SPACE (256 * (int) ' ') #define WEIGHT_MB1(x) (256 * (int) (uchar) (x)) #define WEIGHT_MB2(x,y) (sjiscode(x, y)) +#define STRCOLL_MB7_BIN #include "strcoll.ic" diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c index c190496b364..79c552fd430 100644 --- a/strings/ctype-ujis.c +++ b/strings/ctype-ujis.c @@ -211,6 +211,7 @@ static const uchar sort_order_ujis[]= #define WEIGHT_MB2(x,y) ((((uint) (uchar)(x)) << 16) | \ (((uint) (uchar) (y)) << 8)) #define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z)) +#define STRCOLL_MB7_TOUPPER #include "strcoll.ic" @@ -220,6 +221,7 @@ static const uchar sort_order_ujis[]= #define WEIGHT_MB2(x,y) ((((uint) (uchar)(x)) << 16) | \ (((uint) (uchar) (y)) << 8)) #define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z)) +#define STRCOLL_MB7_BIN #include "strcoll.ic" @@ -230,6 +232,7 @@ static const uchar sort_order_ujis[]= #define WEIGHT_MB2(x,y) ((((uint) (uchar)(x)) << 16) | \ (((uint) (uchar) (y)) << 8)) #define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z)) +#define STRCOLL_MB7_TOUPPER #include "strcoll.ic" @@ -240,6 +243,7 @@ static const uchar sort_order_ujis[]= #define WEIGHT_MB2(x,y) ((((uint) (uchar)(x)) << 16) | \ (((uint) (uchar) (y)) << 8)) #define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z)) +#define STRCOLL_MB7_BIN #include "strcoll.ic" diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 7fdc88352b0..28e01d71bde 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -1036,6 +1036,268 @@ static MY_UNICASE_CHARACTER plane05[]={ {0x05FE,0x05FE,0x05FE}, {0x05FF,0x05FF,0x05FF} }; +static MY_UNICASE_CHARACTER plane06[]={ /* This page is dummy */ + {0x0600,0x0600,0x0600}, {0x0601,0x0601,0x0601}, /* 0600 */ + {0x0602,0x0602,0x0602}, {0x0603,0x0603,0x0603}, /* 0602 */ + {0x0604,0x0604,0x0604}, {0x0605,0x0605,0x0605}, /* 0604 */ + {0x0606,0x0606,0x0606}, {0x0607,0x0607,0x0607}, /* 0606 */ + {0x0608,0x0608,0x0608}, {0x0609,0x0609,0x0609}, /* 0608 */ + {0x060A,0x060A,0x060A}, {0x060B,0x060B,0x060B}, /* 060A */ + {0x060C,0x060C,0x060C}, {0x060D,0x060D,0x060D}, /* 060C */ + {0x060E,0x060E,0x060E}, {0x060F,0x060F,0x060F}, /* 060E */ + {0x0610,0x0610,0x0610}, {0x0611,0x0611,0x0611}, /* 0610 */ + {0x0612,0x0612,0x0612}, {0x0613,0x0613,0x0613}, /* 0612 */ + {0x0614,0x0614,0x0614}, {0x0615,0x0615,0x0615}, /* 0614 */ + {0x0616,0x0616,0x0616}, {0x0617,0x0617,0x0617}, /* 0616 */ + {0x0618,0x0618,0x0618}, {0x0619,0x0619,0x0619}, /* 0618 */ + {0x061A,0x061A,0x061A}, {0x061B,0x061B,0x061B}, /* 061A */ + {0x061C,0x061C,0x061C}, {0x061D,0x061D,0x061D}, /* 061C */ + {0x061E,0x061E,0x061E}, {0x061F,0x061F,0x061F}, /* 061E */ + {0x0620,0x0620,0x0620}, {0x0621,0x0621,0x0621}, /* 0620 */ + {0x0622,0x0622,0x0622}, {0x0623,0x0623,0x0623}, /* 0622 */ + {0x0624,0x0624,0x0624}, {0x0625,0x0625,0x0625}, /* 0624 */ + {0x0626,0x0626,0x0626}, {0x0627,0x0627,0x0627}, /* 0626 */ + {0x0628,0x0628,0x0628}, {0x0629,0x0629,0x0629}, /* 0628 */ + {0x062A,0x062A,0x062A}, {0x062B,0x062B,0x062B}, /* 062A */ + {0x062C,0x062C,0x062C}, {0x062D,0x062D,0x062D}, /* 062C */ + {0x062E,0x062E,0x062E}, {0x062F,0x062F,0x062F}, /* 062E */ + {0x0630,0x0630,0x0630}, {0x0631,0x0631,0x0631}, /* 0630 */ + {0x0632,0x0632,0x0632}, {0x0633,0x0633,0x0633}, /* 0632 */ + {0x0634,0x0634,0x0634}, {0x0635,0x0635,0x0635}, /* 0634 */ + {0x0636,0x0636,0x0636}, {0x0637,0x0637,0x0637}, /* 0636 */ + {0x0638,0x0638,0x0638}, {0x0639,0x0639,0x0639}, /* 0638 */ + {0x063A,0x063A,0x063A}, {0x063B,0x063B,0x063B}, /* 063A */ + {0x063C,0x063C,0x063C}, {0x063D,0x063D,0x063D}, /* 063C */ + {0x063E,0x063E,0x063E}, {0x063F,0x063F,0x063F}, /* 063E */ + {0x0640,0x0640,0x0640}, {0x0641,0x0641,0x0641}, /* 0640 */ + {0x0642,0x0642,0x0642}, {0x0643,0x0643,0x0643}, /* 0642 */ + {0x0644,0x0644,0x0644}, {0x0645,0x0645,0x0645}, /* 0644 */ + {0x0646,0x0646,0x0646}, {0x0647,0x0647,0x0647}, /* 0646 */ + {0x0648,0x0648,0x0648}, {0x0649,0x0649,0x0649}, /* 0648 */ + {0x064A,0x064A,0x064A}, {0x064B,0x064B,0x064B}, /* 064A */ + {0x064C,0x064C,0x064C}, {0x064D,0x064D,0x064D}, /* 064C */ + {0x064E,0x064E,0x064E}, {0x064F,0x064F,0x064F}, /* 064E */ + {0x0650,0x0650,0x0650}, {0x0651,0x0651,0x0651}, /* 0650 */ + {0x0652,0x0652,0x0652}, {0x0653,0x0653,0x0653}, /* 0652 */ + {0x0654,0x0654,0x0654}, {0x0655,0x0655,0x0655}, /* 0654 */ + {0x0656,0x0656,0x0656}, {0x0657,0x0657,0x0657}, /* 0656 */ + {0x0658,0x0658,0x0658}, {0x0659,0x0659,0x0659}, /* 0658 */ + {0x065A,0x065A,0x065A}, {0x065B,0x065B,0x065B}, /* 065A */ + {0x065C,0x065C,0x065C}, {0x065D,0x065D,0x065D}, /* 065C */ + {0x065E,0x065E,0x065E}, {0x065F,0x065F,0x065F}, /* 065E */ + {0x0660,0x0660,0x0660}, {0x0661,0x0661,0x0661}, /* 0660 */ + {0x0662,0x0662,0x0662}, {0x0663,0x0663,0x0663}, /* 0662 */ + {0x0664,0x0664,0x0664}, {0x0665,0x0665,0x0665}, /* 0664 */ + {0x0666,0x0666,0x0666}, {0x0667,0x0667,0x0667}, /* 0666 */ + {0x0668,0x0668,0x0668}, {0x0669,0x0669,0x0669}, /* 0668 */ + {0x066A,0x066A,0x066A}, {0x066B,0x066B,0x066B}, /* 066A */ + {0x066C,0x066C,0x066C}, {0x066D,0x066D,0x066D}, /* 066C */ + {0x066E,0x066E,0x066E}, {0x066F,0x066F,0x066F}, /* 066E */ + {0x0670,0x0670,0x0670}, {0x0671,0x0671,0x0671}, /* 0670 */ + {0x0672,0x0672,0x0672}, {0x0673,0x0673,0x0673}, /* 0672 */ + {0x0674,0x0674,0x0674}, {0x0675,0x0675,0x0675}, /* 0674 */ + {0x0676,0x0676,0x0676}, {0x0677,0x0677,0x0677}, /* 0676 */ + {0x0678,0x0678,0x0678}, {0x0679,0x0679,0x0679}, /* 0678 */ + {0x067A,0x067A,0x067A}, {0x067B,0x067B,0x067B}, /* 067A */ + {0x067C,0x067C,0x067C}, {0x067D,0x067D,0x067D}, /* 067C */ + {0x067E,0x067E,0x067E}, {0x067F,0x067F,0x067F}, /* 067E */ + {0x0680,0x0680,0x0680}, {0x0681,0x0681,0x0681}, /* 0680 */ + {0x0682,0x0682,0x0682}, {0x0683,0x0683,0x0683}, /* 0682 */ + {0x0684,0x0684,0x0684}, {0x0685,0x0685,0x0685}, /* 0684 */ + {0x0686,0x0686,0x0686}, {0x0687,0x0687,0x0687}, /* 0686 */ + {0x0688,0x0688,0x0688}, {0x0689,0x0689,0x0689}, /* 0688 */ + {0x068A,0x068A,0x068A}, {0x068B,0x068B,0x068B}, /* 068A */ + {0x068C,0x068C,0x068C}, {0x068D,0x068D,0x068D}, /* 068C */ + {0x068E,0x068E,0x068E}, {0x068F,0x068F,0x068F}, /* 068E */ + {0x0690,0x0690,0x0690}, {0x0691,0x0691,0x0691}, /* 0690 */ + {0x0692,0x0692,0x0692}, {0x0693,0x0693,0x0693}, /* 0692 */ + {0x0694,0x0694,0x0694}, {0x0695,0x0695,0x0695}, /* 0694 */ + {0x0696,0x0696,0x0696}, {0x0697,0x0697,0x0697}, /* 0696 */ + {0x0698,0x0698,0x0698}, {0x0699,0x0699,0x0699}, /* 0698 */ + {0x069A,0x069A,0x069A}, {0x069B,0x069B,0x069B}, /* 069A */ + {0x069C,0x069C,0x069C}, {0x069D,0x069D,0x069D}, /* 069C */ + {0x069E,0x069E,0x069E}, {0x069F,0x069F,0x069F}, /* 069E */ + {0x06A0,0x06A0,0x06A0}, {0x06A1,0x06A1,0x06A1}, /* 06A0 */ + {0x06A2,0x06A2,0x06A2}, {0x06A3,0x06A3,0x06A3}, /* 06A2 */ + {0x06A4,0x06A4,0x06A4}, {0x06A5,0x06A5,0x06A5}, /* 06A4 */ + {0x06A6,0x06A6,0x06A6}, {0x06A7,0x06A7,0x06A7}, /* 06A6 */ + {0x06A8,0x06A8,0x06A8}, {0x06A9,0x06A9,0x06A9}, /* 06A8 */ + {0x06AA,0x06AA,0x06AA}, {0x06AB,0x06AB,0x06AB}, /* 06AA */ + {0x06AC,0x06AC,0x06AC}, {0x06AD,0x06AD,0x06AD}, /* 06AC */ + {0x06AE,0x06AE,0x06AE}, {0x06AF,0x06AF,0x06AF}, /* 06AE */ + {0x06B0,0x06B0,0x06B0}, {0x06B1,0x06B1,0x06B1}, /* 06B0 */ + {0x06B2,0x06B2,0x06B2}, {0x06B3,0x06B3,0x06B3}, /* 06B2 */ + {0x06B4,0x06B4,0x06B4}, {0x06B5,0x06B5,0x06B5}, /* 06B4 */ + {0x06B6,0x06B6,0x06B6}, {0x06B7,0x06B7,0x06B7}, /* 06B6 */ + {0x06B8,0x06B8,0x06B8}, {0x06B9,0x06B9,0x06B9}, /* 06B8 */ + {0x06BA,0x06BA,0x06BA}, {0x06BB,0x06BB,0x06BB}, /* 06BA */ + {0x06BC,0x06BC,0x06BC}, {0x06BD,0x06BD,0x06BD}, /* 06BC */ + {0x06BE,0x06BE,0x06BE}, {0x06BF,0x06BF,0x06BF}, /* 06BE */ + {0x06C0,0x06C0,0x06C0}, {0x06C1,0x06C1,0x06C1}, /* 06C0 */ + {0x06C2,0x06C2,0x06C2}, {0x06C3,0x06C3,0x06C3}, /* 06C2 */ + {0x06C4,0x06C4,0x06C4}, {0x06C5,0x06C5,0x06C5}, /* 06C4 */ + {0x06C6,0x06C6,0x06C6}, {0x06C7,0x06C7,0x06C7}, /* 06C6 */ + {0x06C8,0x06C8,0x06C8}, {0x06C9,0x06C9,0x06C9}, /* 06C8 */ + {0x06CA,0x06CA,0x06CA}, {0x06CB,0x06CB,0x06CB}, /* 06CA */ + {0x06CC,0x06CC,0x06CC}, {0x06CD,0x06CD,0x06CD}, /* 06CC */ + {0x06CE,0x06CE,0x06CE}, {0x06CF,0x06CF,0x06CF}, /* 06CE */ + {0x06D0,0x06D0,0x06D0}, {0x06D1,0x06D1,0x06D1}, /* 06D0 */ + {0x06D2,0x06D2,0x06D2}, {0x06D3,0x06D3,0x06D3}, /* 06D2 */ + {0x06D4,0x06D4,0x06D4}, {0x06D5,0x06D5,0x06D5}, /* 06D4 */ + {0x06D6,0x06D6,0x06D6}, {0x06D7,0x06D7,0x06D7}, /* 06D6 */ + {0x06D8,0x06D8,0x06D8}, {0x06D9,0x06D9,0x06D9}, /* 06D8 */ + {0x06DA,0x06DA,0x06DA}, {0x06DB,0x06DB,0x06DB}, /* 06DA */ + {0x06DC,0x06DC,0x06DC}, {0x06DD,0x06DD,0x06DD}, /* 06DC */ + {0x06DE,0x06DE,0x06DE}, {0x06DF,0x06DF,0x06DF}, /* 06DE */ + {0x06E0,0x06E0,0x06E0}, {0x06E1,0x06E1,0x06E1}, /* 06E0 */ + {0x06E2,0x06E2,0x06E2}, {0x06E3,0x06E3,0x06E3}, /* 06E2 */ + {0x06E4,0x06E4,0x06E4}, {0x06E5,0x06E5,0x06E5}, /* 06E4 */ + {0x06E6,0x06E6,0x06E6}, {0x06E7,0x06E7,0x06E7}, /* 06E6 */ + {0x06E8,0x06E8,0x06E8}, {0x06E9,0x06E9,0x06E9}, /* 06E8 */ + {0x06EA,0x06EA,0x06EA}, {0x06EB,0x06EB,0x06EB}, /* 06EA */ + {0x06EC,0x06EC,0x06EC}, {0x06ED,0x06ED,0x06ED}, /* 06EC */ + {0x06EE,0x06EE,0x06EE}, {0x06EF,0x06EF,0x06EF}, /* 06EE */ + {0x06F0,0x06F0,0x06F0}, {0x06F1,0x06F1,0x06F1}, /* 06F0 */ + {0x06F2,0x06F2,0x06F2}, {0x06F3,0x06F3,0x06F3}, /* 06F2 */ + {0x06F4,0x06F4,0x06F4}, {0x06F5,0x06F5,0x06F5}, /* 06F4 */ + {0x06F6,0x06F6,0x06F6}, {0x06F7,0x06F7,0x06F7}, /* 06F6 */ + {0x06F8,0x06F8,0x06F8}, {0x06F9,0x06F9,0x06F9}, /* 06F8 */ + {0x06FA,0x06FA,0x06FA}, {0x06FB,0x06FB,0x06FB}, /* 06FA */ + {0x06FC,0x06FC,0x06FC}, {0x06FD,0x06FD,0x06FD}, /* 06FC */ + {0x06FE,0x06FE,0x06FE}, {0x06FF,0x06FF,0x06FF} /* 06FE */ +}; + +static MY_UNICASE_CHARACTER plane07[]={ /* This page is dummy */ + {0x0700,0x0700,0x0700}, {0x0701,0x0701,0x0701}, /* 0700 */ + {0x0702,0x0702,0x0702}, {0x0703,0x0703,0x0703}, /* 0702 */ + {0x0704,0x0704,0x0704}, {0x0705,0x0705,0x0705}, /* 0704 */ + {0x0706,0x0706,0x0706}, {0x0707,0x0707,0x0707}, /* 0706 */ + {0x0708,0x0708,0x0708}, {0x0709,0x0709,0x0709}, /* 0708 */ + {0x070A,0x070A,0x070A}, {0x070B,0x070B,0x070B}, /* 070A */ + {0x070C,0x070C,0x070C}, {0x070D,0x070D,0x070D}, /* 070C */ + {0x070E,0x070E,0x070E}, {0x070F,0x070F,0x070F}, /* 070E */ + {0x0710,0x0710,0x0710}, {0x0711,0x0711,0x0711}, /* 0710 */ + {0x0712,0x0712,0x0712}, {0x0713,0x0713,0x0713}, /* 0712 */ + {0x0714,0x0714,0x0714}, {0x0715,0x0715,0x0715}, /* 0714 */ + {0x0716,0x0716,0x0716}, {0x0717,0x0717,0x0717}, /* 0716 */ + {0x0718,0x0718,0x0718}, {0x0719,0x0719,0x0719}, /* 0718 */ + {0x071A,0x071A,0x071A}, {0x071B,0x071B,0x071B}, /* 071A */ + {0x071C,0x071C,0x071C}, {0x071D,0x071D,0x071D}, /* 071C */ + {0x071E,0x071E,0x071E}, {0x071F,0x071F,0x071F}, /* 071E */ + {0x0720,0x0720,0x0720}, {0x0721,0x0721,0x0721}, /* 0720 */ + {0x0722,0x0722,0x0722}, {0x0723,0x0723,0x0723}, /* 0722 */ + {0x0724,0x0724,0x0724}, {0x0725,0x0725,0x0725}, /* 0724 */ + {0x0726,0x0726,0x0726}, {0x0727,0x0727,0x0727}, /* 0726 */ + {0x0728,0x0728,0x0728}, {0x0729,0x0729,0x0729}, /* 0728 */ + {0x072A,0x072A,0x072A}, {0x072B,0x072B,0x072B}, /* 072A */ + {0x072C,0x072C,0x072C}, {0x072D,0x072D,0x072D}, /* 072C */ + {0x072E,0x072E,0x072E}, {0x072F,0x072F,0x072F}, /* 072E */ + {0x0730,0x0730,0x0730}, {0x0731,0x0731,0x0731}, /* 0730 */ + {0x0732,0x0732,0x0732}, {0x0733,0x0733,0x0733}, /* 0732 */ + {0x0734,0x0734,0x0734}, {0x0735,0x0735,0x0735}, /* 0734 */ + {0x0736,0x0736,0x0736}, {0x0737,0x0737,0x0737}, /* 0736 */ + {0x0738,0x0738,0x0738}, {0x0739,0x0739,0x0739}, /* 0738 */ + {0x073A,0x073A,0x073A}, {0x073B,0x073B,0x073B}, /* 073A */ + {0x073C,0x073C,0x073C}, {0x073D,0x073D,0x073D}, /* 073C */ + {0x073E,0x073E,0x073E}, {0x073F,0x073F,0x073F}, /* 073E */ + {0x0740,0x0740,0x0740}, {0x0741,0x0741,0x0741}, /* 0740 */ + {0x0742,0x0742,0x0742}, {0x0743,0x0743,0x0743}, /* 0742 */ + {0x0744,0x0744,0x0744}, {0x0745,0x0745,0x0745}, /* 0744 */ + {0x0746,0x0746,0x0746}, {0x0747,0x0747,0x0747}, /* 0746 */ + {0x0748,0x0748,0x0748}, {0x0749,0x0749,0x0749}, /* 0748 */ + {0x074A,0x074A,0x074A}, {0x074B,0x074B,0x074B}, /* 074A */ + {0x074C,0x074C,0x074C}, {0x074D,0x074D,0x074D}, /* 074C */ + {0x074E,0x074E,0x074E}, {0x074F,0x074F,0x074F}, /* 074E */ + {0x0750,0x0750,0x0750}, {0x0751,0x0751,0x0751}, /* 0750 */ + {0x0752,0x0752,0x0752}, {0x0753,0x0753,0x0753}, /* 0752 */ + {0x0754,0x0754,0x0754}, {0x0755,0x0755,0x0755}, /* 0754 */ + {0x0756,0x0756,0x0756}, {0x0757,0x0757,0x0757}, /* 0756 */ + {0x0758,0x0758,0x0758}, {0x0759,0x0759,0x0759}, /* 0758 */ + {0x075A,0x075A,0x075A}, {0x075B,0x075B,0x075B}, /* 075A */ + {0x075C,0x075C,0x075C}, {0x075D,0x075D,0x075D}, /* 075C */ + {0x075E,0x075E,0x075E}, {0x075F,0x075F,0x075F}, /* 075E */ + {0x0760,0x0760,0x0760}, {0x0761,0x0761,0x0761}, /* 0760 */ + {0x0762,0x0762,0x0762}, {0x0763,0x0763,0x0763}, /* 0762 */ + {0x0764,0x0764,0x0764}, {0x0765,0x0765,0x0765}, /* 0764 */ + {0x0766,0x0766,0x0766}, {0x0767,0x0767,0x0767}, /* 0766 */ + {0x0768,0x0768,0x0768}, {0x0769,0x0769,0x0769}, /* 0768 */ + {0x076A,0x076A,0x076A}, {0x076B,0x076B,0x076B}, /* 076A */ + {0x076C,0x076C,0x076C}, {0x076D,0x076D,0x076D}, /* 076C */ + {0x076E,0x076E,0x076E}, {0x076F,0x076F,0x076F}, /* 076E */ + {0x0770,0x0770,0x0770}, {0x0771,0x0771,0x0771}, /* 0770 */ + {0x0772,0x0772,0x0772}, {0x0773,0x0773,0x0773}, /* 0772 */ + {0x0774,0x0774,0x0774}, {0x0775,0x0775,0x0775}, /* 0774 */ + {0x0776,0x0776,0x0776}, {0x0777,0x0777,0x0777}, /* 0776 */ + {0x0778,0x0778,0x0778}, {0x0779,0x0779,0x0779}, /* 0778 */ + {0x077A,0x077A,0x077A}, {0x077B,0x077B,0x077B}, /* 077A */ + {0x077C,0x077C,0x077C}, {0x077D,0x077D,0x077D}, /* 077C */ + {0x077E,0x077E,0x077E}, {0x077F,0x077F,0x077F}, /* 077E */ + {0x0780,0x0780,0x0780}, {0x0781,0x0781,0x0781}, /* 0780 */ + {0x0782,0x0782,0x0782}, {0x0783,0x0783,0x0783}, /* 0782 */ + {0x0784,0x0784,0x0784}, {0x0785,0x0785,0x0785}, /* 0784 */ + {0x0786,0x0786,0x0786}, {0x0787,0x0787,0x0787}, /* 0786 */ + {0x0788,0x0788,0x0788}, {0x0789,0x0789,0x0789}, /* 0788 */ + {0x078A,0x078A,0x078A}, {0x078B,0x078B,0x078B}, /* 078A */ + {0x078C,0x078C,0x078C}, {0x078D,0x078D,0x078D}, /* 078C */ + {0x078E,0x078E,0x078E}, {0x078F,0x078F,0x078F}, /* 078E */ + {0x0790,0x0790,0x0790}, {0x0791,0x0791,0x0791}, /* 0790 */ + {0x0792,0x0792,0x0792}, {0x0793,0x0793,0x0793}, /* 0792 */ + {0x0794,0x0794,0x0794}, {0x0795,0x0795,0x0795}, /* 0794 */ + {0x0796,0x0796,0x0796}, {0x0797,0x0797,0x0797}, /* 0796 */ + {0x0798,0x0798,0x0798}, {0x0799,0x0799,0x0799}, /* 0798 */ + {0x079A,0x079A,0x079A}, {0x079B,0x079B,0x079B}, /* 079A */ + {0x079C,0x079C,0x079C}, {0x079D,0x079D,0x079D}, /* 079C */ + {0x079E,0x079E,0x079E}, {0x079F,0x079F,0x079F}, /* 079E */ + {0x07A0,0x07A0,0x07A0}, {0x07A1,0x07A1,0x07A1}, /* 07A0 */ + {0x07A2,0x07A2,0x07A2}, {0x07A3,0x07A3,0x07A3}, /* 07A2 */ + {0x07A4,0x07A4,0x07A4}, {0x07A5,0x07A5,0x07A5}, /* 07A4 */ + {0x07A6,0x07A6,0x07A6}, {0x07A7,0x07A7,0x07A7}, /* 07A6 */ + {0x07A8,0x07A8,0x07A8}, {0x07A9,0x07A9,0x07A9}, /* 07A8 */ + {0x07AA,0x07AA,0x07AA}, {0x07AB,0x07AB,0x07AB}, /* 07AA */ + {0x07AC,0x07AC,0x07AC}, {0x07AD,0x07AD,0x07AD}, /* 07AC */ + {0x07AE,0x07AE,0x07AE}, {0x07AF,0x07AF,0x07AF}, /* 07AE */ + {0x07B0,0x07B0,0x07B0}, {0x07B1,0x07B1,0x07B1}, /* 07B0 */ + {0x07B2,0x07B2,0x07B2}, {0x07B3,0x07B3,0x07B3}, /* 07B2 */ + {0x07B4,0x07B4,0x07B4}, {0x07B5,0x07B5,0x07B5}, /* 07B4 */ + {0x07B6,0x07B6,0x07B6}, {0x07B7,0x07B7,0x07B7}, /* 07B6 */ + {0x07B8,0x07B8,0x07B8}, {0x07B9,0x07B9,0x07B9}, /* 07B8 */ + {0x07BA,0x07BA,0x07BA}, {0x07BB,0x07BB,0x07BB}, /* 07BA */ + {0x07BC,0x07BC,0x07BC}, {0x07BD,0x07BD,0x07BD}, /* 07BC */ + {0x07BE,0x07BE,0x07BE}, {0x07BF,0x07BF,0x07BF}, /* 07BE */ + {0x07C0,0x07C0,0x07C0}, {0x07C1,0x07C1,0x07C1}, /* 07C0 */ + {0x07C2,0x07C2,0x07C2}, {0x07C3,0x07C3,0x07C3}, /* 07C2 */ + {0x07C4,0x07C4,0x07C4}, {0x07C5,0x07C5,0x07C5}, /* 07C4 */ + {0x07C6,0x07C6,0x07C6}, {0x07C7,0x07C7,0x07C7}, /* 07C6 */ + {0x07C8,0x07C8,0x07C8}, {0x07C9,0x07C9,0x07C9}, /* 07C8 */ + {0x07CA,0x07CA,0x07CA}, {0x07CB,0x07CB,0x07CB}, /* 07CA */ + {0x07CC,0x07CC,0x07CC}, {0x07CD,0x07CD,0x07CD}, /* 07CC */ + {0x07CE,0x07CE,0x07CE}, {0x07CF,0x07CF,0x07CF}, /* 07CE */ + {0x07D0,0x07D0,0x07D0}, {0x07D1,0x07D1,0x07D1}, /* 07D0 */ + {0x07D2,0x07D2,0x07D2}, {0x07D3,0x07D3,0x07D3}, /* 07D2 */ + {0x07D4,0x07D4,0x07D4}, {0x07D5,0x07D5,0x07D5}, /* 07D4 */ + {0x07D6,0x07D6,0x07D6}, {0x07D7,0x07D7,0x07D7}, /* 07D6 */ + {0x07D8,0x07D8,0x07D8}, {0x07D9,0x07D9,0x07D9}, /* 07D8 */ + {0x07DA,0x07DA,0x07DA}, {0x07DB,0x07DB,0x07DB}, /* 07DA */ + {0x07DC,0x07DC,0x07DC}, {0x07DD,0x07DD,0x07DD}, /* 07DC */ + {0x07DE,0x07DE,0x07DE}, {0x07DF,0x07DF,0x07DF}, /* 07DE */ + {0x07E0,0x07E0,0x07E0}, {0x07E1,0x07E1,0x07E1}, /* 07E0 */ + {0x07E2,0x07E2,0x07E2}, {0x07E3,0x07E3,0x07E3}, /* 07E2 */ + {0x07E4,0x07E4,0x07E4}, {0x07E5,0x07E5,0x07E5}, /* 07E4 */ + {0x07E6,0x07E6,0x07E6}, {0x07E7,0x07E7,0x07E7}, /* 07E6 */ + {0x07E8,0x07E8,0x07E8}, {0x07E9,0x07E9,0x07E9}, /* 07E8 */ + {0x07EA,0x07EA,0x07EA}, {0x07EB,0x07EB,0x07EB}, /* 07EA */ + {0x07EC,0x07EC,0x07EC}, {0x07ED,0x07ED,0x07ED}, /* 07EC */ + {0x07EE,0x07EE,0x07EE}, {0x07EF,0x07EF,0x07EF}, /* 07EE */ + {0x07F0,0x07F0,0x07F0}, {0x07F1,0x07F1,0x07F1}, /* 07F0 */ + {0x07F2,0x07F2,0x07F2}, {0x07F3,0x07F3,0x07F3}, /* 07F2 */ + {0x07F4,0x07F4,0x07F4}, {0x07F5,0x07F5,0x07F5}, /* 07F4 */ + {0x07F6,0x07F6,0x07F6}, {0x07F7,0x07F7,0x07F7}, /* 07F6 */ + {0x07F8,0x07F8,0x07F8}, {0x07F9,0x07F9,0x07F9}, /* 07F8 */ + {0x07FA,0x07FA,0x07FA}, {0x07FB,0x07FB,0x07FB}, /* 07FA */ + {0x07FC,0x07FC,0x07FC}, {0x07FD,0x07FD,0x07FD}, /* 07FC */ + {0x07FE,0x07FE,0x07FE}, {0x07FF,0x07FF,0x07FF} /* 07FE */ +}; + static MY_UNICASE_CHARACTER plane1E[]={ {0x1E00,0x1E01,0x0041}, {0x1E00,0x1E01,0x0041}, {0x1E02,0x1E03,0x0042}, {0x1E02,0x1E03,0x0042}, @@ -1695,7 +1957,7 @@ static MY_UNICASE_CHARACTER planeFF[]={ MY_UNICASE_CHARACTER *my_unicase_default_pages[256]= { my_unicase_default_page00, - plane01, plane02, plane03, plane04, plane05, NULL, NULL, + plane01, plane02, plane03, plane04, plane05, plane06, plane07, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, plane1E, plane1F, @@ -1742,7 +2004,7 @@ MY_UNICASE_INFO my_unicase_default= */ MY_UNICASE_CHARACTER *my_unicase_pages_mysql500[256]={ plane00_mysql500, - plane01, plane02, plane03, plane04, plane05, NULL, NULL, + plane01, plane02, plane03, plane04, plane05, plane06, plane07, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, plane1E, plane1F, @@ -1929,7 +2191,7 @@ static MY_UNICASE_CHARACTER turk00[]= static MY_UNICASE_CHARACTER *my_unicase_pages_turkish[256]= { - turk00, plane01, plane02, plane03, plane04, plane05, NULL, NULL, + turk00, plane01, plane02, plane03, plane04, plane05, plane06, plane07, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, plane1E, plane1F, @@ -4333,7 +4595,7 @@ static MY_UNICASE_CHARACTER u520p104[]={ MY_UNICASE_CHARACTER *my_unicase_pages_unicode520[4352]= { - u520p00, u520p01, u520p02, u520p03, u520p04, u520p05, NULL, NULL, + u520p00, u520p01, u520p02, u520p03, u520p04, u520p05, plane06, plane06, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, u520p10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, u520p1D, u520p1E, u520p1F, @@ -5231,7 +5493,17 @@ static inline int my_weight_mb2_utf8mb3_general_ci(uchar b0, uchar b1) { my_wc_t wc= UTF8MB2_CODE(b0, b1); MY_UNICASE_CHARACTER *page= my_unicase_default_pages[wc >> 8]; - return (int) (page ? page[wc & 0xFF].sort : wc); + /* + 2-byte utf8 sequences encode Unicode characters up to U+07FF. + my_unicase_default_pages[N] has non-NULL page pointers + for all N in the range [0..7]. + - my_unicase_default_pages[0..5] point to real translation data + - my_unicase_default_pages[6..7] point to dummy pages + (without real translation). + By adding these dummy pages we can avoid testing 'page' against NULL. + This gives up to 20% performance improvement. + */ + return (int) page[wc & 0xFF].sort; } @@ -5255,6 +5527,7 @@ static inline int my_weight_mb3_utf8mb3_general_ci(uchar b0, uchar b1, uchar b2) #define WEIGHT_MB1(x) my_weight_mb1_utf8mb3_general_ci(x) #define WEIGHT_MB2(x,y) my_weight_mb2_utf8mb3_general_ci(x,y) #define WEIGHT_MB3(x,y,z) my_weight_mb3_utf8mb3_general_ci(x,y,z) +#define STRCOLL_MB7_TOUPPER #include "strcoll.ic" @@ -5264,6 +5537,7 @@ static inline int my_weight_mb3_utf8mb3_general_ci(uchar b0, uchar b1, uchar b2) #define WEIGHT_MB1(x) my_weight_mb1_utf8mb3_general_ci(x) #define WEIGHT_MB2(x,y) my_weight_mb2_utf8mb3_general_ci(x,y) #define WEIGHT_MB3(x,y,z) my_weight_mb3_utf8mb3_general_ci(x,y,z) +#define STRCOLL_MB7_TOUPPER #include "strcoll.ic" @@ -5277,7 +5551,11 @@ static inline int my_weight_mb2_utf8mb3_general_mysql500_ci(uchar b0, uchar b1) { my_wc_t wc= UTF8MB2_CODE(b0, b1); MY_UNICASE_CHARACTER *page= my_unicase_pages_mysql500[wc >> 8]; - return (int) (page ? page[wc & 0xFF].sort : wc); + /* + `page` should never be NULL for 2-byte utf8 characters. + See comments in my_weight_mb2_utf8mb3_general_ci(). + */ + return (int) page[wc & 0xFF].sort; } @@ -5301,6 +5579,7 @@ my_weight_mb3_utf8mb3_general_mysql500_ci(uchar b0, uchar b1, uchar b2) #define WEIGHT_MB1(x) my_weight_mb1_utf8mb3_general_mysql500_ci(x) #define WEIGHT_MB2(x,y) my_weight_mb2_utf8mb3_general_mysql500_ci(x,y) #define WEIGHT_MB3(x,y,z) my_weight_mb3_utf8mb3_general_mysql500_ci(x,y,z) +#define STRCOLL_MB7_TOUPPER #include "strcoll.ic" @@ -5312,6 +5591,7 @@ my_weight_mb3_utf8mb3_general_mysql500_ci(uchar b0, uchar b1, uchar b2) #define WEIGHT_MB1(x) ((int) (uchar) (x)) #define WEIGHT_MB2(x,y) ((int) UTF8MB2_CODE(x,y)) #define WEIGHT_MB3(x,y,z) ((int) UTF8MB3_CODE(x,y,z)) +#define STRCOLL_MB7_BIN #include "strcoll.ic" @@ -5321,6 +5601,7 @@ my_weight_mb3_utf8mb3_general_mysql500_ci(uchar b0, uchar b1, uchar b2) #define WEIGHT_MB1(x) ((int) (uchar) (x)) #define WEIGHT_MB2(x,y) ((int) UTF8MB2_CODE(x,y)) #define WEIGHT_MB3(x,y,z) ((int) UTF8MB3_CODE(x,y,z)) +#define STRCOLL_MB7_BIN #include "strcoll.ic" /* @@ -7685,6 +7966,7 @@ my_charlen_utf8mb4(CHARSET_INFO *cs __attribute__((unused)), All non-BMP characters have the same weight. */ #define WEIGHT_MB4(b0,b1,b2,b3) MY_CS_REPLACEMENT_CHARACTER +#define STRCOLL_MB7_TOUPPER #include "strcoll.ic" @@ -7694,6 +7976,7 @@ my_charlen_utf8mb4(CHARSET_INFO *cs __attribute__((unused)), #define WEIGHT_MB2(b0,b1) ((int) UTF8MB2_CODE(b0,b1)) #define WEIGHT_MB3(b0,b1,b2) ((int) UTF8MB3_CODE(b0,b1,b2)) #define WEIGHT_MB4(b0,b1,b2,b3) ((int) UTF8MB4_CODE(b0,b1,b2,b3)) +#define STRCOLL_MB7_BIN #include "strcoll.ic" @@ -7708,6 +7991,7 @@ my_charlen_utf8mb4(CHARSET_INFO *cs __attribute__((unused)), All non-BMP characters have the same weight. */ #define WEIGHT_MB4(b0,b1,b2,b3) MY_CS_REPLACEMENT_CHARACTER +#define STRCOLL_MB7_TOUPPER #include "strcoll.ic" @@ -7718,6 +8002,7 @@ my_charlen_utf8mb4(CHARSET_INFO *cs __attribute__((unused)), #define WEIGHT_MB2(b0,b1) ((int) UTF8MB2_CODE(b0,b1)) #define WEIGHT_MB3(b0,b1,b2) ((int) UTF8MB3_CODE(b0,b1,b2)) #define WEIGHT_MB4(b0,b1,b2,b3) ((int) UTF8MB4_CODE(b0,b1,b2,b3)) +#define STRCOLL_MB7_BIN #include "strcoll.ic" diff --git a/strings/json_lib.c b/strings/json_lib.c index 49f29903ed5..7b895c216b5 100644 --- a/strings/json_lib.c +++ b/strings/json_lib.c @@ -948,7 +948,7 @@ int json_read_value(json_engine_t *j) { int t_next, c_len, res; - j->value_type= JSON_VALUE_UNINITALIZED; + j->value_type= JSON_VALUE_UNINITIALIZED; if (j->state == JST_KEY) { while (json_read_keyname_chr(j) == 0) {} diff --git a/strings/json_normalize.c b/strings/json_normalize.c new file mode 100644 index 00000000000..c83713056d1 --- /dev/null +++ b/strings/json_normalize.c @@ -0,0 +1,852 @@ +/* Copyright (c) 2021 Eric Herman and MariaDB Foundation. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */ + +#include <my_global.h> +#include <json_lib.h> + +#ifndef PSI_JSON +#define PSI_JSON PSI_NOT_INSTRUMENTED +#endif + +#ifndef JSON_MALLOC_FLAGS +#define JSON_MALLOC_FLAGS MYF(MY_THREAD_SPECIFIC|MY_WME) +#endif + +/* +From the EXPIRED DRAFT JSON Canonical Form +https://datatracker.ietf.org/doc/html/draft-staykov-hu-json-canonical-form-00 + +2. JSON canonical form + + The canonical form is defined by the following rules: + * The document MUST be encoded in UTF-8 [UTF-8] + * Non-significant(1) whitespace characters MUST NOT be used + * Non-significant(1) line endings MUST NOT be used + * Entries (set of name/value pairs) in JSON objects MUST be sorted + lexicographically(2) by their names + * Arrays MUST preserve their initial ordering + + (1)As defined in JSON data-interchange format [JSON], JSON objects + consists of multiple "name"/"value" pairs and JSON arrays consists + of multiple "value" fields. Non-significant means not part of + "name" or "value". + + + (2)Lexicographic comparison, which orders strings from least to + greatest alphabetically based on the UCS (Unicode Character Set) + codepoint values. +*/ + + +struct json_norm_array { + DYNAMIC_ARRAY values; +}; + + +struct json_norm_object { + DYNAMIC_ARRAY kv_pairs; +}; + + +struct json_norm_value { + enum json_value_types type; + union { + DYNAMIC_STRING number; + LEX_STRING string; + struct json_norm_array array; + struct json_norm_object object; + } value; +}; + + +struct json_norm_kv { + LEX_STRING key; + struct json_norm_value value; +}; + + +static void * +json_norm_malloc(size_t size) +{ + return my_malloc(PSI_JSON, size, JSON_MALLOC_FLAGS); +} + + +int +json_norm_string_init(LEX_STRING *string, const char *str, size_t len) +{ + string->length= len + 1; + string->str= json_norm_malloc(string->length); + if (!string->str) + { + string->length= 0; + return 1; + } + strncpy(string->str, str, len); + string->str[len]= 0; + return 0; +} + + +void +json_norm_string_free(LEX_STRING *string) +{ + my_free(string->str); + string->str= NULL; + string->length= 0; +} + + +void +json_norm_number_free(DYNAMIC_STRING *number) +{ + dynstr_free(number); + number->length= 0; +} + + +int +json_normalize_number(DYNAMIC_STRING *out, const char *str, size_t str_len) +{ + int err= 0; + long int magnitude= 0; + int negative= 0; + size_t i= 0; + size_t j= 0; + size_t k= 0; + char *buf= NULL; + size_t buf_size = str_len + 1; + + buf= json_norm_malloc(buf_size); + if (!buf) + return 1; + + memset(buf, 0x00, buf_size); + + if (str[0] == '-') + { + negative= 1; + ++i; + } + + /* grab digits preceding the decimal */ + for (; i < str_len && str[i] != '.' && str[i] != 'e' && str[i] != 'E'; ++i) + buf[j++] = str[i]; + + magnitude = (long)(j - 1); + + /* skip the . */ + if (str[i] == '.') + ++i; + + /* grab rest of digits before the E */ + for (; i < str_len && str[i] != 'e' && str[i] != 'E'; ++i) + buf[j++] = str[i]; + + /* trim trailing zeros */ + for (k = j - 1; k && buf[k] == '0'; --k, --j) + buf[k] = '\0'; + + /* trim the leading zeros */ + for (k = 0; buf[k] && buf[k] == '0'; ++k); + if (k) + { + memmove(buf, buf + k, j - k); + j = j - k; + buf[j] = '\0'; + magnitude -= (long)k; + } + + if (!j) + { + err= dynstr_append_mem(out, STRING_WITH_LEN("0.0E0")); + my_free(buf); + return err; + } + + if (negative) + err|= dynstr_append_mem(out, STRING_WITH_LEN("-")); + err|= dynstr_append_mem(out, buf, 1); + err|= dynstr_append_mem(out, STRING_WITH_LEN(".")); + if (j == 1) + err|= dynstr_append_mem(out, STRING_WITH_LEN("0")); + else + err|= dynstr_append(out, buf + 1); + + err|= dynstr_append_mem(out, STRING_WITH_LEN("E")); + + if (str[i] == 'e' || str[i] == 'E') + { + char *endptr = NULL; + /* skip the [eE] */ + ++i; + /* combine the exponent with current magnitude */ + magnitude += strtol(str + i, &endptr, 10); + } + snprintf(buf, buf_size, "%ld", magnitude); + err|= dynstr_append(out, buf); + + my_free(buf); + return err ? 1 : 0; +} + + +static int +json_norm_object_append_key_value(struct json_norm_object *obj, + DYNAMIC_STRING *key, + struct json_norm_value *val) +{ + struct json_norm_kv pair; + int err= json_norm_string_init(&pair.key, key->str, key->length); + + if (err) + return 1; + + pair.value= *val; + + err|= insert_dynamic(&obj->kv_pairs, &pair); + if (err) + { + json_norm_string_free(&pair.key); + return 1; + } + + return 0; +} + + +static struct json_norm_kv* +json_norm_object_get_last_element(struct json_norm_object *obj) +{ + struct json_norm_kv *kv; + + DBUG_ASSERT(obj->kv_pairs.elements > 0); + kv= dynamic_element(&obj->kv_pairs, + obj->kv_pairs.elements - 1, + struct json_norm_kv*); + return kv; +} + + +static struct json_norm_value* +json_norm_array_get_last_element(struct json_norm_array *arr) +{ + struct json_norm_value *val; + + DBUG_ASSERT(arr->values.elements > 0); + val= dynamic_element(&arr->values, + arr->values.elements - 1, + struct json_norm_value*); + return val; +} + + +static int +json_norm_array_append_value(struct json_norm_array *arr, + struct json_norm_value *val) +{ + return insert_dynamic(&arr->values, val); +} + + +int +json_norm_init_dynamic_array(size_t element_size, void *where) +{ + const uint init_alloc= 20; + const uint alloc_increment= 20; + return my_init_dynamic_array(PSI_JSON, where, (uint)element_size, + init_alloc, alloc_increment, + JSON_MALLOC_FLAGS); +} + + +int +json_norm_value_object_init(struct json_norm_value *val) +{ + const size_t element_size= sizeof(struct json_norm_kv); + struct json_norm_object *obj= &val->value.object; + + val->type= JSON_VALUE_OBJECT; + + return json_norm_init_dynamic_array(element_size, &obj->kv_pairs); +} + + +int +json_norm_value_array_init(struct json_norm_value *val) +{ + const size_t element_size= sizeof(struct json_norm_value); + struct json_norm_array *array= &val->value.array; + + val->type= JSON_VALUE_ARRAY; + + return json_norm_init_dynamic_array(element_size, &array->values); +} + + +static int +json_norm_value_string_init(struct json_norm_value *val, + const char *str, size_t len) +{ + val->type= JSON_VALUE_STRING; + return json_norm_string_init(&val->value.string, str, len); +} + + +static int +json_norm_kv_comp(const struct json_norm_kv *a, + const struct json_norm_kv *b) +{ + return my_strnncoll(&my_charset_utf8mb4_bin, + (const uchar *)a->key.str, a->key.length, + (const uchar *)b->key.str, b->key.length); +} + + +static void +json_normalize_sort(struct json_norm_value *val) +{ + switch (val->type) { + case JSON_VALUE_OBJECT: + { + size_t i; + DYNAMIC_ARRAY *pairs= &val->value.object.kv_pairs; + for (i= 0; i < pairs->elements; ++i) + { + struct json_norm_kv *kv= dynamic_element(pairs, i, struct json_norm_kv*); + json_normalize_sort(&kv->value); + } + + my_qsort(dynamic_element(pairs, 0, struct json_norm_kv*), + pairs->elements, sizeof(struct json_norm_kv), + (qsort_cmp) json_norm_kv_comp); + break; + } + case JSON_VALUE_ARRAY: + { + /* Arrays in JSON must keep the order. Just recursively sort values. */ + size_t i; + DYNAMIC_ARRAY *values= &val->value.array.values; + for (i= 0; i < values->elements; ++i) + { + struct json_norm_value *value; + value= dynamic_element(values, i, struct json_norm_value*); + json_normalize_sort(value); + } + + break; + } + case JSON_VALUE_UNINITIALIZED: + DBUG_ASSERT(0); + break; + default: /* Nothing to do for other types. */ + break; + } +} + + +static void +json_norm_value_free(struct json_norm_value *val) +{ + size_t i; + switch (val->type) { + case JSON_VALUE_OBJECT: + { + struct json_norm_object *obj= &val->value.object; + + DYNAMIC_ARRAY *pairs_arr= &obj->kv_pairs; + for (i= 0; i < pairs_arr->elements; ++i) + { + struct json_norm_kv *kv; + kv= dynamic_element(pairs_arr, i, struct json_norm_kv *); + json_norm_string_free(&kv->key); + json_norm_value_free(&kv->value); + } + delete_dynamic(pairs_arr); + break; + } + case JSON_VALUE_ARRAY: + { + struct json_norm_array *arr= &val->value.array; + + DYNAMIC_ARRAY *values_arr= &arr->values; + for (i= 0; i < arr->values.elements; ++i) + { + struct json_norm_value *jt_value; + jt_value= dynamic_element(values_arr, i, struct json_norm_value *); + json_norm_value_free(jt_value); + } + delete_dynamic(values_arr); + break; + } + case JSON_VALUE_STRING: + { + json_norm_string_free(&val->value.string); + break; + } + case JSON_VALUE_NUMBER: + json_norm_number_free(&val->value.number); + break; + case JSON_VALUE_NULL: + case JSON_VALUE_TRUE: + case JSON_VALUE_FALSE: + case JSON_VALUE_UNINITIALIZED: + break; + } + val->type= JSON_VALUE_UNINITIALIZED; +} + + +static int +json_norm_to_string(DYNAMIC_STRING *buf, struct json_norm_value *val) +{ + switch (val->type) + { + case JSON_VALUE_OBJECT: + { + size_t i; + struct json_norm_object *obj= &val->value.object; + DYNAMIC_ARRAY *pairs_arr= &obj->kv_pairs; + + if (dynstr_append_mem(buf, STRING_WITH_LEN("{"))) + return 1; + + for (i= 0; i < pairs_arr->elements; ++i) + { + struct json_norm_kv *kv; + kv= dynamic_element(pairs_arr, i, struct json_norm_kv *); + + if (dynstr_append_mem(buf, STRING_WITH_LEN("\"")) || + dynstr_append(buf, kv->key.str) || + dynstr_append_mem(buf, STRING_WITH_LEN("\":")) || + json_norm_to_string(buf, &kv->value)) + return 1; + + if (i != (pairs_arr->elements - 1)) + if (dynstr_append_mem(buf, STRING_WITH_LEN(","))) + return 1; + } + if (dynstr_append_mem(buf, STRING_WITH_LEN("}"))) + return 1; + break; + } + case JSON_VALUE_ARRAY: + { + size_t i; + struct json_norm_array *arr= &val->value.array; + DYNAMIC_ARRAY *values_arr= &arr->values; + + if (dynstr_append_mem(buf, STRING_WITH_LEN("["))) + return 1; + for (i= 0; i < values_arr->elements; ++i) + { + struct json_norm_value *jt_value; + jt_value= dynamic_element(values_arr, i, struct json_norm_value *); + + if (json_norm_to_string(buf, jt_value)) + return 1; + if (i != (values_arr->elements - 1)) + if (dynstr_append_mem(buf, STRING_WITH_LEN(","))) + return 1; + } + if (dynstr_append_mem(buf, STRING_WITH_LEN("]"))) + return 1; + break; + } + case JSON_VALUE_STRING: + { + if (dynstr_append(buf, val->value.string.str)) + return 1; + break; + } + case JSON_VALUE_NULL: + { + if (dynstr_append_mem(buf, STRING_WITH_LEN("null"))) + return 1; + break; + } + case JSON_VALUE_TRUE: + { + if (dynstr_append_mem(buf, STRING_WITH_LEN("true"))) + return 1; + break; + } + case JSON_VALUE_FALSE: + { + if (dynstr_append_mem(buf, STRING_WITH_LEN("false"))) + return 1; + break; + } + case JSON_VALUE_NUMBER: + { + if (dynstr_append(buf, val->value.number.str)) + return 1; + break; + } + case JSON_VALUE_UNINITIALIZED: + { + DBUG_ASSERT(0); + break; + } + } + return 0; +} + + +static int +json_norm_value_number_init(struct json_norm_value *val, + const char *number, size_t num_len) +{ + int err; + val->type= JSON_VALUE_NUMBER; + err= init_dynamic_string(&val->value.number, NULL, 0, 0); + if (err) + return 1; + err= json_normalize_number(&val->value.number, number, num_len); + if (err) + dynstr_free(&val->value.number); + return err; +} + + +static void +json_norm_value_null_init(struct json_norm_value *val) +{ + val->type= JSON_VALUE_NULL; +} + + +static void +json_norm_value_false_init(struct json_norm_value *val) +{ + val->type= JSON_VALUE_FALSE; +} + + +static void +json_norm_value_true_init(struct json_norm_value *val) +{ + val->type= JSON_VALUE_TRUE; +} + + +static int +json_norm_value_init(struct json_norm_value *val, json_engine_t *je) +{ + int err= 0; + switch (je->value_type) { + case JSON_VALUE_STRING: + { + const char *je_value_begin= (const char *)je->value_begin; + size_t je_value_len= (je->value_end - je->value_begin); + err= json_norm_value_string_init(val, je_value_begin, je_value_len); + break; + } + case JSON_VALUE_NULL: + { + json_norm_value_null_init(val); + break; + } + case JSON_VALUE_TRUE: + { + json_norm_value_true_init(val); + break; + } + case JSON_VALUE_FALSE: + { + json_norm_value_false_init(val); + break; + } + case JSON_VALUE_ARRAY: + { + err= json_norm_value_array_init(val); + break; + } + case JSON_VALUE_OBJECT: + { + err= json_norm_value_object_init(val); + break; + } + case JSON_VALUE_NUMBER: + { + const char *je_number_begin= (const char *)je->value_begin; + size_t je_number_len= (je->value_end - je->value_begin); + err= json_norm_value_number_init(val, je_number_begin, je_number_len); + break; + } + default: + DBUG_ASSERT(0); + return 1; + } + return err; +} + + +static int +json_norm_append_to_array(struct json_norm_value *val, + json_engine_t *je) +{ + int err= 0; + struct json_norm_value tmp; + + DBUG_ASSERT(val->type == JSON_VALUE_ARRAY); + DBUG_ASSERT(je->value_type != JSON_VALUE_UNINITIALIZED); + + err= json_norm_value_init(&tmp, je); + + if (err) + return 1; + + err= json_norm_array_append_value(&val->value.array, &tmp); + + if (err) + json_norm_value_free(&tmp); + + return err; +} + + +static int +json_norm_append_to_object(struct json_norm_value *val, + DYNAMIC_STRING *key, json_engine_t *je) +{ + int err= 0; + struct json_norm_value tmp; + + DBUG_ASSERT(val->type == JSON_VALUE_OBJECT); + DBUG_ASSERT(je->value_type != JSON_VALUE_UNINITIALIZED); + + err= json_norm_value_init(&tmp, je); + + if (err) + return 1; + + err= json_norm_object_append_key_value(&val->value.object, key, &tmp); + + if (err) + json_norm_value_free(&tmp); + + return err; +} + + +static int +json_norm_parse(struct json_norm_value *root, json_engine_t *je) +{ + size_t current; + struct json_norm_value *stack[JSON_DEPTH_LIMIT]; + int err= 0; + DYNAMIC_STRING key; + + err= init_dynamic_string(&key, NULL, 0, 0); + if (err) + goto json_norm_parse_end; + + memset(stack, 0x00, sizeof(stack)); + current= 0; + stack[current]= root; + + do { + switch (je->state) + { + case JST_KEY: + { + const uchar *key_start= je->s.c_str; + const uchar *key_end; + + DBUG_ASSERT(stack[current]->type == JSON_VALUE_OBJECT); + do + { + key_end= je->s.c_str; + } while (json_read_keyname_chr(je) == 0); + + /* we have the key name */ + /* reset the dynstr: */ + dynstr_trunc(&key, key.length); + dynstr_append_mem(&key, (char *)key_start, (key_end - key_start)); + + /* After reading the key, we have a follow-up value. */ + err= json_read_value(je); + if (err) + goto json_norm_parse_end; + + err= json_norm_append_to_object(stack[current], &key, je); + if (err) + goto json_norm_parse_end; + + if (je->value_type == JSON_VALUE_ARRAY || + je->value_type == JSON_VALUE_OBJECT) + { + struct json_norm_kv *kv; + + err= ((current + 1) == JSON_DEPTH_LIMIT); + if (err) + goto json_norm_parse_end; + + kv= json_norm_object_get_last_element(&stack[current]->value.object); + stack[++current]= &kv->value; + } + break; + } + case JST_VALUE: + { + struct json_norm_array *current_arr= &stack[current]->value.array; + err= json_read_value(je); + if (err) + goto json_norm_parse_end; + + DBUG_ASSERT(stack[current]->type == JSON_VALUE_ARRAY); + + err= json_norm_append_to_array(stack[current], je); + if (err) + goto json_norm_parse_end; + + if (je->value_type == JSON_VALUE_ARRAY || + je->value_type == JSON_VALUE_OBJECT) + { + + err= ((current + 1) == JSON_DEPTH_LIMIT); + if (err) + goto json_norm_parse_end; + + stack[++current]= json_norm_array_get_last_element(current_arr); + } + + break; + } + case JST_OBJ_START: + /* parser found an object (the '{' in JSON) */ + break; + case JST_OBJ_END: + /* parser found the end of the object (the '}' in JSON) */ + /* pop stack */ + --current; + break; + case JST_ARRAY_START: + /* parser found an array (the '[' in JSON) */ + break; + case JST_ARRAY_END: + /* parser found the end of the array (the ']' in JSON) */ + /* pop stack */ + --current; + break; + }; + } while (json_scan_next(je) == 0); + +json_norm_parse_end: + dynstr_free(&key); + return err; +} + + +static int +json_norm_build(struct json_norm_value *root, + const char *s, size_t size, CHARSET_INFO *cs) +{ + int err= 0; + json_engine_t je; + + DBUG_ASSERT(s); + memset(&je, 0x00, sizeof(je)); + + memset(root, 0x00, sizeof(struct json_norm_value)); + root->type= JSON_VALUE_UNINITIALIZED; + + err= json_scan_start(&je, cs, (const uchar *)s, (const uchar *)(s + size)); + if (json_read_value(&je)) + return err; + + err= json_norm_value_init(root, &je); + + if (root->type == JSON_VALUE_OBJECT || + root->type == JSON_VALUE_ARRAY) + { + err= json_norm_parse(root, &je); + if (err) + return err; + } + return err; +} + + +int +json_normalize(DYNAMIC_STRING *result, + const char *s, size_t size, CHARSET_INFO *cs) +{ + int err= 0; + uint convert_err= 0; + struct json_norm_value root; + char *s_utf8= NULL; + size_t in_size; + const char *in; + + DBUG_ASSERT(result); + + memset(&root, 0x00, sizeof(root)); + root.type = JSON_VALUE_UNINITIALIZED; + + /* + Convert the incoming string to utf8mb4_bin before doing any other work. + According to JSON RFC 8259, between systems JSON must be UTF-8 + https://datatracker.ietf.org/doc/html/rfc8259#section-8.1 + */ + if (cs == &my_charset_utf8mb4_bin) + { + in= s; + in_size= size; + } + else + { + in_size= (size * my_charset_utf8mb4_bin.mbmaxlen) + 1; + s_utf8= json_norm_malloc(in_size); + if (!s_utf8) + return 1; + memset(s_utf8, 0x00, in_size); + my_convert(s_utf8, (uint32)in_size, &my_charset_utf8mb4_bin, + s, (uint32)size, cs, &convert_err); + if (convert_err) + { + my_free(s_utf8); + return 1; + } + in= s_utf8; + in_size= strlen(s_utf8); + } + + + if (!json_valid(in, in_size, &my_charset_utf8mb4_bin)) + { + err= 1; + goto json_normalize_end; + } + + err= json_norm_build(&root, in, in_size, &my_charset_utf8mb4_bin); + if (err) + goto json_normalize_end; + + json_normalize_sort(&root); + + err= json_norm_to_string(result, &root); + +json_normalize_end: + json_norm_value_free(&root); + if (err) + dynstr_free(result); + if (s_utf8) + my_free(s_utf8); + return err; +} + + diff --git a/strings/strcoll.ic b/strings/strcoll.ic index 6aca0d0c460..bf011245981 100644 --- a/strings/strcoll.ic +++ b/strings/strcoll.ic @@ -16,6 +16,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */ +#include "ctype-ascii.h" + #ifndef MY_FUNCTION_NAME #error MY_FUNCTION_NAME is not defined #endif @@ -40,6 +42,42 @@ /* + For binary collations: + - on 32bit platforms perform only 4 byte optimization + - on 64bit platforms perform both 4 byte and 8 byte optimization +*/ +#if defined(STRCOLL_MB7_BIN) +#define MY_STRCOLL_MB7_4BYTES(a,b) my_strcoll_mb7_bin_4bytes((a),(b)) +#if SIZEOF_VOIDP == 8 +#define STRCOLL_MB7_8BYTES +#define MY_STRCOLL_MB7_8BYTES(a,b) my_strcoll_mb7_bin_8bytes((a),(b)) +#endif /* Architecture test */ +#endif /* STRCOLL_MB7_BIN */ + + +/* + For case insensitive collations with trivial mapping from [a-z] to [A-Z] + perform optimization only on 64 bit platforms. + There is no sense to perform my_ascii_to_upper_magic_uint64() based + optimization on 32bit platforms. The idea of this optimization + is that it handles 8bytes at a time, using 64bit CPU registers. + Enabling this optimization on 32bit platform may only slow things down. +*/ +#if defined(STRCOLL_MB7_TOUPPER) +#if SIZEOF_VOIDP == 8 +#define MY_STRCOLL_MB7_4BYTES(a,b) my_strcoll_ascii_toupper_4bytes((a),(b)) +#define MY_STRCOLL_MB7_8BYTES(a,b) my_strcoll_ascii_toupper_8bytes((a),(b)) +#endif /* Architecture test */ +#endif /* STRCOLL_MB7_TOUPPER */ + + +/* + A helper macro to shift two pointers forward, to the given amount. +*/ +#define MY_STRING_SHIFT_PTR_PTR(a,b,len) do { a+= len; b+= len; } while(0) + + +/* Weight of an illegal byte, must follow these rules: 1. Must be greater than weight of any normal character in the collation. 2. Two different bad bytes must have different weights and must be @@ -182,7 +220,31 @@ MY_FUNCTION_NAME(strnncoll)(CHARSET_INFO *cs __attribute__((unused)), { int a_weight, b_weight, res; uint a_wlen= MY_FUNCTION_NAME(scan_weight)(&a_weight, a, a_end); - uint b_wlen= MY_FUNCTION_NAME(scan_weight)(&b_weight, b, b_end); + uint b_wlen; + +#ifdef MY_STRCOLL_MB7_4BYTES + if (a_wlen == 1 && my_strcoll_ascii_4bytes_found(a, a_end, b, b_end)) + { + int res; +#ifdef MY_STRCOLL_MB7_8BYTES + /*TODO: a a loop here >='a' <='z' here, for automatic vectorization*/ + if (my_strcoll_ascii_4bytes_found(a + 4, a_end, b + 4, b_end)) + { + if ((res= MY_STRCOLL_MB7_8BYTES(a, b))) + return res; + MY_STRING_SHIFT_PTR_PTR(a, b, 8); + continue; + } +#endif + if ((res= MY_STRCOLL_MB7_4BYTES(a, b))) + return res; + MY_STRING_SHIFT_PTR_PTR(a, b, 4); + continue; + } +#endif /* MY_STRCOLL_MB7_4BYTES */ + + b_wlen= MY_FUNCTION_NAME(scan_weight)(&b_weight, b, b_end); + /* a_wlen b_wlen Comment ------ ------ ------- @@ -253,7 +315,30 @@ MY_FUNCTION_NAME(strnncollsp)(CHARSET_INFO *cs __attribute__((unused)), { int a_weight, b_weight, res; uint a_wlen= MY_FUNCTION_NAME(scan_weight)(&a_weight, a, a_end); - uint b_wlen= MY_FUNCTION_NAME(scan_weight)(&b_weight, b, b_end); + uint b_wlen; + +#ifdef MY_STRCOLL_MB7_4BYTES + if (a_wlen == 1 && my_strcoll_ascii_4bytes_found(a, a_end, b, b_end)) + { + int res; +#ifdef MY_STRCOLL_MB7_8BYTES + if (my_strcoll_ascii_4bytes_found(a + 4, a_end, b + 4, b_end)) + { + if ((res= MY_STRCOLL_MB7_8BYTES(a, b))) + return res; + MY_STRING_SHIFT_PTR_PTR(a, b, 8); + continue; + } +#endif + if ((res= MY_STRCOLL_MB7_4BYTES(a, b))) + return res; + MY_STRING_SHIFT_PTR_PTR(a, b, 4); + continue; + } +#endif /* MY_STRCOLL_MB7_4BYTES */ + + b_wlen= MY_FUNCTION_NAME(scan_weight)(&b_weight, b, b_end); + if ((res= (a_weight - b_weight))) { /* @@ -286,7 +371,7 @@ MY_FUNCTION_NAME(strnncollsp)(CHARSET_INFO *cs __attribute__((unused)), DBUG_ASSERT(0); return 0; } -#endif +#endif /* DEFINE_STRNNCOLLSP_NOPAD */ #endif /* DEFINE_STRNNCOLL */ @@ -602,3 +687,8 @@ MY_FUNCTION_NAME(strnxfrm_nopad)(CHARSET_INFO *cs, #undef DEFINE_STRNXFRM_UNICODE_BIN2 #undef DEFINE_STRNNCOLL #undef DEFINE_STRNNCOLLSP_NOPAD + +#undef STRCOLL_MB7_TOUPPER +#undef STRCOLL_MB7_BIN +#undef MY_STRCOLL_MB7_4BYTES +#undef MY_STRCOLL_MB7_8BYTES diff --git a/support-files/rpm/server.cnf b/support-files/rpm/server.cnf index 589a185fb3d..9b384c9c6ee 100644 --- a/support-files/rpm/server.cnf +++ b/support-files/rpm/server.cnf @@ -39,8 +39,8 @@ # you can put MariaDB-only options here [mariadb] -# This group is only read by MariaDB-10.6 servers. +# This group is only read by MariaDB-10.7 servers. # If you use the same .cnf file for MariaDB of different versions, # use this group for options that older servers don't understand -[mariadb-10.6] +[mariadb-10.7] diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 1a0cccf3bce..86485f502ef 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -21524,6 +21524,95 @@ static void test_cache_metadata() mysql_stmt_close(stmt); } +void test_mdev_10075() +{ + MYSQL_STMT *stmt; + int rc; + MYSQL_RES *result; + MYSQL_BIND my_bind[1]; + MYSQL_BIND my_bind2[1]; + + struct st_data { + unsigned long id; + char id_ind; + }; + + struct st_data data[]= { + {0, STMT_INDICATOR_NONE}, + {1, STMT_INDICATOR_NONE}, + {2, STMT_INDICATOR_NONE} + }; + + struct st_data data2[]= { + {3, STMT_INDICATOR_NONE}, + {2, STMT_INDICATOR_NONE}, + {4, STMT_INDICATOR_NONE} + }; + + myheader("test_mdev_10075"); + + rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1"); + myquery(rc); + + rc= mysql_query(mysql, "CREATE TABLE t1(id INT PRIMARY KEY)"); + myquery(rc); + + /* insert by prepare */ + stmt= mysql_simple_prepare(mysql, + "INSERT INTO t1 VALUES(?)"); + check_stmt(stmt); + verify_param_count(stmt, 1); + + /* bzero bind structure */ + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&data[0].id; + + rc= mysql_stmt_bind_param(stmt, my_bind); + check_execute(stmt, rc); + + /* Set array size, row size and bind the parameter */ + mysql_stmt_bind_param(stmt, my_bind); + + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + mysql_stmt_close(stmt); + + stmt= mysql_simple_prepare(mysql, + "INSERT IGNORE INTO t1 VALUES(?)"); + check_stmt(stmt); + verify_param_count(stmt, 1); + + /* bzero bind structure */ + bzero((char*) my_bind2, sizeof(my_bind2)); + my_bind2[0].buffer_type= MYSQL_TYPE_LONG; + my_bind2[0].buffer= (void *)&data2[0].id; + + rc= mysql_stmt_bind_param(stmt, my_bind2); + check_execute(stmt, rc); + + mysql_stmt_bind_param(stmt, my_bind2); + + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + mysql_stmt_close(stmt); + + rc= mysql_query(mysql, "GET DIAGNOSTICS CONDITION 1 @var1 = ROW_NUMBER"); + myquery(rc); + + rc= mysql_query(mysql, "SELECT @var1"); + myquery(rc); + + result= mysql_store_result(mysql); + mytest(result); + + rc= my_process_result_set(result); + DIE_UNLESS(rc == 1); + + mysql_free_result(result); +} static struct my_tests_st my_tests[]= { { "test_mdev_26145", test_mdev_26145 }, @@ -21831,6 +21920,7 @@ static struct my_tests_st my_tests[]= { { "test_mdev20261", test_mdev20261 }, { "test_execute_direct", test_execute_direct }, { "test_cache_metadata", test_cache_metadata}, + { "test_mdev_10075", test_mdev_10075}, { 0, 0 } }; diff --git a/unittest/json_lib/CMakeLists.txt b/unittest/json_lib/CMakeLists.txt index 1b2a89b28cd..157f37291e9 100644 --- a/unittest/json_lib/CMakeLists.txt +++ b/unittest/json_lib/CMakeLists.txt @@ -19,4 +19,4 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/unittest/mytap) # -MY_ADD_TESTS(json_lib LINK_LIBRARIES strings dbug) +MY_ADD_TESTS(json_lib json_normalize LINK_LIBRARIES strings dbug) diff --git a/unittest/json_lib/json_normalize-t.c b/unittest/json_lib/json_normalize-t.c new file mode 100644 index 00000000000..f72e90175e2 --- /dev/null +++ b/unittest/json_lib/json_normalize-t.c @@ -0,0 +1,280 @@ +/* Copyright (c) 2021 Eric Herman and MariaDB Foundation. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +#include "my_config.h" +#include "config.h" +#include <tap.h> +#include <my_global.h> +#include <json_lib.h> + + +static void +check_json_normalize(const char *in, const char *expected) +{ + int err; + DYNAMIC_STRING result; + + CHARSET_INFO *cs= &my_charset_utf8mb4_general_ci; + + init_dynamic_string(&result, NULL, 0, 0); + + err= json_normalize(&result, in, strlen(in), cs); + + ok(err == 0, "normalize err?"); + + ok(strcmp(expected, result.str) == 0, + "expected '%s' from '%s' but was '%s'", + expected, in, result.str); + + dynstr_free(&result); +} + + +static void +test_json_normalize_invalid(void) +{ + DYNAMIC_STRING result; + + CHARSET_INFO *cs= &my_charset_utf8mb4_general_ci; + + init_dynamic_string(&result, NULL, 0, 0); + ok(json_normalize(&result, STRING_WITH_LEN(""), cs) != 0, + "expected normalized error"); + dynstr_free(&result); + + init_dynamic_string(&result, NULL, 0, 0); + ok(json_normalize(&result, STRING_WITH_LEN("["), cs) != 0, + "expected normalized error"); + dynstr_free(&result); + + init_dynamic_string(&result, NULL, 0, 0); + ok(json_normalize(&result, STRING_WITH_LEN("}"), cs) != 0, + "expected normalized error"); + dynstr_free(&result); + + init_dynamic_string(&result, NULL, 0, 0); + ok(json_normalize(&result, NULL, 0, cs) != 0, + "expected normalized error"); + dynstr_free(&result); +} + + +static void +test_json_normalize_single_kv(void) +{ + const char *in= "" + "{\n" + " \"foo\": \"value\"\n" + "}\n"; + + const char *expected= "{\"foo\":\"value\"}"; + check_json_normalize(in, expected); +} + + +static void +test_json_normalize_multi_kv(void) +{ + const char *in= "" + "{\n" + " \"bar\": \"baz\",\n" + " \"foo\": \"value\"\n" + "}\n"; + + const char *expected= "{\"bar\":\"baz\",\"foo\":\"value\"}"; + check_json_normalize(in, expected); +} + + +static void +test_json_normalize_array(void) +{ + const char *in= "[ \"a\", \"b\", true, false, null ]"; + const char *expected= "[\"a\",\"b\",true,false,null]"; + check_json_normalize(in, expected); +} + + +static void +test_json_normalize_values(void) +{ + check_json_normalize("\"foo\"", "\"foo\""); + check_json_normalize("true", "true"); + check_json_normalize("false", "false"); + check_json_normalize("null", "null"); + check_json_normalize("\"\"", "\"\""); + check_json_normalize("{}", "{}"); + check_json_normalize("[]", "[]"); + check_json_normalize("5", "5.0E0"); + check_json_normalize("5.1", "5.1E0"); + check_json_normalize("-5.1", "-5.1E0"); + check_json_normalize("12345.67890", "1.23456789E4"); + check_json_normalize("2.99792458e8", "2.99792458E8"); + check_json_normalize("6.02214076e23", "6.02214076E23"); + check_json_normalize("6.62607015e-34", "6.62607015E-34"); + check_json_normalize("-6.62607015e-34", "-6.62607015E-34"); +} + + +static void +test_json_normalize_nested_objects(void) +{ + const char *in = "" + "{\n" + " \"wiz\": {\n" + "\t\t\"bang\": \"a\",\n\t\t\"alpha\": false\n\t},\n" + " \"foo\": {\"value\":true}\n" + "}"; + + const char *expected= "{\"foo\":{\"value\":true}," + "\"wiz\":{\"alpha\":false,\"bang\":\"a\"}}"; + check_json_normalize(in, expected); +} + + +static void +test_json_normalize_nested_arrays(void) +{ + const char *in = "" + "[\n" + " \"wiz\",\n" + " [\"bang\", \t\t\"alpha\"\t]\n" + "]"; + + const char *expected= "[\"wiz\",[\"bang\",\"alpha\"]]"; + check_json_normalize(in, expected); +} + + +static void +test_json_normalize_nested_deep(void) +{ + const char *in = "" + "{\n" + " \"foo\": \"value\",\n" + " \"wiz\": [true, false, {\n" + "\t\t\"bang\": \"a\",\n\t\t\"alpha\": 12345.67890\n\t},\n \"string\",\n" + "\t{ \"b\": \"one\", \"a\": \"two\", \"c\": \"three\"}, false,\n" + "\t\t[-1.20, \"w\", \"x\"]],\n" + " \"bar\": \"value2\"\n" + "}\n"; + + const char *expected= "" + "{" + "\"bar\":\"value2\"," + "\"foo\":\"value\"," + "\"wiz\":[" + "true,false," + "{\"alpha\":1.23456789E4,\"bang\":\"a\"}," + "\"string\"," + "{\"a\":\"two\",\"b\":\"one\",\"c\":\"three\"}," + "false," + "[-1.2E0,\"w\",\"x\"]" + "]" + "}"; + check_json_normalize(in, expected); +} + + +/* a "friend" function */ +int +json_normalize_number(DYNAMIC_STRING *out, const char *str, size_t str_len); + + +static void +test_json_normalize_non_utf8(void) +{ + int err; + const char utf8[]= { 0x22, 0xC3, 0x8A, 0x22, 0x00 }; + const char latin[] = { 0x22, 0xCA, 0x22, 0x00 }; + DYNAMIC_STRING result; + CHARSET_INFO *cs_utf8= &my_charset_utf8mb4_bin; + CHARSET_INFO *cs_latin= &my_charset_latin1; + + init_dynamic_string(&result, NULL, 0, 0); + err= json_normalize(&result, utf8, strlen(utf8), cs_utf8); + ok(err == 0, "normalize err?"); + ok((strcmp(utf8, result.str) == 0), "utf8 round trip"); + dynstr_free(&result); + + init_dynamic_string(&result, NULL, 0, 0); + err= json_normalize(&result, latin, strlen(latin), cs_latin); + ok(err == 0, "normalize err?"); + ok((strcmp(utf8, result.str) == 0), "latin to utf8 round trip"); + dynstr_free(&result); +} + + +void +check_number_normalize(const char *in, const char *expected) +{ + int err; + DYNAMIC_STRING buf; + + init_dynamic_string(&buf, NULL, 0, 0); + + err= json_normalize_number(&buf, in, strlen(in)); + ok(err == 0, "normalize number err?"); + + ok(strcmp(buf.str, expected) == 0, + "expected: %s\n" + " but was: %s\n" + " from: %s\n", + expected, + buf.str, + in); + + dynstr_free(&buf); +} + + +int +main(void) +{ + plan(88); + diag("Testing json_normalization."); + + check_number_normalize("0", "0.0E0"); + check_number_normalize("-0.0", "0.0E0"); + check_number_normalize("0E100", "0.0E0"); + check_number_normalize("0.000000E100", "0.0E0"); + check_number_normalize("-0E100", "0.0E0"); + check_number_normalize("-0.000E100", "0.0E0"); + check_number_normalize("1", "1.0E0"); + check_number_normalize("-1", "-1.0E0"); + check_number_normalize("36", "3.6E1"); + check_number_normalize("37.000", "3.7E1"); + check_number_normalize("3.000", "3.0E0"); + check_number_normalize("0.00012345", "1.2345E-4"); + check_number_normalize("32.14e234", "3.214E235"); + check_number_normalize("0.00357e-23", "3.57E-26"); + check_number_normalize("0.00357e23", "3.57E20"); + check_number_normalize("123.456e10", "1.23456E12"); + check_number_normalize("123.456e-9", "1.23456E-7"); + check_number_normalize("0000123.456000000e-9", "1.23456E-7"); + check_number_normalize("0000123.456000000e+9", "1.23456E11"); + + test_json_normalize_invalid(); + test_json_normalize_values(); + test_json_normalize_single_kv(); + test_json_normalize_multi_kv(); + test_json_normalize_array(); + test_json_normalize_nested_objects(); + test_json_normalize_nested_arrays(); + test_json_normalize_nested_deep(); + test_json_normalize_non_utf8(); + + return exit_status(); +} diff --git a/unittest/mysys/bitmap-t.c b/unittest/mysys/bitmap-t.c index e8f41b32d2c..22466355191 100644 --- a/unittest/mysys/bitmap-t.c +++ b/unittest/mysys/bitmap-t.c @@ -129,8 +129,8 @@ my_bool test_compare_operators(MY_BITMAP *map, uint bitsize) MY_BITMAP *map2= &map2_obj, *map3= &map3_obj; my_bitmap_map map2buf[MAX_TESTED_BITMAP_SIZE]; my_bitmap_map map3buf[MAX_TESTED_BITMAP_SIZE]; - my_bitmap_init(&map2_obj, map2buf, bitsize, FALSE); - my_bitmap_init(&map3_obj, map3buf, bitsize, FALSE); + my_bitmap_init(&map2_obj, map2buf, bitsize); + my_bitmap_init(&map3_obj, map3buf, bitsize); bitmap_clear_all(map2); bitmap_clear_all(map3); for (i=0; i < no_loops; i++) @@ -374,7 +374,7 @@ my_bool test_compare(MY_BITMAP *map, uint bitsize) uint32 map2buf[MAX_TESTED_BITMAP_SIZE]; uint i, test_bit; uint no_loops= bitsize > 128 ? 128 : bitsize; - if (my_bitmap_init(&map2, map2buf, bitsize, FALSE)) + if (my_bitmap_init(&map2, map2buf, bitsize)) { diag("init error for bitsize %d", bitsize); return TRUE; @@ -433,7 +433,7 @@ my_bool test_intersect(MY_BITMAP *map, uint bitsize) MY_BITMAP map2; uint32 map2buf[MAX_TESTED_BITMAP_SIZE]; uint i, test_bit1, test_bit2, test_bit3; - if (my_bitmap_init(&map2, map2buf, bitsize2, FALSE)) + if (my_bitmap_init(&map2, map2buf, bitsize2)) { diag("init error for bitsize %d", bitsize2); return TRUE; @@ -481,7 +481,7 @@ my_bool do_test(uint bitsize) { MY_BITMAP map; my_bitmap_map buf[MAX_TESTED_BITMAP_SIZE]; - if (my_bitmap_init(&map, buf, bitsize, FALSE)) + if (my_bitmap_init(&map, buf, bitsize)) { diag("init error for bitsize %d", bitsize); goto error; |