diff options
910 files changed, 20137 insertions, 6206 deletions
diff --git a/.gitattributes b/.gitattributes index a7be37ae370..1df7067002c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -30,7 +30,7 @@ pcre/testdata/greppatN4 -text *.c diff=cpp *.h diff=cpp *.cc diff=cpp -*.ic diff=cpp +*.inl diff=cpp *.cpp diff=cpp *.java diff=cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c045360631..d07c25349af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -419,6 +419,10 @@ IF(WITH_UNIT_TESTS) ENDIF() ENDIF() +INCLUDE(cpack_tgz) +INCLUDE(cpack_rpm) +INCLUDE(cpack_deb) + UNSET (MYSQLD_STATIC_PLUGIN_LIBS CACHE) INCLUDE(mariadb_connector_c) # this does ADD_SUBDIRECTORY(libmariadb) diff --git a/appveyor.yml b/appveyor.yml index 85da7612931..da6caa3431e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,15 +1,5 @@ -init: - # Install bison - - choco feature disable --name showDownloadProgress - - choco install -y winflexbison - - C:\ProgramData\chocolatey\lib\winflexbison\tools\win_bison.exe --version - version: build-{build}~branch-{branch} -cache: - - C:\ProgramData\chocolatey\bin -> appveyor.yml - - C:\ProgramData\chocolatey\lib -> appveyor.yml - clone_depth: 1 build_script: @@ -26,8 +16,8 @@ build_script: - cd _build - set BUILD_TYPE=MinSizeRel - set GENERATOR=-GNinja - - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" - - cmake -E time cmake %GENERATOR% .. -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DMYSQL_MAINTAINER_MODE=ERR -DFAST_BUILD=1 -DBISON_EXECUTABLE=C:\ProgramData\chocolatey\lib\winflexbison\tools\win_bison.exe -DPLUGIN_PERFSCHEMA=NO -DPLUGIN_FEEDBACK=NO + - call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" + - cmake -E time cmake %GENERATOR% .. -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DMYSQL_MAINTAINER_MODE=ERR -DFAST_BUILD=1 -DBISON_EXECUTABLE=C:\cygwin64\bin\bison.exe -DPLUGIN_PERFSCHEMA=NO -DPLUGIN_FEEDBACK=NO - set /A jobs=2*%NUMBER_OF_PROCESSORS% - cmake -E time cmake --build . -j %jobs% --config %BUILD_TYPE% --target minbuild @@ -37,4 +27,4 @@ test_script: - set /A parallel=4*%NUMBER_OF_PROCESSORS% - perl mysql-test-run.pl --force --max-test-fail=10 --retry=2 -parallel=%parallel% --testcase-timeout=4 --suite=main --skip-test-list=%APPVEYOR_BUILD_FOLDER%\win\appveyor_skip_tests.txt --mysqld=--loose-innodb-flush-log-at-trx-commit=2 -image: Visual Studio 2019 +image: Visual Studio 2022 diff --git a/client/client_priv.h b/client/client_priv.h index 23b2e6782a1..039b008c883 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -101,6 +101,7 @@ enum options_client OPT_SSL_CRL, OPT_SSL_CRLPATH, OPT_IGNORE_DATA, OPT_PRINT_ROW_COUNT, OPT_PRINT_ROW_EVENT_POSITIONS, + OPT_CHECK_IF_UPGRADE_NEEDED, OPT_SHUTDOWN_WAIT_FOR_SLAVES, OPT_COPY_S3_TABLES, OPT_PRINT_TABLE_METADATA, diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index d35591cd71c..8790329b1f4 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -22,7 +22,7 @@ #include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */ -#define VER "1.4" +#define VER "2.0" #ifdef HAVE_SYS_WAIT_H #include <sys/wait.h> @@ -37,13 +37,15 @@ #endif static int phase = 0; +static int info_file= -1; static const int phases_total = 7; static char mysql_path[FN_REFLEN]; static char mysqlcheck_path[FN_REFLEN]; -static my_bool opt_force, opt_verbose, debug_info_flag, debug_check_flag, +static my_bool debug_info_flag, debug_check_flag, opt_systables_only, opt_version_check; -static my_bool opt_not_used, opt_silent; +static my_bool opt_not_used, opt_silent, opt_check_upgrade; +static uint opt_force, opt_verbose; static uint my_end_arg= 0; static char *opt_user= (char*)"root"; @@ -96,8 +98,8 @@ static struct my_option my_long_options[]= {"debug", '#', "This is a non-debug version. Catch this and exit.", 0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, #else - {"debug", '#', "Output debug log.", &default_dbug_option, - &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"debug", '#', "Output debug log.", + 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", &debug_check_flag, &debug_check_flag, @@ -111,9 +113,13 @@ static struct my_option my_long_options[]= "Default authentication client-side plugin to use.", &opt_default_auth, &opt_default_auth, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"check-if-upgrade-is-needed", OPT_CHECK_IF_UPGRADE_NEEDED, + "Exits with status 0 if an upgrades is required, 1 otherwise.", + &opt_check_upgrade, &opt_check_upgrade, + 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"force", 'f', "Force execution of mysqlcheck even if mysql_upgrade " "has already been executed for the current version of MariaDB.", - &opt_force, &opt_force, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + &opt_not_used, &opt_not_used, 0 , GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Connect to host.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #define PASSWORD_OPT 12 @@ -191,6 +197,12 @@ static void free_used_memory(void) dynstr_free(&ds_plugin_data_types); if (cnf_file_path) my_delete(cnf_file_path, MYF(MY_WME)); + if (info_file >= 0) + { + (void) my_lock(info_file, F_UNLCK, 0, 1, MYF(0)); + my_close(info_file, MYF(MY_WME)); + info_file= -1; + } } @@ -236,6 +248,13 @@ static void verbose(const char *fmt, ...) } +static void print_error(const char *error_msg, DYNAMIC_STRING *output) +{ + fprintf(stderr, "%s\n", error_msg); + fprintf(stderr, "%s", output->str); +} + + /* Add one option - passed to mysql_upgrade on command line or by defaults file(my.cnf) - to a dynamic string, in @@ -269,6 +288,7 @@ static void add_one_option_cnf_file(DYNAMIC_STRING *ds, dynstr_append(ds, "\n"); } + static my_bool get_one_option(const struct my_option *opt, const char *argument, const char *filename __attribute__((unused))) @@ -344,11 +364,17 @@ get_one_option(const struct my_option *opt, const char *argument, my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE); die(0); break; + case 'f': /* --force */ + opt_force++; + if (argument == disabled_my_option) + opt_force= 0; + add_option= 0; + break; case OPT_SILENT: opt_verbose= 0; add_option= 0; break; - case 'f': /* --force */ + case OPT_CHECK_IF_UPGRADE_NEEDED: /* --check-if-upgrade-needed */ case 's': /* --upgrade-system-tables */ case OPT_WRITE_BINLOG: /* --write-binlog */ add_option= FALSE; @@ -378,6 +404,18 @@ get_one_option(const struct my_option *opt, const char *argument, } +/* Convert the specified version string into the numeric format. */ + +static ulong STDCALL calc_server_version(char *some_version) +{ + uint major, minor, version; + char *point= some_version, *end_point; + major= (uint) strtoul(point, &end_point, 10); point=end_point+1; + minor= (uint) strtoul(point, &end_point, 10); point=end_point+1; + version= (uint) strtoul(point, &end_point, 10); + return (ulong) major * 10000L + (ulong)(minor * 100 + version); +} + /** Run a command using the shell, storing its output in the supplied dynamic string. @@ -584,7 +622,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res, if (my_write(fd, sql_log_bin, sizeof(sql_log_bin)-1, MYF(MY_FNABP | MY_WME))) { - my_close(fd, MYF(0)); + my_close(fd, MYF(MY_WME)); my_delete(query_file_path, MYF(0)); die("Failed to write to '%s'", query_file_path); } @@ -593,7 +631,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res, if (my_write(fd, (uchar*) query, strlen(query), MYF(MY_FNABP | MY_WME))) { - my_close(fd, MYF(0)); + my_close(fd, MYF(MY_WME)); my_delete(query_file_path, MYF(0)); die("Failed to write to '%s'", query_file_path); } @@ -610,7 +648,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res, "2>&1", NULL); - my_close(fd, MYF(0)); + my_close(fd, MYF(MY_WME)); my_delete(query_file_path, MYF(0)); DBUG_RETURN(ret); @@ -657,6 +695,9 @@ static int get_upgrade_info_file_name(char* name) &ds_datadir, FALSE) || extract_variable_from_show(&ds_datadir, name)) { + print_error("Reading datadir from the MariaDB server failed. Got the " + "following error when executing the 'mysql' command line client", + &ds_datadir); dynstr_free(&ds_datadir); DBUG_RETURN(1); /* Query failed */ } @@ -668,6 +709,83 @@ static int get_upgrade_info_file_name(char* name) DBUG_RETURN(0); } +static char upgrade_info_file[FN_REFLEN]= {0}; + + +/* + Open or create mysql_upgrade_info file in servers data dir. + + Take a lock to ensure there cannot be any other mysql_upgrades + runninc concurrently +*/ + +const char *create_error_message= + "%sCould not open or create the upgrade info file '%s' in " + "the MariaDB Servers data directory, errno: %d (%s)\n"; + + + +static void open_mysql_upgrade_file() +{ + char errbuff[80]; + if (get_upgrade_info_file_name(upgrade_info_file)) + { + die("Upgrade failed"); + } + if ((info_file= my_create(upgrade_info_file, 0, + O_RDWR | O_NOFOLLOW, + MYF(0))) < 0) + { + if (opt_force >= 2) + { + fprintf(stdout, create_error_message, + "", upgrade_info_file, errno, + my_strerror(errbuff, sizeof(errbuff)-1, errno)); + fprintf(stdout, + "--force --force used, continuing without using the %s file.\n" + "Note that this means that there is no protection against " + "concurrent mysql_upgrade executions and next mysql_upgrade run " + "will do a full upgrade again!\n", + upgrade_info_file); + return; + } + fprintf(stdout, create_error_message, + "FATAL ERROR: ", + upgrade_info_file, errno, + my_strerror(errbuff, sizeof(errbuff)-1, errno)); + if (errno == EACCES) + { + fprintf(stderr, + "Note that mysql_upgrade should be run as the same user as the " + "MariaDB server binary, normally 'mysql' or 'root'.\n" + "Alternatively you can use mysql_upgrade --force --force. " + "Please check the documentation if you decide to use the force " + "option!\n"); + } + fflush(stderr); + die(0); + } + if (my_lock(info_file, F_WRLCK, 0, 1, MYF(0))) + { + die("Could not exclusively lock on file '%s'. Error %d: %s\n", + upgrade_info_file, my_errno, + my_strerror(errbuff, sizeof(errbuff)-1, my_errno)); + } +} + + +/** + Place holder for versions that require a major upgrade + + @return 0 upgrade has alredy been run on this version + @return 1 upgrade has to be run + +*/ + +static int faulty_server_versions(const char *version) +{ + return 0; +} /* Read the content of mysql_upgrade_info file and @@ -677,86 +795,111 @@ static int get_upgrade_info_file_name(char* name) NOTE This is an optimization to avoid running mysql_upgrade when it's already been performed for the particular - version of MySQL. + version of MariaDB. - In case the MySQL server can't return the upgrade info + In case the MariaDBL server can't return the upgrade info file it's always better to report that the upgrade hasn't been performed. + @return 0 Upgrade has alredy been run on this version + @return > 0 Upgrade has to be run */ -static int upgrade_already_done(myf flags) +static int upgrade_already_done(int silent) { - FILE *in; - char upgrade_info_file[FN_REFLEN]= {0}; - - if (get_upgrade_info_file_name(upgrade_info_file)) - return 0; /* Could not get filename => not sure */ - - if (!(in= my_fopen(upgrade_info_file, O_RDONLY, flags))) - return 0; /* Could not open file => not sure */ + const char *version = MYSQL_SERVER_VERSION; + const char *s; + char *pos; + my_off_t length; - bzero(upgrade_from_version, sizeof(upgrade_from_version)); - if (!fgets(upgrade_from_version, sizeof(upgrade_from_version), in)) + if (info_file < 0) { - /* Preserve errno for caller */ - int save_errno= errno; - (void) my_fclose(in, flags); - errno= save_errno; - return 0; + DBUG_ASSERT(opt_force > 1); + return 1; /* No info file and --force */ } - if (my_fclose(in, flags)) - return 0; - - errno= 0; - return (strncmp(upgrade_from_version, MYSQL_SERVER_VERSION, - sizeof(MYSQL_SERVER_VERSION)-1)==0); -} + bzero(upgrade_from_version, sizeof(upgrade_from_version)); + (void) my_seek(info_file, 0, SEEK_SET, MYF(0)); + /* We have -3 here to make calc_server_version() safe */ + length= my_read(info_file, (uchar*) upgrade_from_version, + sizeof(upgrade_from_version)-3, + MYF(MY_WME)); -/* - Write mysql_upgrade_info file in servers data dir indicating that - upgrade has been done for this version + if (!length) + { + if (opt_verbose) + verbose("Empty or non existent %s. Assuming mysql_upgrade has to be run!", + upgrade_info_file); + return 1; + } - NOTE - This might very well fail but since it's just an optimization - to run mysql_upgrade only when necessary the error can be - ignored. + /* Remove possible \Å‹ that may end in output */ + if ((pos= strchr(upgrade_from_version, '\n'))) + *pos= 0; -*/ - -static void create_mysql_upgrade_info_file(void) -{ - FILE *out; - char upgrade_info_file[FN_REFLEN]= {0}; + if (faulty_server_versions(upgrade_from_version)) + { + if (opt_verbose) + verbose("Upgrading from version %s requires mysql_upgrade to be run!", + upgrade_from_version); + return 2; + } - if (get_upgrade_info_file_name(upgrade_info_file)) - return; /* Could not get filename => skip */ + s= strchr(version, '.'); + s= strchr(s + 1, '.'); - if (!(out= my_fopen(upgrade_info_file, O_TRUNC | O_WRONLY, MYF(0)))) + if (strncmp(upgrade_from_version, version, + (size_t)(s - version + 1))) { - fprintf(stderr, - "Could not create the upgrade info file '%s' in " - "the MariaDB Servers datadir, errno: %d\n", - upgrade_info_file, errno); - return; + if (calc_server_version(upgrade_from_version) <= MYSQL_VERSION_ID) + { + verbose("Major version upgrade detected from %s to %s. Check required!", + upgrade_from_version, version); + return 3; + } + die("Version mismatch (%s -> %s): Trying to downgrade from a higher to " + "lower version is not supported!", + upgrade_from_version, version); } + if (!silent) + { + verbose("This installation of MariaDB is already upgraded to %s.\n" + "There is no need to run mysql_upgrade again for %s.", + upgrade_from_version, version); + if (!opt_check_upgrade) + verbose("You can use --force if you still want to run mysql_upgrade", + upgrade_from_version, version); + } + return 0; +} + +static void finish_mysql_upgrade_info_file(void) +{ + if (info_file < 0) + return; /* Write new version to file */ - my_fwrite(out, (uchar*) MYSQL_SERVER_VERSION, - sizeof(MYSQL_SERVER_VERSION), MY_WME); - my_fclose(out, MYF(MY_WME)); + (void) my_seek(info_file, 0, SEEK_CUR, MYF(0)); + (void) my_chsize(info_file, 0, 0, MYF(0)); + (void) my_seek(info_file, 0, 0, MYF(0)); + (void) my_write(info_file, (uchar*) MYSQL_SERVER_VERSION, + sizeof(MYSQL_SERVER_VERSION)-1, MYF(MY_WME)); + (void) my_write(info_file, (uchar*) "\n", 1, MYF(MY_WME)); + (void) my_lock(info_file, F_UNLCK, 0, 1, MYF(0)); /* - Check if the upgrad_info_file was properly created/updated + Check if the upgrade_info_file was properly created/updated It's not a fatal error -> just print a message if it fails */ - if (!upgrade_already_done(MY_WME)) + if (upgrade_already_done(1)) fprintf(stderr, - "Upgrade file '%s' was not properly created. " - "Got error errno while checking file content: %d\n", + "Could not write to the upgrade info file '%s' in " + "the MariaDB Servers datadir, errno: %d\n", upgrade_info_file, errno); + + my_close(info_file, MYF(MY_WME)); + info_file= -1; return; } @@ -1151,7 +1294,7 @@ static int check_slave_repositories(void) } /* - Update all system tables in MySQL Server to current + Update all system tables in MariaDB Server to current version using "mysql" to execute all the SQL commands compiled into the mysql_fix_privilege_tables array */ @@ -1220,24 +1363,6 @@ static int run_sql_fix_privilege_tables(void) } -static void print_error(const char *error_msg, DYNAMIC_STRING *output) -{ - fprintf(stderr, "%s\n", error_msg); - fprintf(stderr, "%s", output->str); -} - - -/* Convert the specified version string into the numeric format. */ -static ulong STDCALL calc_server_version(char *some_version) -{ - uint major, minor, version; - char *point= some_version, *end_point; - major= (uint) strtoul(point, &end_point, 10); point=end_point+1; - minor= (uint) strtoul(point, &end_point, 10); point=end_point+1; - version= (uint) strtoul(point, &end_point, 10); - return (ulong) major * 10000L + (ulong)(minor * 100 + version); -} - /** Check if the server version matches with the server version mysql_upgrade was compiled with. @@ -1273,8 +1398,7 @@ static int check_version_match(void) "check.\n", version_str, MYSQL_SERVER_VERSION); return 1; } - else - return 0; + return 0; } @@ -1283,6 +1407,8 @@ int main(int argc, char **argv) char self_name[FN_REFLEN + 1]; MY_INIT(argv[0]); + DBUG_PROCESS(argv[0]); + load_defaults_or_exit("my", load_default_groups, &argc, &argv); defaults_argv= argv; /* Must be freed by 'free_defaults' */ @@ -1324,12 +1450,17 @@ int main(int argc, char **argv) die(NULL); my_write(fd, USTRING_WITH_LEN( "[client]\n"), MYF(MY_FAE)); my_write(fd, (uchar*)ds_args.str, ds_args.length, MYF(MY_FAE)); - my_close(fd, MYF(0)); + my_close(fd, MYF(MY_WME)); } /* Find mysql */ find_tool(mysql_path, IF_WIN("mysql.exe", "mysql"), self_name); + open_mysql_upgrade_file(); + + if (opt_check_upgrade) + exit(upgrade_already_done(0) == 0); + /* Find mysqlcheck */ find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck"), self_name); @@ -1338,15 +1469,10 @@ int main(int argc, char **argv) /* Read the mysql_upgrade_info file to check if mysql_upgrade - already has been run for this installation of MySQL + already has been run for this installation of MariaDB */ - if (!opt_force && upgrade_already_done(0)) - { - printf("This installation of MariaDB is already upgraded to %s, " - "use --force if you still need to run mysql_upgrade\n", - MYSQL_SERVER_VERSION); - goto end; - } + if (!opt_force && !upgrade_already_done(0)) + goto end; /* Upgrade already done */ if (opt_version_check && check_version_match()) die("Upgrade failed"); @@ -1373,8 +1499,8 @@ int main(int argc, char **argv) verbose("OK"); - /* Create a file indicating upgrade has been performed */ - create_mysql_upgrade_info_file(); + /* Finish writing indicating upgrade has been performed */ + finish_mysql_upgrade_info_file(); DBUG_ASSERT(phase == phases_total); diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake index 172f65ab17c..c3c7cb78765 100644 --- a/cmake/cpack_rpm.cmake +++ b/cmake/cpack_rpm.cmake @@ -29,7 +29,7 @@ SET(CPACK_COMPONENT_BACKUP_GROUP "backup") SET(CPACK_COMPONENTS_ALL Server ManPagesServer IniFiles Server_Scripts SupportFiles Development ManPagesDevelopment - ManPagesTest Readme ManPagesClient Test + ManPagesTest Readme ManPagesClient Test Common Client SharedLibraries ClientPlugins backup ) @@ -197,6 +197,8 @@ SETA(CPACK_RPM_devel_PACKAGE_OBSOLETES "MySQL-devel") SETA(CPACK_RPM_devel_PACKAGE_PROVIDES "MySQL-devel") +SETA(CPACK_RPM_devel_PACKAGE_REQUIRES + "MariaDB-shared >= 10.2.42") SETA(CPACK_RPM_server_PACKAGE_OBSOLETES "MariaDB" @@ -358,9 +360,11 @@ MACRO(ADDIF var) ENDIF() ENDMACRO() +ADDIF(MYSQL_MAINTAINER_MODE) ADDIF(CMAKE_BUILD_TYPE) ADDIF(BUILD_CONFIG) ADDIF(WITH_SSL) +ADDIF(WITH_JEMALLOC) ENDIF() ENDIF(RPM) diff --git a/cmake/cpack_tgz.cmake b/cmake/cpack_tgz.cmake new file mode 100644 index 00000000000..7dd9f397189 --- /dev/null +++ b/cmake/cpack_tgz.cmake @@ -0,0 +1,10 @@ +IF(NOT RPM AND NOT DEB) + # + # use -DEXTRA_FILES='/path/to/file=where/to/install;/bin/dd=bin;...' + # + FOREACH(f ${EXTRA_FILES}) + STRING(REGEX REPLACE "=.*$" "" from ${f}) + STRING(REGEX REPLACE "^.*=" "" to ${f}) + INSTALL(PROGRAMS ${from} DESTINATION ${to}) + ENDFOREACH() +ENDIF() diff --git a/cmake/pcre.cmake b/cmake/pcre.cmake index 678556c9a59..b0c6b81e630 100644 --- a/cmake/pcre.cmake +++ b/cmake/pcre.cmake @@ -19,12 +19,21 @@ MACRO(BUNDLE_PCRE2) SET(intdir) ENDIF() - SET(file ${dir}/src/pcre2-build/${intdir}${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}) + # PCRE names static libraries differently depending on platform. + # On Windows, but not elsewhere, it adds "-static" to the library name, + # or "-staticd". + IF(WIN32) + SET(PCRE_STATIC "-static") + ELSE() + SET(PCRE_STATIC "") + ENDIF() + + SET(file ${dir}/src/pcre2-build/${intdir}${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${PCRE_STATIC}${CMAKE_STATIC_LIBRARY_SUFFIX}) IF(WIN32) # Debug libary name. # Same condition as in pcre2 CMakeLists.txt that adds "d" - SET(file_d ${dir}/src/pcre2-build/${intdir}${CMAKE_STATIC_LIBRARY_PREFIX}${lib}d${CMAKE_STATIC_LIBRARY_SUFFIX}) + SET(file_d ${dir}/src/pcre2-build/${intdir}${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${PCRE_STATIC}d${CMAKE_STATIC_LIBRARY_SUFFIX}) SET_TARGET_PROPERTIES(${lib} PROPERTIES IMPORTED_LOCATION_DEBUG ${file_d}) ELSE() SET(file_d) @@ -44,8 +53,8 @@ MACRO(BUNDLE_PCRE2) ExternalProject_Add( pcre2 PREFIX "${dir}" - URL "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.37/pcre2-10.37.zip" - URL_MD5 8c1699a725d4b28410adf4b964ebbcb7 + URL "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.39/pcre2-10.39.zip" + URL_MD5 e101c0ca9edb4b0af103bebe78ba52b0 INSTALL_COMMAND "" CMAKE_ARGS "-DCMAKE_WARN_DEPRECATED=FALSE" diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake index 7c2488be8bd..a6793cf3c55 100644 --- a/cmake/ssl.cmake +++ b/cmake/ssl.cmake @@ -118,7 +118,7 @@ MACRO (MYSQL_CHECK_SSL) ENDIF() FIND_PACKAGE(OpenSSL) SET_PACKAGE_PROPERTIES(OpenSSL PROPERTIES TYPE RECOMMENDED) - IF(OPENSSL_FOUND) + IF(OPENSSL_FOUND AND OPENSSL_VERSION AND OPENSSL_VERSION VERSION_LESS "3.0.0") SET(OPENSSL_LIBRARY ${OPENSSL_SSL_LIBRARY}) INCLUDE(CheckSymbolExists) SET(SSL_SOURCES "") diff --git a/cmake/systemd.cmake b/cmake/systemd.cmake index 303b3a25aa9..7036cbbe6b3 100644 --- a/cmake/systemd.cmake +++ b/cmake/systemd.cmake @@ -17,7 +17,7 @@ MACRO(CHECK_SYSTEMD) IF(UNIX) INCLUDE(FindPkgConfig) # http://www.cmake.org/cmake/help/v3.0/module/FindPkgConfig.html - SET(WITH_SYSTEMD "auto" CACHE STRING "Enable systemd scripts and notification support") + SET(WITH_SYSTEMD "auto" CACHE STRING "Enable systemd scripts and notification support. Allowed values yes/no/auto.") IF(WITH_SYSTEMD STREQUAL "yes" OR WITH_SYSTEMD STREQUAL "auto") IF(PKG_CONFIG_FOUND) IF (NOT DEFINED LIBSYSTEMD_FOUND) @@ -54,6 +54,13 @@ MACRO(CHECK_SYSTEMD) SET(SYSTEMD_LIMIT "# For liburing and io_uring_setup() LimitMEMLOCK=524288") ENDIF() + + IF(NOT DEB AND NOT RPM) + SET(SYSTEMD_READWRITEPATH "# Database dir: '${MYSQL_DATADIR}' should be writable even +# ProtectSystem=full prevents it +ReadWritePaths=-${MYSQL_DATADIR}\n") + ENDIF() + MESSAGE_ONCE(systemd "Systemd features enabled") ELSE() UNSET(LIBSYSTEMD) diff --git a/configure.cmake b/configure.cmake index 3b6717da358..3996b4fbac0 100644 --- a/configure.cmake +++ b/configure.cmake @@ -863,9 +863,16 @@ MARK_AS_ADVANCED(NO_ALARM) CHECK_CXX_SOURCE_COMPILES(" int main() { - long long int var= 1; - long long int *ptr= &var; - return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST); + char x=1; + short y=1; + int z=1; + long w = 1; + long long s = 1; + x = __atomic_add_fetch(&x, 1, __ATOMIC_SEQ_CST); + y = __atomic_add_fetch(&y, 1, __ATOMIC_SEQ_CST); + z = __atomic_add_fetch(&z, 1, __ATOMIC_SEQ_CST); + w = __atomic_add_fetch(&w, 1, __ATOMIC_SEQ_CST); + return (int)__atomic_load_n(&s, __ATOMIC_SEQ_CST); }" HAVE_GCC_C11_ATOMICS_WITHOUT_LIBATOMIC) IF (HAVE_GCC_C11_ATOMICS_WITHOUT_LIBATOMIC) @@ -876,9 +883,16 @@ ELSE() CHECK_CXX_SOURCE_COMPILES(" int main() { - long long int var= 1; - long long int *ptr= &var; - return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST); + char x=1; + short y=1; + int z=1; + long w = 1; + long long s = 1; + x = __atomic_add_fetch(&x, 1, __ATOMIC_SEQ_CST); + y = __atomic_add_fetch(&y, 1, __ATOMIC_SEQ_CST); + z = __atomic_add_fetch(&z, 1, __ATOMIC_SEQ_CST); + w = __atomic_add_fetch(&w, 1, __ATOMIC_SEQ_CST); + return (int)__atomic_load_n(&s, __ATOMIC_SEQ_CST); }" HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC) IF(HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC) diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index 2b9b87ce23e..7403591b6a0 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -11,6 +11,8 @@ # Exit immediately on any error set -e +source ./VERSION + # This file is invoked from Buildbot and Travis-CI to build deb packages. # As both of those CI systems have many parallel jobs that include different # parts of the test suite, we don't need to run the mysql-test-run at all when @@ -32,7 +34,7 @@ then # Take the files and part of control from MCS directory cp -v storage/columnstore/columnstore/debian/mariadb-plugin-columnstore.* debian/ echo >> debian/control - cat storage/columnstore/columnstore/debian/control >> debian/control + sed "s/10.6/${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}/" <storage/columnstore/columnstore/debian/control >> debian/control fi # Don't build or try to put files in a package for selected plugins and components on Travis-CI @@ -101,7 +103,6 @@ fi echo "Incrementing changelog and starting build scripts" # Find major.minor version -source ./VERSION UPSTREAM="${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}${MYSQL_VERSION_EXTRA}" PATCHLEVEL="+maria" LOGSTRING="MariaDB build" diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc index e1f368a2c0f..bc3e5bf0427 100644 --- a/extra/innochecksum.cc +++ b/extra/innochecksum.cc @@ -53,6 +53,12 @@ The parts not included are excluded by #ifndef UNIV_INNOCHECKSUM. */ #include <string.h> +#ifdef UNIV_NONINL +# include "fsp0fsp.inl" +# include "mach0data.inl" +# include "ut0rnd.inl" +#endif + #ifndef PRIuMAX #define PRIuMAX "llu" #endif diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index c89c3188b0e..a3ba63506c5 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -349,6 +349,9 @@ char orig_argv1[FN_REFLEN]; pthread_mutex_t backup_mutex; pthread_cond_t scanned_lsn_cond; +/** Store the deferred tablespace name during --backup */ +static std::set<std::string> defer_space_names; + typedef std::map<space_id_t,std::string> space_id_to_name_t; struct ddl_tracker_t { @@ -358,10 +361,54 @@ struct ddl_tracker_t { std::set<space_id_t> drops; /* For DDL operation found in redo log, */ space_id_to_name_t id_to_name; + /** Deferred tablespaces with their ID and name which was + found in redo log of DDL operations */ + space_id_to_name_t deferred_tables; + + /** Insert the deferred tablespace id with the name */ + void insert_defer_id(space_id_t space_id, std::string name) + { + auto it= defer_space_names.find(name); + if (it != defer_space_names.end()) + { + deferred_tables[space_id]= name; + defer_space_names.erase(it); + } + } + + /** Rename the deferred tablespace with new name */ + void rename_defer(space_id_t space_id, std::string old_name, + std::string new_name) + { + if (deferred_tables.find(space_id) != deferred_tables.end()) + deferred_tables[space_id] = new_name; + auto defer_end= defer_space_names.end(); + auto defer= defer_space_names.find(old_name); + if (defer == defer_end) + defer= defer_space_names.find(new_name); + + if (defer != defer_end) + { + deferred_tables[space_id]= new_name; + defer_space_names.erase(defer); + } + } + + /** Delete the deferred tablespace */ + void delete_defer(space_id_t space_id, std::string name) + { + deferred_tables.erase(space_id); + defer_space_names.erase(name); + } }; static ddl_tracker_t ddl_tracker; +/** Stores the space ids of page0 INIT_PAGE redo records. It is +used to indicate whether the given deferred tablespace can +be reconstructed. */ +static std::set<space_id_t> first_page_init_ids; + // Convert non-null terminated filename to space name static std::string filename_to_spacename(const void *filename, size_t len); @@ -769,33 +816,57 @@ static std::string filename_to_spacename(const void *filename, size_t len) /** Report an operation to create, delete, or rename a file during backup. @param[in] space_id tablespace identifier -@param[in] create whether the file is being created +@param[in] type redo log file operation type @param[in] name file name (not NUL-terminated) @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(uint32_t space_id, bool create, +static void backup_file_op(uint32_t space_id, int type, const byte* name, ulint len, const byte* new_name, ulint new_len) { - ut_ad(!create || !new_name); ut_ad(name); ut_ad(len); ut_ad(!new_name == !new_len); pthread_mutex_lock(&backup_mutex); - if (create) { - ddl_tracker.id_to_name[space_id] = filename_to_spacename(name, len); + switch(type) { + case FILE_CREATE: + { + std::string space_name = filename_to_spacename(name, len); + ddl_tracker.id_to_name[space_id] = space_name; + ddl_tracker.delete_defer(space_id, space_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); + break; + case FILE_MODIFY: + ddl_tracker.insert_defer_id( + space_id, filename_to_spacename(name, len)); + msg("DDL tracking : modify %u \"%.*s\"", space_id, int(len), name); + break; + case FILE_RENAME: + { + std::string new_space_name = filename_to_spacename( + new_name, new_len); + std::string old_space_name = filename_to_spacename( + name, len); + ddl_tracker.id_to_name[space_id] = new_space_name; + ddl_tracker.rename_defer(space_id, old_space_name, + new_space_name); msg("DDL tracking : rename %u \"%.*s\",\"%.*s\"", space_id, int(len), name, int(new_len), new_name); - } else { + } + break; + case FILE_DELETE: ddl_tracker.drops.insert(space_id); + ddl_tracker.delete_defer( + space_id, filename_to_spacename(name, len)); msg("DDL tracking : delete %u \"%.*s\"", space_id, int(len), name); + break; + default: + ut_ad(0); + break; } pthread_mutex_unlock(&backup_mutex); } @@ -810,29 +881,38 @@ static void backup_file_op(uint32_t space_id, bool create, We will abort backup in this case. */ -static void backup_file_op_fail(uint32_t space_id, bool create, +static void backup_file_op_fail(uint32_t space_id, int type, const byte* name, ulint len, const byte* new_name, ulint new_len) { - bool fail; - if (create) { - 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) { + bool fail = false; + switch(type) { + case FILE_CREATE: + msg("DDL tracking : create %u \"%.*s\"", space_id, int(len), name); + fail = !check_if_skip_table( + filename_to_spacename(name, len).c_str()); + break; + case FILE_MODIFY: + msg("DDL tracking : modify %u \"%.*s\"", space_id, int(len), name); + break; + case FILE_RENAME: 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); - fail = !check_if_skip_table(spacename.c_str()) || !check_if_skip_table(new_spacename.c_str()); - } - else { - std::string spacename = filename_to_spacename(name, len); - fail = !check_if_skip_table(spacename.c_str()); + fail = !check_if_skip_table( + filename_to_spacename(name, len).c_str()) + || !check_if_skip_table( + filename_to_spacename(new_name, new_len).c_str()); + break; + case FILE_DELETE: + fail = !check_if_skip_table( + filename_to_spacename(name, len).c_str()); msg("DDL tracking : delete %u \"%.*s\"", space_id, int(len), name); + break; + default: + ut_ad(0); + break; } + if (fail) { ut_a(opt_no_lock); die("DDL operation detected in the late phase of backup." @@ -840,6 +920,12 @@ static void backup_file_op_fail(uint32_t space_id, bool create, } } +/* Function to store the space id of page0 INIT_PAGE +@param space_id space id which has page0 init page */ +static void backup_first_page_op(space_id_t space_id) +{ + first_page_init_ids.insert(space_id); +} /* Retrieve default data directory, to be used with --copy-back. @@ -3235,7 +3321,8 @@ static void xb_load_single_table_tablespace(const char *dirname, { ut_ad(srv_operation == SRV_OPERATION_BACKUP || srv_operation == SRV_OPERATION_RESTORE_DELTA - || srv_operation == SRV_OPERATION_RESTORE); + || srv_operation == SRV_OPERATION_RESTORE + || srv_operation == SRV_OPERATION_BACKUP_NO_DEFER); /* Ignore .isl files on XtraBackup recovery. All tablespaces must be local. */ if (is_remote && srv_operation == SRV_OPERATION_RESTORE_DELTA) { @@ -3304,6 +3391,10 @@ static void xb_load_single_table_tablespace(const char *dirname, } if (!defer && file->m_defer) { + const char *file_path = file->filepath(); + defer_space_names.insert( + filename_to_spacename( + file_path, strlen(file_path))); delete file; ut_free(name); return; @@ -4419,6 +4510,7 @@ static bool xtrabackup_backup_func() srv_operation = SRV_OPERATION_BACKUP; log_file_op = backup_file_op; + first_page_init = backup_first_page_op; metadata_to_lsn = 0; /* initialize components */ @@ -4433,6 +4525,7 @@ fail: } log_file_op = NULL; + first_page_init = NULL; if (dst_log_file) { ds_close(dst_log_file); dst_log_file = NULL; @@ -4735,6 +4828,7 @@ fail_before_log_copying_thread_start: innodb_shutdown(); log_file_op = NULL; + first_page_init = NULL; pthread_mutex_destroy(&backup_mutex); pthread_cond_destroy(&scanned_lsn_cond); if (!corrupted_pages.empty()) { @@ -4816,7 +4910,9 @@ void backup_fix_ddl(CorruptedPages &corrupted_pages) continue; } - if (ddl_tracker.drops.find(id) == ddl_tracker.drops.end()) { + if (ddl_tracker.drops.find(id) == ddl_tracker.drops.end() + && ddl_tracker.deferred_tables.find(id) + == ddl_tracker.deferred_tables.end()) { dropped_tables.erase(name); new_tables[id] = name; if (opt_log_innodb_page_corruption) @@ -4861,6 +4957,41 @@ void backup_fix_ddl(CorruptedPages &corrupted_pages) DBUG_EXECUTE_IF("check_mdl_lock_works", DBUG_ASSERT(new_tables.size() == 0);); + srv_operation = SRV_OPERATION_BACKUP_NO_DEFER; + + /* Mariabackup detected the FILE_MODIFY or FILE_RENAME + for the deferred tablespace. So it needs to read the + tablespace again if innodb doesn't have page0 initialization + redo log for it */ + for (space_id_to_name_t::iterator iter = + ddl_tracker.deferred_tables.begin(); + iter != ddl_tracker.deferred_tables.end(); + iter++) { + if (check_if_skip_table(iter->second.c_str())) { + continue; + } + + if (first_page_init_ids.find(iter->first) + != first_page_init_ids.end()) { + new_tables[iter->first] = iter->second.c_str(); + continue; + } + + xb_load_single_table_tablespace(iter->second, false); + } + + /* Mariabackup doesn't detect any FILE_OP for the deferred + tablespace. There is a possiblity that page0 could've + been corrupted persistently in the disk */ + for (auto space_name: defer_space_names) { + if (!check_if_skip_table(space_name.c_str())) { + xb_load_single_table_tablespace( + space_name, false); + } + } + + srv_operation = SRV_OPERATION_BACKUP; + for (const auto &t : new_tables) { if (!check_if_skip_table(t.second.c_str())) { xb_load_single_table_tablespace(t.second, false, diff --git a/extra/wolfssl/CMakeLists.txt b/extra/wolfssl/CMakeLists.txt index b38d57d3710..c992c358e38 100644 --- a/extra/wolfssl/CMakeLists.txt +++ b/extra/wolfssl/CMakeLists.txt @@ -104,6 +104,7 @@ ${WOLFCRYPT_SRCDIR}/wc_port.c ${WOLFCRYPT_SRCDIR}/wc_encrypt.c ${WOLFCRYPT_SRCDIR}/hash.c ${WOLFCRYPT_SRCDIR}/wolfmath.c +${WOLFCRYPT_SRCDIR}/kdf.c ) # Use fastmath large number math library. diff --git a/extra/wolfssl/user_settings.h.in b/extra/wolfssl/user_settings.h.in index 55b43655659..bbe8c820019 100644 --- a/extra/wolfssl/user_settings.h.in +++ b/extra/wolfssl/user_settings.h.in @@ -2,6 +2,7 @@ #define WOLFSSL_USER_SETTINGS_H #define HAVE_CRL +#define WOLFSSL_HAVE_ERROR_QUEUE #define WOLFSSL_MYSQL_COMPATIBLE #define HAVE_ECC #define ECC_TIMING_RESISTANT diff --git a/extra/wolfssl/wolfssl b/extra/wolfssl/wolfssl -Subproject 723ed009ae5dc68acc14cd7664f93503d64cd51 +Subproject c3513bf2573c30f6d2df815de216120e9214202 diff --git a/include/errmsg.h b/include/errmsg.h index c0c4cfc58be..bd086bba05b 100644 --- a/include/errmsg.h +++ b/include/errmsg.h @@ -36,8 +36,9 @@ extern const char *client_errors[]; /* Error messages */ #define CR_MIN_ERROR 2000 /* For easier client code */ #define CR_MAX_ERROR 2999 #if !defined(ER) -#define ER(X) (((X) >= CR_ERROR_FIRST && (X) <= CR_ERROR_LAST)? \ - client_errors[(X)-CR_ERROR_FIRST]: client_errors[CR_UNKNOWN_ERROR]) +#define ER(X) (((X) >= CR_ERROR_FIRST && (X) <= CR_ERROR_LAST) \ + ? client_errors[(X)-CR_ERROR_FIRST] \ + : client_errors[CR_UNKNOWN_ERROR-CR_ERROR_FIRST]) #endif #define CLIENT_ERRMAP 2 /* Errormap used by my_error() */ diff --git a/include/json_lib.h b/include/json_lib.h index 6d802860cff..ea7f102fd02 100644 --- a/include/json_lib.h +++ b/include/json_lib.h @@ -224,6 +224,7 @@ typedef struct st_json_engine_t int stack[JSON_DEPTH_LIMIT]; /* Keeps the stack of nested JSON structures. */ int stack_p; /* The 'stack' pointer. */ + volatile uchar *killed_ptr; } json_engine_t; diff --git a/include/m_ctype.h b/include/m_ctype.h index 41523913c10..4a231caeda9 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -351,6 +351,60 @@ struct my_collation_handler_st const uchar *, size_t, const uchar *, size_t, my_bool); int (*strnncollsp)(CHARSET_INFO *, const uchar *, size_t, const uchar *, size_t); + /* + strnncollsp_nchars() - similar to strnncollsp() but assumes that both + strings were originally CHAR(N) values with the + same N, then were optionally space-padded, + or optionally space-trimmed. + + In other words, this function compares in the way + if we insert both values into a CHAR(N) column + and then compare the two column values. + + It compares the same amount of characters from the two strings. + This is especially important for NOPAD collations. + + If CHAR_LENGTH of the two strings are different, + the shorter string is virtually padded with trailing spaces + up to CHAR_LENGTH of the longer string, to guarantee that the + same amount of characters are compared. + This is important if the two CHAR(N) strings are space-trimmed + (e.g. like in InnoDB compact format for CHAR). + + The function compares not more than "nchars" characters only. + This can be useful to compare CHAR(N) space-padded strings + (when the exact N is known) without having to truncate them before + the comparison. + + For example, Field_string stores a "CHAR(3) CHARACTER SET utf8mb4" value + of "aaa" as 12 bytes in a record buffer: + - 3 bytes of the actual data, followed by + - 9 bytes of spaces (just fillers, not real data) + The caller can pass nchars=3 to compare CHAR(3) record values. + In such case, the comparator won't go inside the 9 bytes of the fillers. + + If N is not known, the caller can pass max(len1,len2) as the "nchars" value + (i.e. the maximum of the OCTET_LENGTH of the two strings). + + Notes on complex collations. + + This function counts contraction parts as individual characters. + For example, the Czech letter 'ch' (in Czech collations) + is ordinarily counted by the "nchars" limit as TWO characters + (although it is only one letter). + This corresponds to what CHAR(N) does in INSERT. + + If the "nchars" limit tears apart a contraction, only the part fitting + into "nchars" characters is used. For example, in case of a Czech collation, + the string "ach" with nchars=2 is compared as 'ac': the contraction + 'ch' is torn apart and the letter 'c' acts as an individual character. + This emulates the same comparison result with the scenario when we insert + 'ach' into a CHAR(2) column and then compare it. + */ + int (*strnncollsp_nchars)(CHARSET_INFO *, + const uchar *str1, size_t len1, + const uchar *str2, size_t len2, + size_t nchars); size_t (*strnxfrm)(CHARSET_INFO *, uchar *dst, size_t dstlen, uint nweights, const uchar *src, size_t srclen, uint flags); diff --git a/include/my_base.h b/include/my_base.h index 80ee527ccf0..f96e569cae4 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -528,7 +528,8 @@ enum ha_base_keytype { #define HA_ERR_SEQUENCE_INVALID_DATA 195 #define HA_ERR_SEQUENCE_RUN_OUT 196 #define HA_ERR_COMMIT_ERROR 197 -#define HA_ERR_LAST 197 /* Copy of last error nr * */ +#define HA_ERR_PARTITION_LIST 198 +#define HA_ERR_LAST 198 /* Copy of last error nr * */ /* Number of different errors */ #define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1) diff --git a/include/my_handler_errors.h b/include/my_handler_errors.h index 69b1566557d..96632629775 100644 --- a/include/my_handler_errors.h +++ b/include/my_handler_errors.h @@ -108,7 +108,8 @@ static const char *handler_error_messages[]= "Tablespace is missing for a table", "Sequence has been run out", "Sequence values are conflicting", - "Error during commit" + "Error during commit", + "Cannot select partitions" }; #endif /* MYSYS_MY_HANDLER_ERRORS_INCLUDED */ diff --git a/include/my_sys.h b/include/my_sys.h index f63fe38aab8..6a0c92b4a07 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -1,5 +1,5 @@ /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2010, 2021, MariaDB Corporation. + Copyright (c) 2010, 2022, 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 @@ -276,7 +276,7 @@ extern int my_umask_dir, extern SECURITY_ATTRIBUTES my_dir_security_attributes; LPSECURITY_ATTRIBUTES my_win_file_secattr(); #endif -extern my_bool my_use_symdir; +extern MYSQL_PLUGIN_IMPORT my_bool my_use_symdir; extern ulong my_default_record_cache_size; extern MYSQL_PLUGIN_IMPORT my_bool my_disable_locking; diff --git a/include/mysql/plugin_auth.h b/include/mysql/plugin_auth.h index ae9c9368f15..3827db33431 100644 --- a/include/mysql/plugin_auth.h +++ b/include/mysql/plugin_auth.h @@ -147,7 +147,8 @@ struct st_mysql_auth @return 0 for ok, 1 for error - Can be NULL. + Can be NULL, in this case one will not be able to use SET PASSWORD or + PASSWORD('...') in GRANT, CREATE USER, ALTER USER. */ int (*hash_password)(const char *password, size_t password_length, char *hash, size_t *hash_length); diff --git a/include/mysql/psi/mysql_file.h b/include/mysql/psi/mysql_file.h index 761482d0165..795a40e38b7 100644 --- a/include/mysql/psi/mysql_file.h +++ b/include/mysql/psi/mysql_file.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -216,7 +216,7 @@ With the instrumentation, mysql_fclose(NULL, ...) will safely return 0, which is an extension compared to my_fclose and is therefore compliant. mysql_fclose is on purpose *not* implementing - @code DBUG_ASSERT(file != NULL) @endcode, + @code assert(file != NULL) @endcode, since doing so could introduce regressions. */ #ifdef HAVE_PSI_FILE_INTERFACE diff --git a/include/mysql/psi/mysql_idle.h b/include/mysql/psi/mysql_idle.h index f8085073af6..95886bd4e13 100644 --- a/include/mysql/psi/mysql_idle.h +++ b/include/mysql/psi/mysql_idle.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates Copyright (c) 2017, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify diff --git a/include/mysql/psi/mysql_mdl.h b/include/mysql/psi/mysql_mdl.h index 20d6c94c57c..3b3aba0a81f 100644 --- a/include/mysql/psi/mysql_mdl.h +++ b/include/mysql/psi/mysql_mdl.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2012, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/mysql_memory.h b/include/mysql/psi/mysql_memory.h index a79579c2e56..b461f2fb206 100644 --- a/include/mysql/psi/mysql_memory.h +++ b/include/mysql/psi/mysql_memory.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2012, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/mysql_ps.h b/include/mysql/psi/mysql_ps.h index f0b2733297a..42f518b77c4 100644 --- a/include/mysql/psi/mysql_ps.h +++ b/include/mysql/psi/mysql_ps.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2014, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/mysql_socket.h b/include/mysql/psi/mysql_socket.h index d70e1c8fc5a..4f1b48aa9a4 100644 --- a/include/mysql/psi/mysql_socket.h +++ b/include/mysql/psi/mysql_socket.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. Copyright (c) 2017, MariaDB Corporation. This program is free software; you can redistribute it and/or modify diff --git a/include/mysql/psi/mysql_sp.h b/include/mysql/psi/mysql_sp.h index 5eeea37f4c4..68b79f1b852 100644 --- a/include/mysql/psi/mysql_sp.h +++ b/include/mysql/psi/mysql_sp.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/mysql_stage.h b/include/mysql/psi/mysql_stage.h index 732df6bd357..f16b0ce207e 100644 --- a/include/mysql/psi/mysql_stage.h +++ b/include/mysql/psi/mysql_stage.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/mysql_statement.h b/include/mysql/psi/mysql_statement.h index fab23d2c5c2..7a95e4057fd 100644 --- a/include/mysql/psi/mysql_statement.h +++ b/include/mysql/psi/mysql_statement.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. Copyright (c) 2017, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify diff --git a/include/mysql/psi/mysql_table.h b/include/mysql/psi/mysql_table.h index a2124064510..03b6e998562 100644 --- a/include/mysql/psi/mysql_table.h +++ b/include/mysql/psi/mysql_table.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2017, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify diff --git a/include/mysql/psi/mysql_thread.h b/include/mysql/psi/mysql_thread.h index 87f36d92573..a301adcad18 100644 --- a/include/mysql/psi/mysql_thread.h +++ b/include/mysql/psi/mysql_thread.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. Copyright (c) 2020, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify diff --git a/include/mysql/psi/mysql_transaction.h b/include/mysql/psi/mysql_transaction.h index 6de794d95bb..611bd1fa0f9 100644 --- a/include/mysql/psi/mysql_transaction.h +++ b/include/mysql/psi/mysql_transaction.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/psi.h b/include/mysql/psi/psi.h index 2d669070e54..b9beab77e2a 100644 --- a/include/mysql/psi/psi.h +++ b/include/mysql/psi/psi.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/psi_abi_v0.h b/include/mysql/psi/psi_abi_v0.h index 5c879fb8536..b94a7695ade 100644 --- a/include/mysql/psi/psi_abi_v0.h +++ b/include/mysql/psi/psi_abi_v0.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/psi_abi_v1.h b/include/mysql/psi/psi_abi_v1.h index 488e832c3ed..bdf475147ab 100644 --- a/include/mysql/psi/psi_abi_v1.h +++ b/include/mysql/psi/psi_abi_v1.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/psi_abi_v2.h b/include/mysql/psi/psi_abi_v2.h index 3495d618b05..63d99106055 100644 --- a/include/mysql/psi/psi_abi_v2.h +++ b/include/mysql/psi/psi_abi_v2.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/psi_base.h b/include/mysql/psi/psi_base.h index f365e2625ee..7b4eaf80892 100644 --- a/include/mysql/psi/psi_base.h +++ b/include/mysql/psi/psi_base.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/psi_memory.h b/include/mysql/psi/psi_memory.h index c019c9cd410..9b968667d53 100644 --- a/include/mysql/psi/psi_memory.h +++ b/include/mysql/psi/psi_memory.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/ssl_compat.h b/include/ssl_compat.h index 9f4b6be8d95..8dc1225407e 100644 --- a/include/ssl_compat.h +++ b/include/ssl_compat.h @@ -73,7 +73,10 @@ #define EVP_MD_CTX_SIZE sizeof(EVP_MD_CTX) #endif +#ifndef DH_set0_pqg #define DH_set0_pqg(D,P,Q,G) ((D)->p= (P), (D)->g= (G)) +#endif + #define EVP_CIPHER_CTX_buf_noconst(ctx) ((ctx)->buf) #define EVP_CIPHER_CTX_encrypting(ctx) ((ctx)->encrypt) #define EVP_CIPHER_CTX_SIZE sizeof(EVP_CIPHER_CTX) diff --git a/libmariadb b/libmariadb -Subproject 0bf84c065e4cfa18764fe4823700d26a21a6248 +Subproject bc5e8a796447feda2d37367da8afce9f1f8cf5a diff --git a/libmysqld/embedded_priv.h b/libmysqld/embedded_priv.h index af80f5bc6a9..2262706217e 100644 --- a/libmysqld/embedded_priv.h +++ b/libmysqld/embedded_priv.h @@ -19,8 +19,8 @@ C_MODE_START void lib_connection_phase(NET *net, int phase); -void init_embedded_mysql(MYSQL *mysql, int client_flag); -void *create_embedded_thd(int client_flag); +void init_embedded_mysql(MYSQL *mysql, ulong client_flag); +void *create_embedded_thd(ulong client_flag); int check_embedded_connection(MYSQL *mysql, const char *db); void free_old_query(MYSQL *mysql); extern MYSQL_METHODS embedded_methods; diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index db4e7e6cfa9..5d78974c2d5 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -674,7 +674,7 @@ void end_embedded_server() } -void init_embedded_mysql(MYSQL *mysql, int client_flag) +void init_embedded_mysql(MYSQL *mysql, ulong client_flag) { THD *thd = (THD *)mysql->thd; thd->mysql= mysql; @@ -694,7 +694,7 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag) create_new_thread(), and prepare_new_connection_state(). This should be refactored to avoid code duplication. */ -void *create_embedded_thd(int client_flag) +void *create_embedded_thd(ulong client_flag) { THD * thd= new THD(next_thread_id()); @@ -710,7 +710,7 @@ void *create_embedded_thd(int client_flag) thd->set_command(COM_SLEEP); thd->set_time(); thd->init_for_queries(); - thd->client_capabilities= client_flag; + thd->client_capabilities= client_flag | MARIADB_CLIENT_EXTENDED_METADATA; thd->real_id= pthread_self(); thd->db= null_clex_str; @@ -841,7 +841,7 @@ int check_embedded_connection(MYSQL *mysql, const char *db) /* acl_authenticate() takes the data from thd->net->read_pos */ thd->net.read_pos= (uchar*)buf; - if (acl_authenticate(thd, 0, end - buf)) + if (acl_authenticate(thd, (uint) (end - buf))) { my_free(thd->security_ctx->user); goto err; diff --git a/man/mysql_upgrade.1 b/man/mysql_upgrade.1 index c60c0a208bf..d47c3c70b85 100644 --- a/man/mysql_upgrade.1 +++ b/man/mysql_upgrade.1 @@ -239,6 +239,21 @@ Old option accepted for backward compatibility but ignored\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysql_upgrade: check-if-upgrade-is-needed option +.\" check-if-upgrade-is-needed option: mysql_upgrade +\fB\-\-check\-if\-upgrade\-is\-needed\fR +.sp +Exit with a status code indicating if an upgrade is needed\&. Returns 0 if upgrade needed or current version couldn't be determined, 1 when no action required\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql_upgrade: datadir option .\" datadir option: mysql_upgrade \fB\-\-datadir=\fR\fB\fIpath\fR\fR diff --git a/mysql-test/collections/buildbot_suites.bat b/mysql-test/collections/buildbot_suites.bat index 0ec8e4b9939..d4a6e665840 100644 --- a/mysql-test/collections/buildbot_suites.bat +++ b/mysql-test/collections/buildbot_suites.bat @@ -1,4 +1,5 @@ -perl mysql-test-run.pl --verbose-restart --force --suite-timeout=120 --max-test-fail=10 --retry=3 --parallel=4 --suite=^ +if "%MTR_PARALLEL%"=="" set MTR_PARALLEL=%NUMBER_OF_PROCESSORS% +perl mysql-test-run.pl --verbose-restart --force --suite-timeout=120 --max-test-fail=10 --retry=3 --suite=^ vcol,gcol,perfschema,^ main,^ innodb,^ diff --git a/mysql-test/include/index_merge1.inc b/mysql-test/include/index_merge1.inc index a1366af2c28..43f57375a4e 100644 --- a/mysql-test/include/index_merge1.inc +++ b/mysql-test/include/index_merge1.inc @@ -153,12 +153,22 @@ explain select * from t0 where (((key3 <7 and key7 < 6) or key5 < 2) and (key5 < 5 or key6 < 6)); explain select * from t0 where - ((key3 <5 or key5 < 4) and (key1 < 4 or key2 < 4)) + ((key3 < 4 or key5 < 4) and (key1 < 4 or key2 < 4)) or ((key3 >=5 or key5 < 2) and (key5 < 5 or key6 < 6)); explain select * from t0 force index(i1, i2, i3, i4, i5, i6 ) where - ((key3 <5 or key5 < 4) and (key1 < 4 or key2 < 4)) + ((key3 < 4 or key5 < 4) and (key1 < 4 or key2 < 4)) + or + ((key3 >=5 or key5 < 2) and (key5 < 5 or key6 < 6)); + +explain select * from t0 force index(i1, i2, i3, i4, i5, i6 ) where + ((key3 < 5 or key5 < 4) and (key1 < 4 or key2 < 4)) + or + ((key3 >=5 or key5 < 2) and (key5 < 5 or key6 < 6)); + +explain select * from t0 force index(i1, i2, i3, i4, i5, i6 ) where + ((key3 < 10 or key5 < 4) and (key1 < 4 or key2 < 4)) or ((key3 >=5 or key5 < 2) and (key5 < 5 or key6 < 6)); diff --git a/mysql-test/include/is_embedded.inc b/mysql-test/include/is_embedded.inc index b20f21953f0..a440406edd4 100644 --- a/mysql-test/include/is_embedded.inc +++ b/mysql-test/include/is_embedded.inc @@ -1,5 +1,7 @@ +# +# Check if the current used server is an embedded server# +# if (`SELECT VERSION() NOT LIKE '%embedded%'`) { --skip Test requires: embedded server } - diff --git a/mysql-test/include/is_embedded_no_privileges.inc b/mysql-test/include/is_embedded_no_privileges.inc new file mode 100644 index 00000000000..364c697c5a8 --- /dev/null +++ b/mysql-test/include/is_embedded_no_privileges.inc @@ -0,0 +1,16 @@ +# +# Test that we do not have an embedded server compiled with privileges. +# This is not a regular setup, but we are running this in buildbot for +# testing of embedded + privileges. +# Some funcs_1 test cannot handle this combination, which is why we have this +# file to disable them +# + +--source include/is_embedded.inc + +let priv=`SELECT privileges FROM information_schema.columns limit 1`; + +if (`SELECT "$priv" <> ""`) +{ + --skip Embedded server is compiled with privileges; Test disabled. +} diff --git a/mysql-test/include/not_windows_embedded.inc b/mysql-test/include/not_windows_embedded.inc index 46f5e0ccfce..50ff0f80c7d 100644 --- a/mysql-test/include/not_windows_embedded.inc +++ b/mysql-test/include/not_windows_embedded.inc @@ -1,10 +1,8 @@ let $is_win = `select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows")`; -let $is_embedded = `select version() like '%embedded%'`; #echo is_win: $is_win; -#echo is_embedded: $is_embedded; if ($is_win) { - if ($is_embedded) + if(!$MYSQL_EMBEDDED) { skip Not supported with embedded on windows; } diff --git a/mysql-test/lib/My/Options.pm b/mysql-test/lib/My/Options.pm index 5827e0666a6..b3ae64cb4c2 100644 --- a/mysql-test/lib/My/Options.pm +++ b/mysql-test/lib/My/Options.pm @@ -142,11 +142,11 @@ sub diff { sub is_subset { my ($set, $subset)= @_; - my %cache = map { _split_option($_) } @$set; + my %cache = map { join('=', _split_option($_)), 1 } @$set; for (@$subset){ my ($name, $value)= _split_option($_); - return 0 unless exists $cache{$name} and $cache{$name} eq $value; + return 0 unless $cache{"$name=$value"}; } return 1; diff --git a/mysql-test/main/alter_user.result b/mysql-test/main/alter_user.result index 0bbf0aa6788..7cca2db0e5e 100644 --- a/mysql-test/main/alter_user.result +++ b/mysql-test/main/alter_user.result @@ -112,4 +112,14 @@ select * from mysql.user where user = 'foo'; Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv Delete_history_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin authentication_string password_expired is_role default_role max_statement_time % foo *88C89BE093D4ECF72D039F62EBB7477EA1FD4D63 N N N N N N N N N N N N N N N N N N N N N N N N N Y N N N N SPECIFIED text foo_issuer foo_subject 10 20 30 40 mysql_native_password *88C89BE093D4ECF72D039F62EBB7477EA1FD4D63 N N 0.000000 drop user foo; +# +# Bug #29882299: ALTER USER ... IDENTIFIED WITH ... BY ... SHOULD BE A PRIVILEGED OPERATION +# +create user foo@localhost; +connect x,localhost,foo; +alter user current_user identified with 'something'; +ERROR 42000: Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation +connection default; +disconnect x; +drop user foo@localhost; update mysql.global_priv set priv=@root_priv where user='root' and host='localhost'; diff --git a/mysql-test/main/alter_user.test b/mysql-test/main/alter_user.test index 37f77c26496..95e6d732907 100644 --- a/mysql-test/main/alter_user.test +++ b/mysql-test/main/alter_user.test @@ -106,4 +106,15 @@ alter user foo with MAX_QUERIES_PER_HOUR 10 select * from mysql.user where user = 'foo'; drop user foo; +--echo # +--echo # Bug #29882299: ALTER USER ... IDENTIFIED WITH ... BY ... SHOULD BE A PRIVILEGED OPERATION +--echo # +create user foo@localhost; +--connect x,localhost,foo +--error ER_SPECIFIC_ACCESS_DENIED_ERROR +alter user current_user identified with 'something'; +--connection default +--disconnect x +drop user foo@localhost; + update mysql.global_priv set priv=@root_priv where user='root' and host='localhost'; diff --git a/mysql-test/main/create.result b/mysql-test/main/create.result index 299fdfc9b41..acef8b73074 100644 --- a/mysql-test/main/create.result +++ b/mysql-test/main/create.result @@ -1071,58 +1071,58 @@ create table t1 like information_schema.processlist; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `ID` bigint(4) NOT NULL DEFAULT 0, - `USER` varchar(128) NOT NULL DEFAULT '', - `HOST` varchar(64) NOT NULL DEFAULT '', - `DB` varchar(64) DEFAULT NULL, - `COMMAND` varchar(16) NOT NULL DEFAULT '', - `TIME` int(7) NOT NULL DEFAULT 0, - `STATE` varchar(64) DEFAULT NULL, - `INFO` longtext DEFAULT NULL, - `TIME_MS` decimal(22,3) NOT NULL DEFAULT 0.000, - `STAGE` tinyint(2) NOT NULL DEFAULT 0, - `MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0, - `PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000, - `MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, - `MAX_MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, - `EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0, - `QUERY_ID` bigint(4) NOT NULL DEFAULT 0, - `INFO_BINARY` blob DEFAULT NULL, - `TID` bigint(4) NOT NULL DEFAULT 0 + `ID` bigint(4) NOT NULL, + `USER` varchar(128) NOT NULL, + `HOST` varchar(64) NOT NULL, + `DB` varchar(64), + `COMMAND` varchar(16) NOT NULL, + `TIME` int(7) NOT NULL, + `STATE` varchar(64), + `INFO` longtext, + `TIME_MS` decimal(22,3) NOT NULL, + `STAGE` tinyint(2) NOT NULL, + `MAX_STAGE` tinyint(2) NOT NULL, + `PROGRESS` decimal(7,3) NOT NULL, + `MEMORY_USED` bigint(7) NOT NULL, + `MAX_MEMORY_USED` bigint(7) NOT NULL, + `EXAMINED_ROWS` int(7) NOT NULL, + `QUERY_ID` bigint(4) NOT NULL, + `INFO_BINARY` blob, + `TID` bigint(4) NOT NULL ) DEFAULT CHARSET=utf8mb3 drop table t1; create temporary table t1 like information_schema.processlist; show create table t1; Table Create Table t1 CREATE TEMPORARY TABLE `t1` ( - `ID` bigint(4) NOT NULL DEFAULT 0, - `USER` varchar(128) NOT NULL DEFAULT '', - `HOST` varchar(64) NOT NULL DEFAULT '', - `DB` varchar(64) DEFAULT NULL, - `COMMAND` varchar(16) NOT NULL DEFAULT '', - `TIME` int(7) NOT NULL DEFAULT 0, - `STATE` varchar(64) DEFAULT NULL, - `INFO` longtext DEFAULT NULL, - `TIME_MS` decimal(22,3) NOT NULL DEFAULT 0.000, - `STAGE` tinyint(2) NOT NULL DEFAULT 0, - `MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0, - `PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000, - `MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, - `MAX_MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, - `EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0, - `QUERY_ID` bigint(4) NOT NULL DEFAULT 0, - `INFO_BINARY` blob DEFAULT NULL, - `TID` bigint(4) NOT NULL DEFAULT 0 + `ID` bigint(4) NOT NULL, + `USER` varchar(128) NOT NULL, + `HOST` varchar(64) NOT NULL, + `DB` varchar(64), + `COMMAND` varchar(16) NOT NULL, + `TIME` int(7) NOT NULL, + `STATE` varchar(64), + `INFO` longtext, + `TIME_MS` decimal(22,3) NOT NULL, + `STAGE` tinyint(2) NOT NULL, + `MAX_STAGE` tinyint(2) NOT NULL, + `PROGRESS` decimal(7,3) NOT NULL, + `MEMORY_USED` bigint(7) NOT NULL, + `MAX_MEMORY_USED` bigint(7) NOT NULL, + `EXAMINED_ROWS` int(7) NOT NULL, + `QUERY_ID` bigint(4) NOT NULL, + `INFO_BINARY` blob, + `TID` bigint(4) NOT NULL ) DEFAULT CHARSET=utf8mb3 drop table t1; create table t1 like information_schema.character_sets; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '', - `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '', - `DESCRIPTION` varchar(60) NOT NULL DEFAULT '', - `MAXLEN` bigint(3) NOT NULL DEFAULT 0 + `CHARACTER_SET_NAME` varchar(32) NOT NULL, + `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL, + `DESCRIPTION` varchar(60) NOT NULL, + `MAXLEN` bigint(3) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 drop table t1; diff --git a/mysql-test/main/ctype_sjis.result b/mysql-test/main/ctype_sjis.result index 3914bdaf179..c055697d2cf 100644 --- a/mysql-test/main/ctype_sjis.result +++ b/mysql-test/main/ctype_sjis.result @@ -19567,6 +19567,22 @@ SET DEFAULT_STORAGE_ENGINE=Default; # End of 10.2 tests # # +# Start of 10.4 tests +# +# +# MDEV-26953 Assertion `!str || str != Ptr || !is_alloced()' failed in String::copy upon SELECT with sjis +# +SET NAMES sjis; +CREATE TABLE t (a VARCHAR(3)); +INSERT INTO t VALUES (''),(''); +SELECT GROUP_CONCAT(PASSWORD(a)) AS f FROM t; +f +, +DROP TABLE t; +# +# End of 10.4 tests +# +# # Start of 10.5 tests # # @@ -19586,12 +19602,6 @@ EXECUTE IMMEDIATE _cp1257 0xD182; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '_0143_201A' at line 1 SET NAMES sjis; # -# End of 10.5 tests -# -# -# Start of 10.5 tests -# -# # MDEV-22625 SIGSEGV in intern_find_sys_var (optimized builds) # SET NAMES sjis; diff --git a/mysql-test/main/ctype_sjis.test b/mysql-test/main/ctype_sjis.test index d255b6267fd..f8622ab2996 100644 --- a/mysql-test/main/ctype_sjis.test +++ b/mysql-test/main/ctype_sjis.test @@ -264,6 +264,24 @@ let $coll_pad='sjis_bin'; --echo # --echo # +--echo # Start of 10.4 tests +--echo # + +--echo # +--echo # MDEV-26953 Assertion `!str || str != Ptr || !is_alloced()' failed in String::copy upon SELECT with sjis +--echo # + +SET NAMES sjis; +CREATE TABLE t (a VARCHAR(3)); +INSERT INTO t VALUES (''),(''); +SELECT GROUP_CONCAT(PASSWORD(a)) AS f FROM t; +DROP TABLE t; + +--echo # +--echo # End of 10.4 tests +--echo # + +--echo # --echo # Start of 10.5 tests --echo # @@ -288,16 +306,6 @@ EXECUTE IMMEDIATE _cp1257 0xD182; SET NAMES sjis; - ---echo # ---echo # End of 10.5 tests ---echo # - - ---echo # ---echo # Start of 10.5 tests ---echo # - --echo # --echo # MDEV-22625 SIGSEGV in intern_find_sys_var (optimized builds) --echo # diff --git a/mysql-test/main/derived.result b/mysql-test/main/derived.result index 006f41236f5..b6310f1a09f 100644 --- a/mysql-test/main/derived.result +++ b/mysql-test/main/derived.result @@ -1207,6 +1207,59 @@ REPLACE INTO v2 ( SELECT * FROM v4 ) UNION ( SELECT f FROM v2 ); drop view v1,v2,v3,v4; drop table t1,t2,t3; # +# MDEV-20325: Assertion `outer_context || !*from_field || *from_field == not_found_field' failed in Item_field::fix_outer_field | `!derived->is_excluded()' failed in TABLE_LIST::set_check_materialized | SIGEGV in st_select_lex::mark_as_dependent (optimized builds) +# +CREATE TABLE t1 (a INT); +# Check that re-execution of a stored routine containing +# a query with subquery in the FROM clause doesn't result in +# assert failure in case the 'derived_merge' optimizer option +# has been turned on/off +CREATE PROCEDURE sp() SELECT * FROM (SELECT a FROM t1) tb; +CALL sp(); +a +SET optimizer_switch='derived_merge=off'; +# Without the patch the following statement would result in assert +# failure +CALL sp(); +a +# Check the same test case for Prepared Statement +SET optimizer_switch='derived_merge=on'; +PREPARE stmt FROM "SELECT * FROM (SELECT a FROM t1) tb"; +EXECUTE stmt; +a +SET optimizer_switch='derived_merge=off'; +# Without the patch the following statement would result in assert +# failure +EXECUTE stmt; +a +DEALLOCATE PREPARE stmt; +# Here check the reverse test case - first turn off the 'derived_merge' +# optimizer option, run the stored routine containing a query with +# subquery in the FROM clause, then turn on the 'derived_merge' +# optimizer option and re-execute the same stored routine to check that +# the routine is finished successfully. +CREATE PROCEDURE sp1() SELECT * FROM (SELECT a FROM t1) tb; +SET optimizer_switch='derived_merge=off'; +CALL sp1(); +a +SET optimizer_switch='derived_merge=on'; +CALL sp1(); +a +# Check the same test case for Prepared Statement +SET optimizer_switch='derived_merge=off'; +PREPARE stmt FROM "SELECT * FROM (SELECT a FROM t1) tb"; +EXECUTE stmt; +a +SET optimizer_switch='derived_merge=on'; +# Without the patch the following statement would result in assert +# failure +EXECUTE stmt; +a +DEALLOCATE PREPARE stmt; +DROP PROCEDURE sp; +DROP PROCEDURE sp1; +DROP TABLE t1; +# # End of 10.2 tests # # diff --git a/mysql-test/main/derived.test b/mysql-test/main/derived.test index 0d2efca1a26..904114e33b9 100644 --- a/mysql-test/main/derived.test +++ b/mysql-test/main/derived.test @@ -1043,6 +1043,57 @@ drop view v1,v2,v3,v4; drop table t1,t2,t3; --echo # +--echo # MDEV-20325: Assertion `outer_context || !*from_field || *from_field == not_found_field' failed in Item_field::fix_outer_field | `!derived->is_excluded()' failed in TABLE_LIST::set_check_materialized | SIGEGV in st_select_lex::mark_as_dependent (optimized builds) +--echo # +CREATE TABLE t1 (a INT); + +--echo # Check that re-execution of a stored routine containing +--echo # a query with subquery in the FROM clause doesn't result in +--echo # assert failure in case the 'derived_merge' optimizer option +--echo # has been turned on/off +CREATE PROCEDURE sp() SELECT * FROM (SELECT a FROM t1) tb; +CALL sp(); +SET optimizer_switch='derived_merge=off'; +--echo # Without the patch the following statement would result in assert +--echo # failure +CALL sp(); + +--echo # Check the same test case for Prepared Statement +SET optimizer_switch='derived_merge=on'; +PREPARE stmt FROM "SELECT * FROM (SELECT a FROM t1) tb"; +EXECUTE stmt; +SET optimizer_switch='derived_merge=off'; +--echo # Without the patch the following statement would result in assert +--echo # failure +EXECUTE stmt; +DEALLOCATE PREPARE stmt; + +--echo # Here check the reverse test case - first turn off the 'derived_merge' +--echo # optimizer option, run the stored routine containing a query with +--echo # subquery in the FROM clause, then turn on the 'derived_merge' +--echo # optimizer option and re-execute the same stored routine to check that +--echo # the routine is finished successfully. +CREATE PROCEDURE sp1() SELECT * FROM (SELECT a FROM t1) tb; +SET optimizer_switch='derived_merge=off'; +CALL sp1(); +SET optimizer_switch='derived_merge=on'; +CALL sp1(); + +--echo # Check the same test case for Prepared Statement +SET optimizer_switch='derived_merge=off'; +PREPARE stmt FROM "SELECT * FROM (SELECT a FROM t1) tb"; +EXECUTE stmt; +SET optimizer_switch='derived_merge=on'; +--echo # Without the patch the following statement would result in assert +--echo # failure +EXECUTE stmt; +DEALLOCATE PREPARE stmt; + +DROP PROCEDURE sp; +DROP PROCEDURE sp1; +DROP TABLE t1; + +--echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result index b3a4dc4c253..7998ac7d4f7 100644 --- a/mysql-test/main/derived_cond_pushdown.result +++ b/mysql-test/main/derived_cond_pushdown.result @@ -17469,7 +17469,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 1 PRIMARY <derived2> ref key0 key0 5 test.t3.id 2 3 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 -2 LATERAL DERIVED cp2 ref a a 5 test.t1.a 1 Using index +2 LATERAL DERIVED cp2 ref a a 5 test.t1.a 1 Using where; Using index explain format=json select * from t1, (select a from t1 cp2 group by a) dt, t3 where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2); EXPLAIN @@ -17542,6 +17542,7 @@ EXPLAIN "ref": ["test.t1.a"], "rows": 1, "filtered": 100, + "attached_condition": "cp2.a = t3.`id`", "using_index": true } } @@ -17561,6 +17562,612 @@ id a a id 21 2 2 2 deallocate prepare stmt; drop table t1,t2,t3; +# +# MDEV-MDEV-27132: Splittable derived with equality in WHERE +# +CREATE TABLE t1 ( +id int PRIMARY KEY +) ENGINE=MyISAM; +INSERT INTO t1 VALUES +(-1),(2070),(4826),(4827),(4828),(4829),(4830),(4831),(4832),(4833),(4834), +(4835),(4836),(4837),(4838),(4839),(4840),(4841),(4842),(4843),(4844), +(4845),(4846),(4847),(4848),(4849),(4850),(4851),(4852),(4853),(4854), +(4855),(4856),(4857),(4858),(4859),(4860),(4861),(4862),(4863),(4864), +(4865),(4866),(4867),(4868),(4869),(4870),(4871),(4872),(4873),(4874), +(4875),(4876); +CREATE TABLE t2 ( +id int PRIMARY KEY AUTO_INCREMENT, +deleted int(1), +t1_id int, +email varchar(255), +reporting_person int(1), +KEY t1_id (t1_id) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES +(1,0,2064,'1test@test.ee',1),(2,1626095588,2066,'2test@test.ee',1), +(3,0,2066,'3test@test.ee',1),(4,0,2068,'4test@test.ee',1), +(5,0,2068,'5test@test.ee',1),(6,0,2069,'6test@test.ee',1),(7,0,2070,'',0), +(8,0,2070,'',0),(9,0,2071,'',0),(10,0,2071,'',0),(11,0,2072,'',0), +(12,0,2072,'',0),(13,0,2072,'13test@test.ee',1),(14,0,2073,'14test@test.ee',1), +(15,0,2074,'15test@test.ee',1),(16,0,2075,'16test@test.ee',1),(17,0,2075,'',0), +(18,0,2075,'',0),(19,0,2076,'19test@test.ee',1),(20,0,2077,'',0), +(21,0,2078,'21test@test.ee',1),(22,0,2078,'22test@test.ee',1); +INSERT INTO t2(deleted, t1_id, email, reporting_person) +SELECT deleted, t1_id, email, reporting_person FROM t2; +INSERT INTO t2(deleted, t1_id, email, reporting_person) +SELECT deleted, t1_id+10000, email, reporting_person FROM t2; +INSERT INTO t2(deleted, t1_id, email, reporting_person) +SELECT deleted, t1_id+20000, email, reporting_person FROM t2; +INSERT INTO t2(deleted, t1_id, email, reporting_person) +SELECT deleted, t1_id+40000, email, reporting_person FROM t2; +INSERT INTO t2(deleted, t1_id, email, reporting_person) +SELECT deleted, t1_id+80000, email, reporting_person FROM t2; +INSERT INTO t2(deleted, t1_id, email, reporting_person) +SELECT deleted, t1_id+160000, email, reporting_person FROM t2; +CREATE TABLE t3 ( +id int PRIMARY KEY, +deleted int, +t1_id int, +YEAR int(4), +quarter int(1), +KEY t1_id (t1_id,year,quarter) +) ENGINE=MyISAM; +INSERT INTO t3 VALUES +(1,0,3885,2020,1),(2,0,2064,2020,1),(3,1611670734,2225,2020,1), +(4,0,2070,2020,1),(5,1611055981,2095,2020,1),(6,1610970096,2102,2020,1), +(7,0,3974,2020,1),(153,1609851928,3892,2020,2),(154,0,3885,2020,2), +(155,0,2064,2020,2),(156,1611670717,2225,2020,2),(157,0,2070,2020,2), +(317,0,2257,2020,2),(318,0,3885,2020,3),(319,0,2064,2020,3), +(320,1611670709,2225,2020,3),(321,0,2070,2020,3),(322,0,2095,2020,3), +(323,0,2102,2020,3),(324,0,3974,2020,3),(325,0,3886,2020,3), +(326,1609939963,2104,2020,3),(327,0,3887,2020,3),(328,0,3888,2020,3), +(329,0,2148,2020,3),(330,0,3889,2020,3),(331,0,3890,2020,3), +(332,0,2179,2020,3),(333,0,2115,2020,3),(334,0,2193,2020,3), +(335,0,2213,2020,3),(336,0,3891,2020,3),(337,1609851955,3892,2020,3), +(338,1610447706,2232,2020,3),(339,0,2235,2020,3),(340,0,2237,2020,3), +(341,0,3972,2020,3),(342,1610449357,2242,2020,3),(343,0,3893,2020,3), +(344,0,2257,2020,3),(345,0,3951,2020,3),(346,0,3894,2020,3), +(347,0,3912,2020,3),(348,0,3895,2020,3),(349,0,2301,2020,3), +(350,0,2304,2020,3),(351,0,3896,2020,3); +ANALYZE TABLE t1,t2,t3; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status OK +test.t3 analyze status Engine-independent statistics collected +test.t3 analyze status OK +set optimizer_switch='split_materialized=on'; +SELECT t1.id +FROM t1 +JOIN t3 +ON t3.t1_id = t1.id +JOIN (SELECT t1_id FROM t2 WHERE reporting_person = 1 GROUP BY t1_id) tx +ON tx.t1_id = t1.id +WHERE t1.id BETWEEN 200 AND 100000; +id +EXPLAIN SELECT t1.id +FROM t1 +JOIN t3 +ON t3.t1_id = t1.id +JOIN (SELECT t1_id FROM t2 WHERE reporting_person = 1 GROUP BY t1_id) tx +ON tx.t1_id = t1.id +WHERE t1.id BETWEEN 200 AND 100000; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 range t1_id t1_id 5 NULL 47 Using where; Using index +1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.t1_id 1 Using index +1 PRIMARY <derived2> ref key0 key0 5 test.t3.t1_id 2 +2 LATERAL DERIVED t2 ref t1_id t1_id 5 test.t1.id 3 Using index condition; Using where +EXPLAIN FORMAT=JSON SELECT t1.id +FROM t1 +JOIN t3 +ON t3.t1_id = t1.id +JOIN (SELECT t1_id FROM t2 WHERE reporting_person = 1 GROUP BY t1_id) tx +ON tx.t1_id = t1.id +WHERE t1.id BETWEEN 200 AND 100000; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "t3", + "access_type": "range", + "possible_keys": ["t1_id"], + "key": "t1_id", + "key_length": "5", + "used_key_parts": ["t1_id"], + "rows": 47, + "filtered": 100, + "attached_condition": "t3.t1_id between 200 and 100000 and t3.t1_id is not null", + "using_index": true + }, + "table": { + "table_name": "t1", + "access_type": "eq_ref", + "possible_keys": ["PRIMARY"], + "key": "PRIMARY", + "key_length": "4", + "used_key_parts": ["id"], + "ref": ["test.t3.t1_id"], + "rows": 1, + "filtered": 100, + "using_index": true + }, + "table": { + "table_name": "<derived2>", + "access_type": "ref", + "possible_keys": ["key0"], + "key": "key0", + "key_length": "5", + "used_key_parts": ["t1_id"], + "ref": ["test.t3.t1_id"], + "rows": 2, + "filtered": 100, + "materialized": { + "lateral": 1, + "query_block": { + "select_id": 2, + "table": { + "table_name": "t2", + "access_type": "ref", + "possible_keys": ["t1_id"], + "key": "t1_id", + "key_length": "5", + "used_key_parts": ["t1_id"], + "ref": ["test.t1.id"], + "rows": 3, + "filtered": 58.59375, + "index_condition": "t2.t1_id between 200 and 100000 and t2.t1_id = t3.t1_id", + "attached_condition": "t2.reporting_person = 1" + } + } + } + } + } +} +set optimizer_switch='split_materialized=off'; +SELECT t1.id +FROM t1 +JOIN t3 +ON t3.t1_id = t1.id +JOIN (SELECT t1_id FROM t2 WHERE reporting_person = 1 GROUP BY t1_id) tx +ON tx.t1_id = t1.id +WHERE t1.id BETWEEN 200 AND 100000; +id +set optimizer_switch='split_materialized=default'; +DROP TABLE t1,t2,t3; +# +# MDEV-27510: Splittable derived with grouping over two tables +# +CREATE TABLE ledgers ( +id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +name VARCHAR(32) +) ENGINE=MyISAM; +CREATE TABLE charges ( +id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +from_ledger_id BIGINT UNSIGNED NOT NULL, +to_ledger_id BIGINT UNSIGNED NOT NULL, +amount INT NOT NULL, +KEY fk_charge_from_ledger (from_ledger_id), +KEY fk_charge_to_ledger (to_ledger_id) +) ENGINE=MyISAM; +CREATE TABLE transactions ( +id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +ledger_id BIGINT UNSIGNED NOT NULL, +KEY fk_transactions_ledger (ledger_id) +) ENGINE=MyISAM; +CREATE TABLE transaction_items ( +id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +transaction_id BIGINT UNSIGNED NOT NULL, +charge_id BIGINT UNSIGNED, +amount INT NOT NULL, +KEY fk_items_transaction (transaction_id), +KEY fk_items_charge (charge_id) +) ENGINE=MyISAM; +INSERT INTO ledgers (id, name) VALUES +(1, 'Anna'), (2, 'John'), (3, 'Fred'); +INSERT INTO charges (id, from_ledger_id, to_ledger_id, amount) VALUES +(1, 2, 1, 200), (2, 1, 2, 330), (3, 1, 2, 640), (4, 3, 1, 640), (5, 3, 2, 1000), +(6, 3, 1, 660), (7, 2, 3, 650), (8, 3, 2, 160), (9, 2, 1, 740), (10, 3, 2, 310), +(11, 2, 1, 640), (12, 3, 2, 240), (13, 3, 2, 340), (14, 2, 1, 720), +(15, 2, 3, 100), +(16, 2, 3, 980), (17, 2, 1, 80), (18, 1, 2, 760), (19, 2, 3, 740), +(20, 2, 1, 990); +INSERT INTO transactions (id, ledger_id) VALUES +(2, 1), (3, 1), (5, 1), (8, 1), (12, 1), (18, 1), (22, 1), (28, 1), +(34, 1), (35, 1), +(40, 1), (1, 2), (4, 2), (6, 2), (10, 2), (13, 2), (16, 2), (17, 2), +(20, 2), (21, 2), +(24, 2), (26, 2), (27, 2), (29, 2), (31, 2), (33, 2), (36, 2), (37, 2), +(39, 2), (7, 3), +(9, 3), (11, 3), (14, 3), (15, 3), (19, 3), (23, 3), (25, 3), (30, 3), +(32, 3), (38, 3); +INSERT INTO transaction_items (id, transaction_id, charge_id, amount) VALUES +(1, 1, 1, -200), (2, 2, 1, 200), (3, 3, 2, -330), (4, 4, 2, 330), +(5, 5, 3, -640), +(6, 6, 3, 640), (7, 7, 4, -640), (8, 8, 4, 640), (9, 9, 5, -1000), +(10, 10, 5, 1000), +(11, 11, 6, -660), (12, 12, 6, 660), (13, 13, 7, -650), (14, 14, 7, 650), +(15, 15, 8, -160), +(16, 16, 8, 160), (17, 17, 9, -740), (18, 18, 9, 740), (19, 19, 10, -310), +(20, 20, 10, 310), +(21, 21, 11, -640), (22, 22, 11, 640), (23, 23, 12, -240), (24, 24, 12, 240), +(25, 25, 13, -340), +(26, 26, 13, 340), (27, 27, 14, -720), (28, 28, 14, 720), (29, 29, 15, -100), +(30, 30, 15, 100), +(31, 31, 16, -980), (32, 32, 16, 980), (33, 33, 17, -80), (34, 34, 17, 80), +(35, 35, 18, -760), +(36, 36, 18, 760), (37, 37, 19, -740), (38, 38, 19, 740), (39, 39, 20, -990), +(40, 40, 20, 990); +ANALYZE TABLE ledgers, charges, transactions, transaction_items; +Table Op Msg_type Msg_text +test.ledgers analyze status Engine-independent statistics collected +test.ledgers analyze status OK +test.charges analyze status Engine-independent statistics collected +test.charges analyze status OK +test.transactions analyze status Engine-independent statistics collected +test.transactions analyze status OK +test.transaction_items analyze status Engine-independent statistics collected +test.transaction_items analyze status OK +set optimizer_switch='split_materialized=on'; +SELECT +charges.id, +charges.from_ledger_id, +charges.to_ledger_id, +from_agg_items.num_rows AS from_num_rows +FROM charges +INNER JOIN ( +SELECT +transactions.ledger_id, +transaction_items.charge_id, +count(*) as num_rows +FROM transaction_items +INNER JOIN transactions ON transaction_items.transaction_id = transactions.id +GROUP BY transactions.ledger_id, transaction_items.charge_id +) AS from_agg_items +ON from_agg_items.charge_id = charges.id AND +from_agg_items.ledger_id = charges.from_ledger_id +WHERE charges.to_ledger_id = 2; +id from_ledger_id to_ledger_id from_num_rows +2 1 2 1 +3 1 2 1 +5 3 2 1 +8 3 2 1 +10 3 2 1 +12 3 2 1 +13 3 2 1 +18 1 2 1 +EXPLAIN SELECT +charges.id, +charges.from_ledger_id, +charges.to_ledger_id, +from_agg_items.num_rows AS from_num_rows +FROM charges +INNER JOIN ( +SELECT +transactions.ledger_id, +transaction_items.charge_id, +count(*) as num_rows +FROM transaction_items +INNER JOIN transactions ON transaction_items.transaction_id = transactions.id +GROUP BY transactions.ledger_id, transaction_items.charge_id +) AS from_agg_items +ON from_agg_items.charge_id = charges.id AND +from_agg_items.ledger_id = charges.from_ledger_id +WHERE charges.to_ledger_id = 2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY charges ALL PRIMARY,fk_charge_from_ledger,fk_charge_to_ledger NULL NULL NULL 20 Using where +1 PRIMARY <derived2> ref key0 key0 17 test.charges.from_ledger_id,test.charges.id 2 +2 LATERAL DERIVED transaction_items ref fk_items_transaction,fk_items_charge fk_items_charge 9 test.charges.id 2 +2 LATERAL DERIVED transactions eq_ref PRIMARY,fk_transactions_ledger PRIMARY 8 test.transaction_items.transaction_id 1 Using where +EXPLAIN FORMAT=JSON SELECT +charges.id, +charges.from_ledger_id, +charges.to_ledger_id, +from_agg_items.num_rows AS from_num_rows +FROM charges +INNER JOIN ( +SELECT +transactions.ledger_id, +transaction_items.charge_id, +count(*) as num_rows +FROM transaction_items +INNER JOIN transactions ON transaction_items.transaction_id = transactions.id +GROUP BY transactions.ledger_id, transaction_items.charge_id +) AS from_agg_items +ON from_agg_items.charge_id = charges.id AND +from_agg_items.ledger_id = charges.from_ledger_id +WHERE charges.to_ledger_id = 2; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "charges", + "access_type": "ALL", + "possible_keys": ["PRIMARY", "fk_charge_from_ledger", "fk_charge_to_ledger"], + "rows": 20, + "filtered": 40, + "attached_condition": "charges.to_ledger_id = 2" + }, + "table": { + "table_name": "<derived2>", + "access_type": "ref", + "possible_keys": ["key0"], + "key": "key0", + "key_length": "17", + "used_key_parts": ["ledger_id", "charge_id"], + "ref": ["test.charges.from_ledger_id", "test.charges.id"], + "rows": 2, + "filtered": 100, + "materialized": { + "lateral": 1, + "query_block": { + "select_id": 2, + "table": { + "table_name": "transaction_items", + "access_type": "ref", + "possible_keys": ["fk_items_transaction", "fk_items_charge"], + "key": "fk_items_charge", + "key_length": "9", + "used_key_parts": ["charge_id"], + "ref": ["test.charges.id"], + "rows": 2, + "filtered": 100 + }, + "table": { + "table_name": "transactions", + "access_type": "eq_ref", + "possible_keys": ["PRIMARY", "fk_transactions_ledger"], + "key": "PRIMARY", + "key_length": "8", + "used_key_parts": ["id"], + "ref": ["test.transaction_items.transaction_id"], + "rows": 1, + "filtered": 100, + "attached_condition": "transactions.ledger_id = charges.from_ledger_id" + } + } + } + } + } +} +set optimizer_switch='split_materialized=off'; +SELECT +charges.id, +charges.from_ledger_id, +charges.to_ledger_id, +from_agg_items.num_rows AS from_num_rows +FROM charges +INNER JOIN ( +SELECT +transactions.ledger_id, +transaction_items.charge_id, +count(*) as num_rows +FROM transaction_items +INNER JOIN transactions ON transaction_items.transaction_id = transactions.id +GROUP BY transactions.ledger_id, transaction_items.charge_id +) AS from_agg_items +ON from_agg_items.charge_id = charges.id AND +from_agg_items.ledger_id = charges.from_ledger_id +WHERE charges.to_ledger_id = 2; +id from_ledger_id to_ledger_id from_num_rows +2 1 2 1 +3 1 2 1 +5 3 2 1 +8 3 2 1 +10 3 2 1 +12 3 2 1 +13 3 2 1 +18 1 2 1 +EXPLAIN SELECT +charges.id, +charges.from_ledger_id, +charges.to_ledger_id, +from_agg_items.num_rows AS from_num_rows +FROM charges +INNER JOIN ( +SELECT +transactions.ledger_id, +transaction_items.charge_id, +count(*) as num_rows +FROM transaction_items +INNER JOIN transactions ON transaction_items.transaction_id = transactions.id +GROUP BY transactions.ledger_id, transaction_items.charge_id +) AS from_agg_items +ON from_agg_items.charge_id = charges.id AND +from_agg_items.ledger_id = charges.from_ledger_id +WHERE charges.to_ledger_id = 2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY charges ALL PRIMARY,fk_charge_from_ledger,fk_charge_to_ledger NULL NULL NULL 20 Using where +1 PRIMARY <derived2> ref key0 key0 17 test.charges.from_ledger_id,test.charges.id 4 +2 DERIVED transaction_items ALL fk_items_transaction NULL NULL NULL 40 Using temporary; Using filesort +2 DERIVED transactions eq_ref PRIMARY PRIMARY 8 test.transaction_items.transaction_id 1 +INSERT INTO charges (id, from_ledger_id, to_ledger_id, amount) VALUES +(101, 4, 2, 100), (102, 7, 2, 200); +set optimizer_switch='split_materialized=on'; +SELECT +charges.id, +charges.from_ledger_id, +charges.to_ledger_id, +from_agg_items.num_rows AS from_num_rows +FROM charges +LEFT JOIN ( +SELECT +transactions.ledger_id, +transaction_items.charge_id, +count(*) as num_rows +FROM transaction_items +INNER JOIN transactions ON transaction_items.transaction_id = transactions.id +GROUP BY transactions.ledger_id, transaction_items.charge_id +) AS from_agg_items +ON from_agg_items.charge_id = charges.id AND +from_agg_items.ledger_id = charges.from_ledger_id +WHERE charges.to_ledger_id = 2; +id from_ledger_id to_ledger_id from_num_rows +2 1 2 1 +3 1 2 1 +5 3 2 1 +8 3 2 1 +10 3 2 1 +12 3 2 1 +13 3 2 1 +18 1 2 1 +101 4 2 NULL +102 7 2 NULL +EXPLAIN SELECT +charges.id, +charges.from_ledger_id, +charges.to_ledger_id, +from_agg_items.num_rows AS from_num_rows +FROM charges +LEFT JOIN ( +SELECT +transactions.ledger_id, +transaction_items.charge_id, +count(*) as num_rows +FROM transaction_items +INNER JOIN transactions ON transaction_items.transaction_id = transactions.id +GROUP BY transactions.ledger_id, transaction_items.charge_id +) AS from_agg_items +ON from_agg_items.charge_id = charges.id AND +from_agg_items.ledger_id = charges.from_ledger_id +WHERE charges.to_ledger_id = 2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY charges ALL fk_charge_to_ledger NULL NULL NULL 20 Using where +1 PRIMARY <derived2> ref key0 key0 18 test.charges.from_ledger_id,test.charges.id 2 +2 LATERAL DERIVED transaction_items ref fk_items_transaction,fk_items_charge fk_items_charge 9 test.charges.id 2 +2 LATERAL DERIVED transactions eq_ref PRIMARY,fk_transactions_ledger PRIMARY 8 test.transaction_items.transaction_id 1 Using where +EXPLAIN FORMAT=JSON SELECT +charges.id, +charges.from_ledger_id, +charges.to_ledger_id, +from_agg_items.num_rows AS from_num_rows +FROM charges +LEFT JOIN ( +SELECT +transactions.ledger_id, +transaction_items.charge_id, +count(*) as num_rows +FROM transaction_items +INNER JOIN transactions ON transaction_items.transaction_id = transactions.id +GROUP BY transactions.ledger_id, transaction_items.charge_id +) AS from_agg_items +ON from_agg_items.charge_id = charges.id AND +from_agg_items.ledger_id = charges.from_ledger_id +WHERE charges.to_ledger_id = 2; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "charges", + "access_type": "ALL", + "possible_keys": ["fk_charge_to_ledger"], + "rows": 20, + "filtered": 50, + "attached_condition": "charges.to_ledger_id = 2" + }, + "table": { + "table_name": "<derived2>", + "access_type": "ref", + "possible_keys": ["key0"], + "key": "key0", + "key_length": "18", + "used_key_parts": ["ledger_id", "charge_id"], + "ref": ["test.charges.from_ledger_id", "test.charges.id"], + "rows": 2, + "filtered": 100, + "materialized": { + "lateral": 1, + "query_block": { + "select_id": 2, + "table": { + "table_name": "transaction_items", + "access_type": "ref", + "possible_keys": ["fk_items_transaction", "fk_items_charge"], + "key": "fk_items_charge", + "key_length": "9", + "used_key_parts": ["charge_id"], + "ref": ["test.charges.id"], + "rows": 2, + "filtered": 100 + }, + "table": { + "table_name": "transactions", + "access_type": "eq_ref", + "possible_keys": ["PRIMARY", "fk_transactions_ledger"], + "key": "PRIMARY", + "key_length": "8", + "used_key_parts": ["id"], + "ref": ["test.transaction_items.transaction_id"], + "rows": 1, + "filtered": 100, + "attached_condition": "transactions.ledger_id = charges.from_ledger_id" + } + } + } + } + } +} +set optimizer_switch='split_materialized=off'; +SELECT +charges.id, +charges.from_ledger_id, +charges.to_ledger_id, +from_agg_items.num_rows AS from_num_rows +FROM charges +LEFT JOIN ( +SELECT +transactions.ledger_id, +transaction_items.charge_id, +count(*) as num_rows +FROM transaction_items +INNER JOIN transactions ON transaction_items.transaction_id = transactions.id +GROUP BY transactions.ledger_id, transaction_items.charge_id +) AS from_agg_items +ON from_agg_items.charge_id = charges.id AND +from_agg_items.ledger_id = charges.from_ledger_id +WHERE charges.to_ledger_id = 2; +id from_ledger_id to_ledger_id from_num_rows +2 1 2 1 +3 1 2 1 +5 3 2 1 +8 3 2 1 +10 3 2 1 +12 3 2 1 +13 3 2 1 +18 1 2 1 +101 4 2 NULL +102 7 2 NULL +EXPLAIN SELECT +charges.id, +charges.from_ledger_id, +charges.to_ledger_id, +from_agg_items.num_rows AS from_num_rows +FROM charges +LEFT JOIN ( +SELECT +transactions.ledger_id, +transaction_items.charge_id, +count(*) as num_rows +FROM transaction_items +INNER JOIN transactions ON transaction_items.transaction_id = transactions.id +GROUP BY transactions.ledger_id, transaction_items.charge_id +) AS from_agg_items +ON from_agg_items.charge_id = charges.id AND +from_agg_items.ledger_id = charges.from_ledger_id +WHERE charges.to_ledger_id = 2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY charges ALL fk_charge_to_ledger NULL NULL NULL 20 Using where +1 PRIMARY <derived2> ref key0 key0 18 test.charges.from_ledger_id,test.charges.id 4 +2 DERIVED transaction_items ALL fk_items_transaction NULL NULL NULL 40 Using temporary; Using filesort +2 DERIVED transactions eq_ref PRIMARY PRIMARY 8 test.transaction_items.transaction_id 1 +set optimizer_switch='split_materialized=default'; +DROP TABLE transaction_items; +DROP TABLE transactions; +DROP TABLE charges; +DROP TABLE ledgers; # End of 10.3 tests # # MDEV-18679: materialized view with SELECT S containing materialized diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test index d738ed33128..39e82210e4c 100644 --- a/mysql-test/main/derived_cond_pushdown.test +++ b/mysql-test/main/derived_cond_pushdown.test @@ -3629,6 +3629,248 @@ deallocate prepare stmt; drop table t1,t2,t3; +--echo # +--echo # MDEV-MDEV-27132: Splittable derived with equality in WHERE +--echo # + +CREATE TABLE t1 ( + id int PRIMARY KEY +) ENGINE=MyISAM; + +INSERT INTO t1 VALUES +(-1),(2070),(4826),(4827),(4828),(4829),(4830),(4831),(4832),(4833),(4834), +(4835),(4836),(4837),(4838),(4839),(4840),(4841),(4842),(4843),(4844), +(4845),(4846),(4847),(4848),(4849),(4850),(4851),(4852),(4853),(4854), +(4855),(4856),(4857),(4858),(4859),(4860),(4861),(4862),(4863),(4864), +(4865),(4866),(4867),(4868),(4869),(4870),(4871),(4872),(4873),(4874), +(4875),(4876); + +CREATE TABLE t2 ( + id int PRIMARY KEY AUTO_INCREMENT, + deleted int(1), + t1_id int, + email varchar(255), + reporting_person int(1), + KEY t1_id (t1_id) +) ENGINE=MyISAM; + +INSERT INTO t2 VALUES +(1,0,2064,'1test@test.ee',1),(2,1626095588,2066,'2test@test.ee',1), +(3,0,2066,'3test@test.ee',1),(4,0,2068,'4test@test.ee',1), +(5,0,2068,'5test@test.ee',1),(6,0,2069,'6test@test.ee',1),(7,0,2070,'',0), +(8,0,2070,'',0),(9,0,2071,'',0),(10,0,2071,'',0),(11,0,2072,'',0), +(12,0,2072,'',0),(13,0,2072,'13test@test.ee',1),(14,0,2073,'14test@test.ee',1), +(15,0,2074,'15test@test.ee',1),(16,0,2075,'16test@test.ee',1),(17,0,2075,'',0), +(18,0,2075,'',0),(19,0,2076,'19test@test.ee',1),(20,0,2077,'',0), +(21,0,2078,'21test@test.ee',1),(22,0,2078,'22test@test.ee',1); + +INSERT INTO t2(deleted, t1_id, email, reporting_person) + SELECT deleted, t1_id, email, reporting_person FROM t2; +INSERT INTO t2(deleted, t1_id, email, reporting_person) + SELECT deleted, t1_id+10000, email, reporting_person FROM t2; +INSERT INTO t2(deleted, t1_id, email, reporting_person) + SELECT deleted, t1_id+20000, email, reporting_person FROM t2; +INSERT INTO t2(deleted, t1_id, email, reporting_person) + SELECT deleted, t1_id+40000, email, reporting_person FROM t2; +INSERT INTO t2(deleted, t1_id, email, reporting_person) + SELECT deleted, t1_id+80000, email, reporting_person FROM t2; +INSERT INTO t2(deleted, t1_id, email, reporting_person) + SELECT deleted, t1_id+160000, email, reporting_person FROM t2; + +CREATE TABLE t3 ( + id int PRIMARY KEY, + deleted int, + t1_id int, + YEAR int(4), + quarter int(1), + KEY t1_id (t1_id,year,quarter) +) ENGINE=MyISAM; + +INSERT INTO t3 VALUES +(1,0,3885,2020,1),(2,0,2064,2020,1),(3,1611670734,2225,2020,1), +(4,0,2070,2020,1),(5,1611055981,2095,2020,1),(6,1610970096,2102,2020,1), +(7,0,3974,2020,1),(153,1609851928,3892,2020,2),(154,0,3885,2020,2), +(155,0,2064,2020,2),(156,1611670717,2225,2020,2),(157,0,2070,2020,2), +(317,0,2257,2020,2),(318,0,3885,2020,3),(319,0,2064,2020,3), +(320,1611670709,2225,2020,3),(321,0,2070,2020,3),(322,0,2095,2020,3), +(323,0,2102,2020,3),(324,0,3974,2020,3),(325,0,3886,2020,3), +(326,1609939963,2104,2020,3),(327,0,3887,2020,3),(328,0,3888,2020,3), +(329,0,2148,2020,3),(330,0,3889,2020,3),(331,0,3890,2020,3), +(332,0,2179,2020,3),(333,0,2115,2020,3),(334,0,2193,2020,3), +(335,0,2213,2020,3),(336,0,3891,2020,3),(337,1609851955,3892,2020,3), +(338,1610447706,2232,2020,3),(339,0,2235,2020,3),(340,0,2237,2020,3), +(341,0,3972,2020,3),(342,1610449357,2242,2020,3),(343,0,3893,2020,3), +(344,0,2257,2020,3),(345,0,3951,2020,3),(346,0,3894,2020,3), +(347,0,3912,2020,3),(348,0,3895,2020,3),(349,0,2301,2020,3), +(350,0,2304,2020,3),(351,0,3896,2020,3); + +ANALYZE TABLE t1,t2,t3; + +let $q= +SELECT t1.id +FROM t1 + JOIN t3 + ON t3.t1_id = t1.id + JOIN (SELECT t1_id FROM t2 WHERE reporting_person = 1 GROUP BY t1_id) tx + ON tx.t1_id = t1.id +WHERE t1.id BETWEEN 200 AND 100000; + +set optimizer_switch='split_materialized=on'; + +eval $q; +eval EXPLAIN $q; +eval EXPLAIN FORMAT=JSON $q; + +set optimizer_switch='split_materialized=off'; + +eval $q; + +set optimizer_switch='split_materialized=default'; + +DROP TABLE t1,t2,t3; + +--echo # +--echo # MDEV-27510: Splittable derived with grouping over two tables +--echo # + +CREATE TABLE ledgers ( + id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(32) +) ENGINE=MyISAM; + +CREATE TABLE charges ( + id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + from_ledger_id BIGINT UNSIGNED NOT NULL, + to_ledger_id BIGINT UNSIGNED NOT NULL, + amount INT NOT NULL, + KEY fk_charge_from_ledger (from_ledger_id), + KEY fk_charge_to_ledger (to_ledger_id) +) ENGINE=MyISAM; + +CREATE TABLE transactions ( + id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + ledger_id BIGINT UNSIGNED NOT NULL, + KEY fk_transactions_ledger (ledger_id) +) ENGINE=MyISAM; + +CREATE TABLE transaction_items ( + id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + transaction_id BIGINT UNSIGNED NOT NULL, + charge_id BIGINT UNSIGNED, + amount INT NOT NULL, + KEY fk_items_transaction (transaction_id), + KEY fk_items_charge (charge_id) +) ENGINE=MyISAM; + +INSERT INTO ledgers (id, name) VALUES +(1, 'Anna'), (2, 'John'), (3, 'Fred'); + +INSERT INTO charges (id, from_ledger_id, to_ledger_id, amount) VALUES +(1, 2, 1, 200), (2, 1, 2, 330), (3, 1, 2, 640), (4, 3, 1, 640), (5, 3, 2, 1000), +(6, 3, 1, 660), (7, 2, 3, 650), (8, 3, 2, 160), (9, 2, 1, 740), (10, 3, 2, 310), +(11, 2, 1, 640), (12, 3, 2, 240), (13, 3, 2, 340), (14, 2, 1, 720), +(15, 2, 3, 100), +(16, 2, 3, 980), (17, 2, 1, 80), (18, 1, 2, 760), (19, 2, 3, 740), +(20, 2, 1, 990); + +INSERT INTO transactions (id, ledger_id) VALUES +(2, 1), (3, 1), (5, 1), (8, 1), (12, 1), (18, 1), (22, 1), (28, 1), +(34, 1), (35, 1), +(40, 1), (1, 2), (4, 2), (6, 2), (10, 2), (13, 2), (16, 2), (17, 2), +(20, 2), (21, 2), +(24, 2), (26, 2), (27, 2), (29, 2), (31, 2), (33, 2), (36, 2), (37, 2), +(39, 2), (7, 3), +(9, 3), (11, 3), (14, 3), (15, 3), (19, 3), (23, 3), (25, 3), (30, 3), +(32, 3), (38, 3); + +INSERT INTO transaction_items (id, transaction_id, charge_id, amount) VALUES +(1, 1, 1, -200), (2, 2, 1, 200), (3, 3, 2, -330), (4, 4, 2, 330), +(5, 5, 3, -640), +(6, 6, 3, 640), (7, 7, 4, -640), (8, 8, 4, 640), (9, 9, 5, -1000), +(10, 10, 5, 1000), +(11, 11, 6, -660), (12, 12, 6, 660), (13, 13, 7, -650), (14, 14, 7, 650), +(15, 15, 8, -160), +(16, 16, 8, 160), (17, 17, 9, -740), (18, 18, 9, 740), (19, 19, 10, -310), +(20, 20, 10, 310), +(21, 21, 11, -640), (22, 22, 11, 640), (23, 23, 12, -240), (24, 24, 12, 240), +(25, 25, 13, -340), +(26, 26, 13, 340), (27, 27, 14, -720), (28, 28, 14, 720), (29, 29, 15, -100), +(30, 30, 15, 100), +(31, 31, 16, -980), (32, 32, 16, 980), (33, 33, 17, -80), (34, 34, 17, 80), +(35, 35, 18, -760), +(36, 36, 18, 760), (37, 37, 19, -740), (38, 38, 19, 740), (39, 39, 20, -990), +(40, 40, 20, 990); + +ANALYZE TABLE ledgers, charges, transactions, transaction_items; + +let $q= +SELECT + charges.id, + charges.from_ledger_id, + charges.to_ledger_id, + from_agg_items.num_rows AS from_num_rows +FROM charges +INNER JOIN ( + SELECT + transactions.ledger_id, + transaction_items.charge_id, + count(*) as num_rows + FROM transaction_items + INNER JOIN transactions ON transaction_items.transaction_id = transactions.id + GROUP BY transactions.ledger_id, transaction_items.charge_id +) AS from_agg_items +ON from_agg_items.charge_id = charges.id AND + from_agg_items.ledger_id = charges.from_ledger_id +WHERE charges.to_ledger_id = 2; + +set optimizer_switch='split_materialized=on'; +eval $q; +eval EXPLAIN $q; +eval EXPLAIN FORMAT=JSON $q; + +set optimizer_switch='split_materialized=off'; +eval $q; +eval EXPLAIN $q; + +INSERT INTO charges (id, from_ledger_id, to_ledger_id, amount) VALUES +(101, 4, 2, 100), (102, 7, 2, 200); + +let $q1= +SELECT + charges.id, + charges.from_ledger_id, + charges.to_ledger_id, + from_agg_items.num_rows AS from_num_rows +FROM charges +LEFT JOIN ( + SELECT + transactions.ledger_id, + transaction_items.charge_id, + count(*) as num_rows + FROM transaction_items + INNER JOIN transactions ON transaction_items.transaction_id = transactions.id + GROUP BY transactions.ledger_id, transaction_items.charge_id +) AS from_agg_items +ON from_agg_items.charge_id = charges.id AND + from_agg_items.ledger_id = charges.from_ledger_id +WHERE charges.to_ledger_id = 2; + +set optimizer_switch='split_materialized=on'; +eval $q1; +eval EXPLAIN $q1; +eval EXPLAIN FORMAT=JSON $q1; + +set optimizer_switch='split_materialized=off'; +eval $q1; +eval EXPLAIN $q1; + +set optimizer_switch='split_materialized=default'; + +DROP TABLE transaction_items; +DROP TABLE transactions; +DROP TABLE charges; +DROP TABLE ledgers; + --echo # End of 10.3 tests --echo # diff --git a/mysql-test/main/derived_split_innodb.result b/mysql-test/main/derived_split_innodb.result index 21921d86dab..74876836a53 100644 --- a/mysql-test/main/derived_split_innodb.result +++ b/mysql-test/main/derived_split_innodb.result @@ -242,5 +242,49 @@ drop table t1,t2,t3; set optimizer_switch='split_materialized=default'; set use_stat_tables=default; set optimizer_use_condition_selectivity=default; +# +# MDEV-26337: subquery with groupby and ROLLUP returns incorrect results +# (The testcase is taken from testcase for MDEV-13389 due to it being +# much smaller) +# +create table t3 (a int, b int, c char(127), index idx_b(b)) engine=myisam; +insert into t3 values +(8,11,'aa'), (5,15,'cc'), (1,14,'bb'), (2,12,'aa'), (7,17,'cc'), +(7,18,'aa'), (2,11,'aa'), (7,10,'bb'), (3,11,'dd'), (4,12,'ee'), +(5,14,'dd'), (9,12,'ee'); +create table t4 (a int, b int, c char(127), index idx(a,c)) engine=myisam; +insert into t4 values +(7,10,'cc'), (1,20,'aa'), (2,23,'bb'), (7,18,'cc'), (1,30,'bb'), +(4,71,'xx'), (3,15,'aa'), (7,82,'aa'), (8,12,'dd'), (4,15,'aa'), +(11,33,'yy'), (10,42,'zz'), (4,53,'xx'), (10,17,'yy'), (7,12,'cc'), +(8,20,'dd'), (7,32,'bb'), (1,50,'aa'), (3,40,'bb'), (3,77,'aa'); +insert into t4 select a+10, b+10, concat(c,'f') from t4; +analyze table t3,t4; +Table Op Msg_type Msg_text +test.t3 analyze status Engine-independent statistics collected +test.t3 analyze status OK +test.t4 analyze status Engine-independent statistics collected +test.t4 analyze status OK +# This should use a plan with LATERAL DERIVED: +explain select t3.a,t3.c,t.max,t.min +from t3 join +(select a, c, max(b) max, min(b) min from t4 group by a,c) t +on t3.a=t.a and t3.c=t.c +where t3.b > 15; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 range idx_b idx_b 5 NULL 2 Using index condition; Using where +1 PRIMARY <derived2> ref key0 key0 133 test.t3.a,test.t3.c 2 +2 LATERAL DERIVED t4 ref idx idx 133 test.t3.a,test.t3.c 1 +# ... and if one adds WITH ROLLUP, then LATERAL DERIVED is no longer used: +explain select t3.a,t3.c,t.max,t.min +from t3 join +(select a, c, max(b) max, min(b) min from t4 group by a,c with rollup) t +on t3.a=t.a and t3.c=t.c +where t3.b > 15; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 range idx_b idx_b 5 NULL 2 Using index condition; Using where +1 PRIMARY <derived2> ref key0 key0 133 test.t3.a,test.t3.c 4 +2 DERIVED t4 ALL NULL NULL NULL NULL 40 Using filesort +drop table t3, t4; # End of 10.3 tests SET GLOBAL innodb_stats_persistent=@save_innodb_stats_persistent; diff --git a/mysql-test/main/derived_split_innodb.test b/mysql-test/main/derived_split_innodb.test index de25fd8e3d3..1ebe27cd12c 100644 --- a/mysql-test/main/derived_split_innodb.test +++ b/mysql-test/main/derived_split_innodb.test @@ -195,6 +195,42 @@ set optimizer_switch='split_materialized=default'; set use_stat_tables=default; set optimizer_use_condition_selectivity=default; +--echo # +--echo # MDEV-26337: subquery with groupby and ROLLUP returns incorrect results +--echo # (The testcase is taken from testcase for MDEV-13389 due to it being +--echo # much smaller) +--echo # + +create table t3 (a int, b int, c char(127), index idx_b(b)) engine=myisam; +insert into t3 values +(8,11,'aa'), (5,15,'cc'), (1,14,'bb'), (2,12,'aa'), (7,17,'cc'), +(7,18,'aa'), (2,11,'aa'), (7,10,'bb'), (3,11,'dd'), (4,12,'ee'), +(5,14,'dd'), (9,12,'ee'); +create table t4 (a int, b int, c char(127), index idx(a,c)) engine=myisam; +insert into t4 values +(7,10,'cc'), (1,20,'aa'), (2,23,'bb'), (7,18,'cc'), (1,30,'bb'), +(4,71,'xx'), (3,15,'aa'), (7,82,'aa'), (8,12,'dd'), (4,15,'aa'), +(11,33,'yy'), (10,42,'zz'), (4,53,'xx'), (10,17,'yy'), (7,12,'cc'), +(8,20,'dd'), (7,32,'bb'), (1,50,'aa'), (3,40,'bb'), (3,77,'aa'); +insert into t4 select a+10, b+10, concat(c,'f') from t4; +analyze table t3,t4; + +--echo # This should use a plan with LATERAL DERIVED: +explain select t3.a,t3.c,t.max,t.min +from t3 join +(select a, c, max(b) max, min(b) min from t4 group by a,c) t +on t3.a=t.a and t3.c=t.c +where t3.b > 15; + +--echo # ... and if one adds WITH ROLLUP, then LATERAL DERIVED is no longer used: +explain select t3.a,t3.c,t.max,t.min +from t3 join +(select a, c, max(b) max, min(b) min from t4 group by a,c with rollup) t +on t3.a=t.a and t3.c=t.c +where t3.b > 15; + +drop table t3, t4; + --echo # End of 10.3 tests SET GLOBAL innodb_stats_persistent=@save_innodb_stats_persistent; diff --git a/mysql-test/main/derived_view.result b/mysql-test/main/derived_view.result index 3c13cc976aa..46b04201d74 100644 --- a/mysql-test/main/derived_view.result +++ b/mysql-test/main/derived_view.result @@ -2383,8 +2383,6 @@ SELECT * FROM t1; a 1 1 -1 -1 drop table t1,t2; set optimizer_switch=@save968720_optimizer_switch; # @@ -3500,4 +3498,134 @@ a 7 drop view v1; drop table t1; +# +# MDEV-24454 Second execution of SELECT containing set function +# MDEV-25086: whose only argument is an outer reference to a column +# of mergeable view/derived/table/CTE +# +create table t1 (a int); +create table t2 (b int); +insert into t1 values (3), (1), (3); +insert into t2 values (70), (30), (70); +create view v1 as select * from t2; +prepare stmt from " +select (select sum(b) from t1 where a=1) as r from v1; +"; +execute stmt; +r +170 +execute stmt; +r +170 +deallocate prepare stmt; +prepare stmt from " +select (select sum(b) from t1 where a=1) as r from (select * from t2) dt; +"; +execute stmt; +r +170 +execute stmt; +r +170 +deallocate prepare stmt; +prepare stmt from " +with cte as (select * from t2) +select (select sum(b) from t1 where a=1) as r from cte; +"; +execute stmt; +r +170 +execute stmt; +r +170 +deallocate prepare stmt; +prepare stmt from " +select (select sum(b) from t1 where a=1) as r +from (select * from v1 where b > 50) dt; +"; +execute stmt; +r +140 +execute stmt; +r +140 +deallocate prepare stmt; +prepare stmt from " +select (select sum(b) from t1 where a=1) as r +from (select * from (select * from t2) dt1 where b > 50) dt; +"; +execute stmt; +r +140 +execute stmt; +r +140 +deallocate prepare stmt; +prepare stmt from " +with cte as (select * from (select * from t2) dt1 where b > 50) +select (select sum(b) from t1 where a=1) as r from cte; +"; +execute stmt; +r +140 +execute stmt; +r +140 +deallocate prepare stmt; +create procedure sp1() +begin +select (select sum(b) from t1 where a=1) as r from v1; +end | +call sp1(); +r +170 +call sp1(); +r +170 +drop procedure sp1; +create procedure sp1() +begin +select (select sum(b) from t1 where a=1) as r from (select * from t2) dt; +end | +call sp1(); +r +170 +call sp1(); +r +170 +drop procedure sp1; +create procedure sp1() +begin +with cte as (select * from t2) +select (select sum(b) from t1 where a=1) as r from cte; +end | +call sp1(); +r +170 +call sp1(); +r +170 +drop procedure sp1; +drop view v1; +drop table t1,t2; +CREATE TABLE t1(f0 INT); +INSERT INTO t1 VALUES (3); +CREATE VIEW v1 AS SELECT f0 AS f1 FROM t1; +CREATE VIEW v2 AS +SELECT +(SELECT GROUP_CONCAT(v1.f1 SEPARATOR ', ') FROM v1 n) AS f2, +GROUP_CONCAT('aa' SEPARATOR ', ') AS f3 +FROM v1; +CREATE VIEW v3 AS SELECT * FROM v2; +CREATE PROCEDURE p1() +SELECT * FROM v3; +CALL p1(); +f2 f3 +3 aa +CALL p1(); +f2 f3 +3 aa +DROP PROCEDURE p1; +DROP VIEW v1,v2,v3; +DROP TABLE t1; # End of 10.2 tests diff --git a/mysql-test/main/derived_view.test b/mysql-test/main/derived_view.test index 9ab1ddd3a76..584bde2d75d 100644 --- a/mysql-test/main/derived_view.test +++ b/mysql-test/main/derived_view.test @@ -2289,4 +2289,115 @@ select * from ((select a from t1 limit 2) order by a desc) dt; drop view v1; drop table t1; +--echo # +--echo # MDEV-24454 Second execution of SELECT containing set function +--echo # MDEV-25086: whose only argument is an outer reference to a column +--echo # of mergeable view/derived/table/CTE +--echo # + +create table t1 (a int); +create table t2 (b int); +insert into t1 values (3), (1), (3); +insert into t2 values (70), (30), (70); +create view v1 as select * from t2; + +prepare stmt from " +select (select sum(b) from t1 where a=1) as r from v1; +"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +prepare stmt from " +select (select sum(b) from t1 where a=1) as r from (select * from t2) dt; +"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +prepare stmt from " +with cte as (select * from t2) +select (select sum(b) from t1 where a=1) as r from cte; +"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +prepare stmt from " +select (select sum(b) from t1 where a=1) as r +from (select * from v1 where b > 50) dt; +"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +prepare stmt from " +select (select sum(b) from t1 where a=1) as r +from (select * from (select * from t2) dt1 where b > 50) dt; +"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +prepare stmt from " +with cte as (select * from (select * from t2) dt1 where b > 50) +select (select sum(b) from t1 where a=1) as r from cte; +"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +--delimiter | +create procedure sp1() +begin +select (select sum(b) from t1 where a=1) as r from v1; +end | +--delimiter ; +call sp1(); +call sp1(); +drop procedure sp1; + +--delimiter | +create procedure sp1() +begin +select (select sum(b) from t1 where a=1) as r from (select * from t2) dt; +end | +--delimiter ; +call sp1(); +call sp1(); +drop procedure sp1; + +--delimiter | +create procedure sp1() +begin +with cte as (select * from t2) +select (select sum(b) from t1 where a=1) as r from cte; +end | +--delimiter ; +call sp1(); +call sp1(); +drop procedure sp1; + +drop view v1; +drop table t1,t2; + +CREATE TABLE t1(f0 INT); +INSERT INTO t1 VALUES (3); +CREATE VIEW v1 AS SELECT f0 AS f1 FROM t1; +CREATE VIEW v2 AS +SELECT + (SELECT GROUP_CONCAT(v1.f1 SEPARATOR ', ') FROM v1 n) AS f2, + GROUP_CONCAT('aa' SEPARATOR ', ') AS f3 +FROM v1; +CREATE VIEW v3 AS SELECT * FROM v2; + +CREATE PROCEDURE p1() + SELECT * FROM v3; +CALL p1(); +CALL p1(); + +DROP PROCEDURE p1; +DROP VIEW v1,v2,v3; +DROP TABLE t1; + --echo # End of 10.2 tests diff --git a/mysql-test/main/events_embedded.test b/mysql-test/main/events_embedded.test index 9922ea6dfee..f6921f302bf 100644 --- a/mysql-test/main/events_embedded.test +++ b/mysql-test/main/events_embedded.test @@ -2,4 +2,3 @@ --error 1193 set global event_scheduler=ON; - diff --git a/mysql-test/main/explain_innodb.result b/mysql-test/main/explain_innodb.result new file mode 100644 index 00000000000..b46665c279c --- /dev/null +++ b/mysql-test/main/explain_innodb.result @@ -0,0 +1,20 @@ +# +# MDEV-26249: Crash in in Explain_node::print_explain_for_children while writing to the slow query log +# +set @sql_tmp=@@slow_query_log; +SET GLOBAL slow_query_log = 1; +SET long_query_time = 0.000000; +SET log_slow_verbosity = 'explain'; +CREATE TABLE t1 ( id varchar(50), KEY (id)) engine=innodb; +SELECT * FROM (SELECT id FROM t1 GROUP BY id) dt WHERE 1=0; +id +select 1; +1 +1 +explain +SELECT * FROM (SELECT id FROM t1 GROUP BY id) dt WHERE 1=0; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 DERIVED t1 range NULL id 53 NULL 2 Using index for group-by +SET GLOBAL slow_query_log = @sql_tmp; +drop table t1; diff --git a/mysql-test/main/explain_innodb.test b/mysql-test/main/explain_innodb.test new file mode 100644 index 00000000000..2c29a6e26da --- /dev/null +++ b/mysql-test/main/explain_innodb.test @@ -0,0 +1,20 @@ +--echo # +--echo # MDEV-26249: Crash in in Explain_node::print_explain_for_children while writing to the slow query log +--echo # + +--source include/have_innodb.inc + +set @sql_tmp=@@slow_query_log; +SET GLOBAL slow_query_log = 1; +SET long_query_time = 0.000000; +SET log_slow_verbosity = 'explain'; + +CREATE TABLE t1 ( id varchar(50), KEY (id)) engine=innodb; +SELECT * FROM (SELECT id FROM t1 GROUP BY id) dt WHERE 1=0; +select 1; + +explain +SELECT * FROM (SELECT id FROM t1 GROUP BY id) dt WHERE 1=0; + +SET GLOBAL slow_query_log = @sql_tmp; +drop table t1; diff --git a/mysql-test/main/func_default.result b/mysql-test/main/func_default.result index 9699f0795e3..8721270ca1c 100644 --- a/mysql-test/main/func_default.result +++ b/mysql-test/main/func_default.result @@ -29,6 +29,9 @@ INSERT INTO t1 VALUES (1, 'one'), (2, 'two'), (3, 'three'); SELECT s, 32 AS mi FROM t1 GROUP BY s HAVING DEFAULT(mi) IS NULL; ERROR HY000: Field 'mi' doesn't have a default value DROP TABLE t1; +# +# Start of 10.2 tests +# set timestamp=unix_timestamp('2001-01-01 10:20:30.123456'); create table t1 (a int default 1, b int default (a+1), c varchar(100) default 'foo', d text default 'bar', @@ -40,3 +43,121 @@ default(a) default(b) default(c) default(d) default(e) default(f) 1 2 foo bar 2001-01-01 10:20:30 2001-01-01 10:20:30.120000 1 11 foo bar 2001-01-01 10:20:30 2001-01-01 10:20:30.120000 drop table t1; +# +# MDEV-21639 DEFAULT(col) evaluates to a bad value in WHERE clause +# +CREATE TABLE t1 (a BIGINT NOT NULL DEFAULT (IF(false,UNIX_TIMESTAMP(),10))); +INSERT INTO t1 VALUES (10000); +SELECT +a, +DEFAULT(a), +CASE WHEN a THEN DEFAULT(a) END AS c, +CASE WHEN a THEN DEFAULT(a) END = 10 AS ce +FROM t1; +a DEFAULT(a) c ce +10000 10 10 1 +SELECT a FROM t1 WHERE CASE WHEN a THEN DEFAULT(a) END=10; +a +10000 +DROP TABLE t1; +CREATE TABLE t1 (a DOUBLE NOT NULL DEFAULT (IF(false,UNIX_TIMESTAMP(),10))); +INSERT INTO t1 VALUES (10000); +SELECT +a, +DEFAULT(a), +CASE WHEN a THEN DEFAULT(a) END AS c, +CASE WHEN a THEN DEFAULT(a) END = 10 AS ce +FROM t1; +a DEFAULT(a) c ce +10000 10 10 1 +SELECT a FROM t1 WHERE CASE WHEN a THEN DEFAULT(a) END=10; +a +10000 +DROP TABLE t1; +CREATE TABLE t1 (a DECIMAL(10,0) NOT NULL DEFAULT (IF(false,UNIX_TIMESTAMP(),10))); +INSERT INTO t1 VALUES (10000); +SELECT +a, +DEFAULT(a), +CASE WHEN a THEN DEFAULT(a) END AS c, +CASE WHEN a THEN DEFAULT(a) END = 10 AS ce +FROM t1; +a DEFAULT(a) c ce +10000 10 10 1 +SELECT a FROM t1 WHERE CASE WHEN a THEN DEFAULT(a) END=10; +a +10000 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(32) NOT NULL DEFAULT (IF(false,UNIX_TIMESTAMP(),10))); +INSERT INTO t1 VALUES (10000); +SELECT +a, +DEFAULT(a), +CASE WHEN a THEN DEFAULT(a) END AS c, +CASE WHEN a THEN DEFAULT(a) END = '10' AS ce +FROM t1; +a DEFAULT(a) c ce +10000 10 10 1 +SELECT a FROM t1 WHERE CASE WHEN a THEN DEFAULT(a) END='10'; +a +10000 +DROP TABLE t1; +CREATE TABLE t1 (a DATE NOT NULL DEFAULT (IF(false,UNIX_TIMESTAMP()%10,DATE'2001-01-01'))); +INSERT INTO t1 VALUES ('2000-01-01'); +SELECT +a, +DEFAULT(a), +CASE WHEN a THEN DEFAULT(a) END AS c, +CASE WHEN a THEN DEFAULT(a) END = '2001-01-01' AS ce +FROM t1; +a DEFAULT(a) c ce +2000-01-01 2001-01-01 2001-01-01 1 +SELECT a FROM t1 WHERE CASE WHEN a THEN DEFAULT(a) END='2001-01-01'; +a +2000-01-01 +DROP TABLE t1; +CREATE TABLE t1 (a TIME NOT NULL DEFAULT (IF(false,UNIX_TIMESTAMP()%10,TIME'10:20:30'))); +INSERT INTO t1 VALUES ('10:00:00'); +SELECT +a, +DEFAULT(a), +CASE WHEN a THEN DEFAULT(a) END AS c, +CASE WHEN a THEN DEFAULT(a) END = '10:20:30' AS ce +FROM t1; +a DEFAULT(a) c ce +10:00:00 10:20:30 10:20:30 1 +SELECT a FROM t1 WHERE CASE WHEN a THEN DEFAULT(a) END='10:20:30'; +a +10:00:00 +DROP TABLE t1; +CREATE TABLE t1 (a DATETIME NOT NULL DEFAULT (IF(false,UNIX_TIMESTAMP(),TIMESTAMP'2001-01-01 10:20:30'))); +INSERT INTO t1 VALUES ('2000-01-01 10:00:00'); +SELECT +a, +DEFAULT(a), +CASE WHEN a THEN DEFAULT(a) END AS c, +CASE WHEN a THEN DEFAULT(a) END = '2001-01-01 10:20:30' AS ce +FROM t1; +a DEFAULT(a) c ce +2000-01-01 10:00:00 2001-01-01 10:20:30 2001-01-01 10:20:30 1 +SELECT a FROM t1 WHERE CASE WHEN a THEN DEFAULT(a) END='2001-01-01 10:20:30'; +a +2000-01-01 10:00:00 +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL DEFAULT (IF(false,UNIX_TIMESTAMP(),FALSE))); +INSERT INTO t1 VALUES (10); +SELECT +a, +DEFAULT(a), +CASE WHEN a THEN DEFAULT(a) END AS c, +CASE WHEN a THEN DEFAULT(a) END IS FALSE AS ce +FROM t1; +a DEFAULT(a) c ce +10 0 0 1 +SELECT a FROM t1 WHERE CASE WHEN a THEN DEFAULT(a) END IS FALSE; +a +10 +DROP TABLE t1; +# +# End of 10.2 tests +# diff --git a/mysql-test/main/func_default.test b/mysql-test/main/func_default.test index 332bfca021f..cba7842c68f 100644 --- a/mysql-test/main/func_default.test +++ b/mysql-test/main/func_default.test @@ -34,9 +34,9 @@ INSERT INTO t1 VALUES (1, 'one'), (2, 'two'), (3, 'three'); SELECT s, 32 AS mi FROM t1 GROUP BY s HAVING DEFAULT(mi) IS NULL; DROP TABLE t1; -# -# 10.2 tests -# +--echo # +--echo # Start of 10.2 tests +--echo # set timestamp=unix_timestamp('2001-01-01 10:20:30.123456'); create table t1 (a int default 1, b int default (a+1), @@ -46,3 +46,99 @@ insert t1 () values (); insert t1 (a) values (10); select default(a),default(b),default(c),default(d),default(e),default(f) from t1; drop table t1; + +--echo # +--echo # MDEV-21639 DEFAULT(col) evaluates to a bad value in WHERE clause +--echo # + +CREATE TABLE t1 (a BIGINT NOT NULL DEFAULT (IF(false,UNIX_TIMESTAMP(),10))); +INSERT INTO t1 VALUES (10000); +SELECT + a, + DEFAULT(a), + CASE WHEN a THEN DEFAULT(a) END AS c, + CASE WHEN a THEN DEFAULT(a) END = 10 AS ce +FROM t1; +SELECT a FROM t1 WHERE CASE WHEN a THEN DEFAULT(a) END=10; +DROP TABLE t1; + +CREATE TABLE t1 (a DOUBLE NOT NULL DEFAULT (IF(false,UNIX_TIMESTAMP(),10))); +INSERT INTO t1 VALUES (10000); +SELECT + a, + DEFAULT(a), + CASE WHEN a THEN DEFAULT(a) END AS c, + CASE WHEN a THEN DEFAULT(a) END = 10 AS ce +FROM t1; +SELECT a FROM t1 WHERE CASE WHEN a THEN DEFAULT(a) END=10; +DROP TABLE t1; + +CREATE TABLE t1 (a DECIMAL(10,0) NOT NULL DEFAULT (IF(false,UNIX_TIMESTAMP(),10))); +INSERT INTO t1 VALUES (10000); +SELECT + a, + DEFAULT(a), + CASE WHEN a THEN DEFAULT(a) END AS c, + CASE WHEN a THEN DEFAULT(a) END = 10 AS ce +FROM t1; +SELECT a FROM t1 WHERE CASE WHEN a THEN DEFAULT(a) END=10; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(32) NOT NULL DEFAULT (IF(false,UNIX_TIMESTAMP(),10))); +INSERT INTO t1 VALUES (10000); +SELECT + a, + DEFAULT(a), + CASE WHEN a THEN DEFAULT(a) END AS c, + CASE WHEN a THEN DEFAULT(a) END = '10' AS ce +FROM t1; +SELECT a FROM t1 WHERE CASE WHEN a THEN DEFAULT(a) END='10'; +DROP TABLE t1; + +CREATE TABLE t1 (a DATE NOT NULL DEFAULT (IF(false,UNIX_TIMESTAMP()%10,DATE'2001-01-01'))); +INSERT INTO t1 VALUES ('2000-01-01'); +SELECT + a, + DEFAULT(a), + CASE WHEN a THEN DEFAULT(a) END AS c, + CASE WHEN a THEN DEFAULT(a) END = '2001-01-01' AS ce +FROM t1; +SELECT a FROM t1 WHERE CASE WHEN a THEN DEFAULT(a) END='2001-01-01'; +DROP TABLE t1; + +CREATE TABLE t1 (a TIME NOT NULL DEFAULT (IF(false,UNIX_TIMESTAMP()%10,TIME'10:20:30'))); +INSERT INTO t1 VALUES ('10:00:00'); +SELECT + a, + DEFAULT(a), + CASE WHEN a THEN DEFAULT(a) END AS c, + CASE WHEN a THEN DEFAULT(a) END = '10:20:30' AS ce +FROM t1; +SELECT a FROM t1 WHERE CASE WHEN a THEN DEFAULT(a) END='10:20:30'; +DROP TABLE t1; + +CREATE TABLE t1 (a DATETIME NOT NULL DEFAULT (IF(false,UNIX_TIMESTAMP(),TIMESTAMP'2001-01-01 10:20:30'))); +INSERT INTO t1 VALUES ('2000-01-01 10:00:00'); +SELECT + a, + DEFAULT(a), + CASE WHEN a THEN DEFAULT(a) END AS c, + CASE WHEN a THEN DEFAULT(a) END = '2001-01-01 10:20:30' AS ce +FROM t1; +SELECT a FROM t1 WHERE CASE WHEN a THEN DEFAULT(a) END='2001-01-01 10:20:30'; +DROP TABLE t1; + +CREATE TABLE t1 (a INT NOT NULL DEFAULT (IF(false,UNIX_TIMESTAMP(),FALSE))); +INSERT INTO t1 VALUES (10); +SELECT + a, + DEFAULT(a), + CASE WHEN a THEN DEFAULT(a) END AS c, + CASE WHEN a THEN DEFAULT(a) END IS FALSE AS ce +FROM t1; +SELECT a FROM t1 WHERE CASE WHEN a THEN DEFAULT(a) END IS FALSE; +DROP TABLE t1; + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/main/func_group.result b/mysql-test/main/func_group.result index 177f0950a77..6530bbd5893 100644 --- a/mysql-test/main/func_group.result +++ b/mysql-test/main/func_group.result @@ -604,7 +604,7 @@ AME AME explain select min(a1) from t1 where a1 > 'KKK' or a1 < 'XXX'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY 0 NULL 15 Using where; Using index +1 SIMPLE t1 index PRIMARY PRIMARY 3 NULL 15 Using where; Using index explain select min(a1) from t1 where (a1 < 'KKK' or a1 > 'KKK'); id select_type table type possible_keys key key_len ref rows Extra diff --git a/mysql-test/main/func_json.result b/mysql-test/main/func_json.result index 29b996f3066..f9845357d51 100644 --- a/mysql-test/main/func_json.result +++ b/mysql-test/main/func_json.result @@ -940,6 +940,24 @@ SELECT JSON_REPLACE( JSON_DETAILED('["x"]'), '$.a', 'xx' ); JSON_REPLACE( JSON_DETAILED('["x"]'), '$.a', 'xx' ) ["x"] # +# MDEV-18284 JSON casting using JSON_COMPACT doesn't always work +# with values from subqueries +# +CREATE TABLE json_test(a JSON, b JSON); +INSERT INTO json_test VALUES ("[1,2,3]", '{"a":"foo"}'); +SELECT * FROM json_test; +a b +[1,2,3] {"a":"foo"} +SELECT json_object("a", json_compact(a), "b", b) +FROM (SELECT * FROM json_test) AS json_test_values; +json_object("a", json_compact(a), "b", b) +{"a": [1,2,3], "b": {"a":"foo"}} +SELECT json_object("a", json_compact(a), "b", json_compact(b)) +FROM (SELECT * FROM json_test) AS json_test_values; +json_object("a", json_compact(a), "b", json_compact(b)) +{"a": [1,2,3], "b": {"a":"foo"}} +DROP TABLE json_test; +# # End of 10.2 tests # # @@ -1388,6 +1406,15 @@ id materials DROP TABLE t1; DROP TABLE t2; # +# MDEV-27018 IF and COALESCE lose "json" property +# +SELECT json_object('a', if(1, json_object('b', 'c'), json_object('e', 'f'))); +json_object('a', if(1, json_object('b', 'c'), json_object('e', 'f'))) +{"a": {"b": "c"}} +SELECT json_object('a', coalesce(json_object('b', 'c'))); +json_object('a', coalesce(json_object('b', 'c'))) +{"a": {"b": "c"}} +# # MDEV-26054 Server crashes in Item_func_json_arrayagg::get_str_from_field # CREATE TABLE t (a VARCHAR(8)); diff --git a/mysql-test/main/func_json.test b/mysql-test/main/func_json.test index eb84d607430..939f19b0b15 100644 --- a/mysql-test/main/func_json.test +++ b/mysql-test/main/func_json.test @@ -558,6 +558,21 @@ SELECT SELECT JSON_REPLACE( JSON_DETAILED('["x"]'), '$.a', 'xx' ); --echo # +--echo # MDEV-18284 JSON casting using JSON_COMPACT doesn't always work +--echo # with values from subqueries +--echo # + +CREATE TABLE json_test(a JSON, b JSON); +INSERT INTO json_test VALUES ("[1,2,3]", '{"a":"foo"}'); +SELECT * FROM json_test; + +SELECT json_object("a", json_compact(a), "b", b) + FROM (SELECT * FROM json_test) AS json_test_values; +SELECT json_object("a", json_compact(a), "b", json_compact(b)) + FROM (SELECT * FROM json_test) AS json_test_values; +DROP TABLE json_test; + +--echo # --echo # End of 10.2 tests --echo # @@ -880,6 +895,14 @@ DROP TABLE t1; DROP TABLE t2; --echo # +--echo # MDEV-27018 IF and COALESCE lose "json" property +--echo # + +SELECT json_object('a', if(1, json_object('b', 'c'), json_object('e', 'f'))); +SELECT json_object('a', coalesce(json_object('b', 'c'))); + + +--echo # --echo # MDEV-26054 Server crashes in Item_func_json_arrayagg::get_str_from_field --echo # diff --git a/mysql-test/main/func_json_notembedded.result b/mysql-test/main/func_json_notembedded.result new file mode 100644 index 00000000000..be879dfc9d6 --- /dev/null +++ b/mysql-test/main/func_json_notembedded.result @@ -0,0 +1,42 @@ +set global max_allowed_packet=1073741824; +connect u,localhost,root; +# +# MDEV-24909 JSON functions don't respect KILL QUERY / max_statement_time limit +# +set group_concat_max_len= 4294967295; +set @obj=concat_ws('','{', repeat('"a":"b",', 125000000/2), '"c":"d"}'); +set @arr=concat_ws('','[', repeat('1234567,', 125000000/2), '2345678]'); +select length(@obj), length(@arr); +length(@obj) length(@arr) +500000009 500000009 +set max_statement_time=0.0001; +select json_array_append(@arr, '$[0]', 1); +ERROR 70100: Query execution was interrupted (max_statement_time exceeded) +select json_array_insert(@arr, '$[0]', 1); +ERROR 70100: Query execution was interrupted (max_statement_time exceeded) +select json_insert(@obj, '$.meta', 1); +ERROR 70100: Query execution was interrupted (max_statement_time exceeded) +select json_compact(@arr); +ERROR 70100: Query execution was interrupted (max_statement_time exceeded) +select json_detailed(@arr); +ERROR 70100: Query execution was interrupted (max_statement_time exceeded) +select json_loose(@arr); +ERROR 70100: Query execution was interrupted (max_statement_time exceeded) +select json_merge(@obj, @arr); +ERROR 70100: Query execution was interrupted (max_statement_time exceeded) +select json_merge_patch(@obj, @obj); +ERROR 70100: Query execution was interrupted (max_statement_time exceeded) +select json_merge_preserve(@obj, @arr); +ERROR 70100: Query execution was interrupted (max_statement_time exceeded) +select json_remove(@obj,'$.foo'); +ERROR 70100: Query execution was interrupted (max_statement_time exceeded) +select json_replace(@obj,'$.foo',1); +ERROR 70100: Query execution was interrupted (max_statement_time exceeded) +select json_set(@arr,'$[1000]',1); +ERROR 70100: Query execution was interrupted (max_statement_time exceeded) +disconnect u; +connection default; +set global max_allowed_packet=default; +# +# End of 10.6 tests +# diff --git a/mysql-test/main/func_json_notembedded.test b/mysql-test/main/func_json_notembedded.test new file mode 100644 index 00000000000..328d9974c77 --- /dev/null +++ b/mysql-test/main/func_json_notembedded.test @@ -0,0 +1,37 @@ +source include/have_profiling.inc; +source include/not_embedded.inc; + +set global max_allowed_packet=1073741824; +connect u,localhost,root; + +--echo # +--echo # MDEV-24909 JSON functions don't respect KILL QUERY / max_statement_time limit +--echo # +set group_concat_max_len= 4294967295; + +set @obj=concat_ws('','{', repeat('"a":"b",', 125000000/2), '"c":"d"}'); +set @arr=concat_ws('','[', repeat('1234567,', 125000000/2), '2345678]'); +select length(@obj), length(@arr); + +set max_statement_time=0.0001; +disable_abort_on_error; +select json_array_append(@arr, '$[0]', 1); +select json_array_insert(@arr, '$[0]', 1); +select json_insert(@obj, '$.meta', 1); +select json_compact(@arr); +select json_detailed(@arr); +select json_loose(@arr); +select json_merge(@obj, @arr); +select json_merge_patch(@obj, @obj); +select json_merge_preserve(@obj, @arr); +select json_remove(@obj,'$.foo'); +select json_replace(@obj,'$.foo',1); +select json_set(@arr,'$[1000]',1); +enable_abort_on_error; +disconnect u; +connection default; +set global max_allowed_packet=default; + +--echo # +--echo # End of 10.6 tests +--echo # diff --git a/mysql-test/main/func_str.result b/mysql-test/main/func_str.result index ce54d3e85a1..799fd1933dd 100644 --- a/mysql-test/main/func_str.result +++ b/mysql-test/main/func_str.result @@ -5028,6 +5028,59 @@ SELECT NULL IN (RIGHT(AES_ENCRYPT('foo','bar'), LAST_INSERT_ID()), 'qux'); NULL IN (RIGHT(AES_ENCRYPT('foo','bar'), LAST_INSERT_ID()), 'qux') NULL # +# Bug#31374305 - FORMAT() NOT DISPLAYING WHOLE NUMBER SIDE CORRECTLY +# FOR ES_MX AND ES_ES LOCALES +# +CREATE PROCEDURE load_locale_format_table() +BEGIN +DECLARE locale_list VARCHAR(1000) DEFAULT ' + es_AR,es_BO,es_CL,es_CO,es_CR,es_DO,es_EC,es_ES,es_GT,es_HN, + es_MX,es_NI,es_PA,es_PE,es_PR,es_PY,es_SV,es_US,es_UY,es_VE'; +SET @fmt_stmt = 'INSERT INTO locale_format VALUES + (?, FORMAT(12131254123412541,2,?));'; +PREPARE stmt FROM @fmt_stmt; +WHILE locale_list != '' DO +/* get the first locale from the list */ +SET @locale = +TRIM(REPLACE((SUBSTRING_INDEX(locale_list, ',', 1)), '\n','')); +EXECUTE stmt USING @locale, @locale; +/* remove the first locale from the list */ +IF LOCATE(',', locale_list) > 0 THEN +SET locale_list = +SUBSTRING(locale_list, LOCATE(',', locale_list) + 1); +ELSE +SET locale_list = ''; +END IF; +END WHILE; +DEALLOCATE PREPARE stmt; +END| +CREATE TABLE locale_format(locale VARCHAR(10), formatted_string VARCHAR(100)); +CALL load_locale_format_table(); +SELECT * FROM locale_format; +locale formatted_string +es_AR 12.131.254.123.412.541,00 +es_BO 12.131.254.123.412.541,00 +es_CL 12.131.254.123.412.541,00 +es_CO 12.131.254.123.412.541,00 +es_CR 12 131 254 123 412 541,00 +es_DO 12,131,254,123,412,541.00 +es_EC 12.131.254.123.412.541,00 +es_ES 12.131.254.123.412.541,00 +es_GT 12,131,254,123,412,541.00 +es_HN 12,131,254,123,412,541.00 +es_MX 12,131,254,123,412,541.00 +es_NI 12,131,254,123,412,541.00 +es_PA 12,131,254,123,412,541.00 +es_PE 12,131,254,123,412,541.00 +es_PR 12,131,254,123,412,541.00 +es_PY 12.131.254.123.412.541,00 +es_SV 12,131,254,123,412,541.00 +es_US 12,131,254,123,412,541.00 +es_UY 12.131.254.123.412.541,00 +es_VE 12.131.254.123.412.541,00 +DROP PROCEDURE load_locale_format_table; +DROP TABLE locale_format; +# # End of 10.2 tests # # diff --git a/mysql-test/main/func_str.test b/mysql-test/main/func_str.test index 432bc64f769..bbdcead280f 100644 --- a/mysql-test/main/func_str.test +++ b/mysql-test/main/func_str.test @@ -2000,6 +2000,42 @@ DROP TABLE t1; SELECT NULL IN (RIGHT(AES_ENCRYPT('foo','bar'), LAST_INSERT_ID()), 'qux'); +--echo # +--echo # Bug#31374305 - FORMAT() NOT DISPLAYING WHOLE NUMBER SIDE CORRECTLY +--echo # FOR ES_MX AND ES_ES LOCALES +--echo # + +DELIMITER |; +CREATE PROCEDURE load_locale_format_table() +BEGIN + DECLARE locale_list VARCHAR(1000) DEFAULT ' + es_AR,es_BO,es_CL,es_CO,es_CR,es_DO,es_EC,es_ES,es_GT,es_HN, + es_MX,es_NI,es_PA,es_PE,es_PR,es_PY,es_SV,es_US,es_UY,es_VE'; + SET @fmt_stmt = 'INSERT INTO locale_format VALUES + (?, FORMAT(12131254123412541,2,?));'; + PREPARE stmt FROM @fmt_stmt; + WHILE locale_list != '' DO + /* get the first locale from the list */ + SET @locale = + TRIM(REPLACE((SUBSTRING_INDEX(locale_list, ',', 1)), '\n','')); + EXECUTE stmt USING @locale, @locale; + /* remove the first locale from the list */ + IF LOCATE(',', locale_list) > 0 THEN + SET locale_list = + SUBSTRING(locale_list, LOCATE(',', locale_list) + 1); + ELSE + SET locale_list = ''; + END IF; + END WHILE; + DEALLOCATE PREPARE stmt; +END| +DELIMITER ;| + +CREATE TABLE locale_format(locale VARCHAR(10), formatted_string VARCHAR(100)); +CALL load_locale_format_table(); +SELECT * FROM locale_format; +DROP PROCEDURE load_locale_format_table; +DROP TABLE locale_format; --echo # --echo # End of 10.2 tests diff --git a/mysql-test/main/func_system.result b/mysql-test/main/func_system.result index 6d80a439030..e435fc61986 100644 --- a/mysql-test/main/func_system.result +++ b/mysql-test/main/func_system.result @@ -46,7 +46,7 @@ create table t1 (version char(60)) select database(), user(), version() as 'vers show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `database()` varchar(34) CHARACTER SET utf8mb3 DEFAULT NULL, + `database()` varchar(64) CHARACTER SET utf8mb3 DEFAULT NULL, `user()` varchar(384) CHARACTER SET utf8mb3 DEFAULT NULL, `version` char(60) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -95,3 +95,21 @@ select left(concat(a,version()),1) from t1; left(concat(a,version()),1) a drop table t1; +# +# Start of 10.2 tests +# + +MDEV-27544 database() function under UNION ALL truncates results to 34 characters + + +SET NAMES utf8; +create database betäubungsmittelverschreibungsverordnung; +use betäubungsmittelverschreibungsverordnung; +select database() as "database" union all select database(); +database +betäubungsmittelverschreibungsverordnung +betäubungsmittelverschreibungsverordnung +drop database betäubungsmittelverschreibungsverordnung; +# +# End of 10.2 tests +# diff --git a/mysql-test/main/func_system.test b/mysql-test/main/func_system.test index fa09e81a300..d9f2bda750a 100644 --- a/mysql-test/main/func_system.test +++ b/mysql-test/main/func_system.test @@ -55,3 +55,23 @@ select left(concat(a,version()),1) from t1; drop table t1; # End of 4.1 tests + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo +--echo MDEV-27544 database() function under UNION ALL truncates results to 34 characters +--echo +--echo + +SET NAMES utf8; +create database betäubungsmittelverschreibungsverordnung; +use betäubungsmittelverschreibungsverordnung; +select database() as "database" union all select database(); +drop database betäubungsmittelverschreibungsverordnung; + + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/main/gis.result b/mysql-test/main/gis.result index 2756dffff17..f941447a677 100644 --- a/mysql-test/main/gis.result +++ b/mysql-test/main/gis.result @@ -1746,27 +1746,27 @@ drop table t1; SHOW CREATE TABLE information_schema.geometry_columns; Table Create Table GEOMETRY_COLUMNS CREATE TEMPORARY TABLE `GEOMETRY_COLUMNS` ( - `F_TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '', - `F_TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `F_TABLE_NAME` varchar(64) NOT NULL DEFAULT '', - `F_GEOMETRY_COLUMN` varchar(64) NOT NULL DEFAULT '', - `G_TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '', - `G_TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `G_TABLE_NAME` varchar(64) NOT NULL DEFAULT '', - `G_GEOMETRY_COLUMN` varchar(64) NOT NULL DEFAULT '', - `STORAGE_TYPE` tinyint(2) NOT NULL DEFAULT 0, - `GEOMETRY_TYPE` int(7) NOT NULL DEFAULT 0, - `COORD_DIMENSION` tinyint(2) NOT NULL DEFAULT 0, - `MAX_PPR` tinyint(2) NOT NULL DEFAULT 0, - `SRID` smallint(5) NOT NULL DEFAULT 0 + `F_TABLE_CATALOG` varchar(512) NOT NULL, + `F_TABLE_SCHEMA` varchar(64) NOT NULL, + `F_TABLE_NAME` varchar(64) NOT NULL, + `F_GEOMETRY_COLUMN` varchar(64) NOT NULL, + `G_TABLE_CATALOG` varchar(512) NOT NULL, + `G_TABLE_SCHEMA` varchar(64) NOT NULL, + `G_TABLE_NAME` varchar(64) NOT NULL, + `G_GEOMETRY_COLUMN` varchar(64) NOT NULL, + `STORAGE_TYPE` tinyint(2) NOT NULL, + `GEOMETRY_TYPE` int(7) NOT NULL, + `COORD_DIMENSION` tinyint(2) NOT NULL, + `MAX_PPR` tinyint(2) NOT NULL, + `SRID` smallint(5) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW CREATE TABLE information_schema.spatial_ref_sys; Table Create Table SPATIAL_REF_SYS CREATE TEMPORARY TABLE `SPATIAL_REF_SYS` ( - `SRID` smallint(5) NOT NULL DEFAULT 0, - `AUTH_NAME` varchar(512) NOT NULL DEFAULT '', - `AUTH_SRID` int(5) NOT NULL DEFAULT 0, - `SRTEXT` varchar(2048) NOT NULL DEFAULT '' + `SRID` smallint(5) NOT NULL, + `AUTH_NAME` varchar(512) NOT NULL, + `AUTH_SRID` int(5) NOT NULL, + `SRTEXT` varchar(2048) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 create table t1(g GEOMETRY, pt POINT); create table t2(g LINESTRING, pl POLYGON); diff --git a/mysql-test/main/group_min_max.result b/mysql-test/main/group_min_max.result index c7164fcc74c..22f8ec6f851 100644 --- a/mysql-test/main/group_min_max.result +++ b/mysql-test/main/group_min_max.result @@ -2080,19 +2080,19 @@ id select_type table type possible_keys key key_len ref rows Extra explain extended select a1,a2,min(b),max(b) from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 276 99.22 Using where; Using index +1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 276 97.06 Using where; Using index Warnings: Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,min(`test`.`t1`.`b`) AS `min(b)`,max(`test`.`t1`.`b`) AS `max(b)` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`c` > 'a111' group by `test`.`t1`.`a1`,`test`.`t1`.`a2` explain extended select a1,a2,b,min(c),max(c) from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL idx_t1_0,idx_t1_1,idx_t1_2 NULL NULL NULL 512 40.43 Using where; Using temporary; Using filesort +1 SIMPLE t1 ALL idx_t1_0,idx_t1_1,idx_t1_2 NULL NULL NULL 512 39.55 Using where; Using temporary; Using filesort Warnings: Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,min(`test`.`t1`.`c`) AS `min(c)`,max(`test`.`t1`.`c`) AS `max(c)` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`d` > 'xy2' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` explain extended select a1,a2,b,c from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b,c; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL idx_t1_0,idx_t1_1,idx_t1_2 NULL NULL NULL 512 40.43 Using where; Using temporary; Using filesort +1 SIMPLE t1 ALL idx_t1_0,idx_t1_1,idx_t1_2 NULL NULL NULL 512 39.55 Using where; Using temporary; Using filesort Warnings: Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`d` > 'xy2' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`,`test`.`t1`.`c` explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') or (b < 'b') group by a1; @@ -2100,7 +2100,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 index NULL idx_t2_1 163 NULL 548 Using where; Using index explain extended select a1,a2,b from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2,b; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 276 99.22 Using where; Using index +1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 276 97.06 Using where; Using index Warnings: Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`c` > 'a111' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` explain select a1,a2,min(b),c from t2 where (a2 = 'a') and (c = 'a111') group by a1; diff --git a/mysql-test/main/index_merge_myisam.result b/mysql-test/main/index_merge_myisam.result index 053239b7fb1..846d73c58d7 100644 --- a/mysql-test/main/index_merge_myisam.result +++ b/mysql-test/main/index_merge_myisam.result @@ -180,17 +180,29 @@ or id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t0 index_merge i1,i2,i3,i5,i6,i7 i3,i5 4,4 NULL 9 Using sort_union(i3,i5); Using where explain select * from t0 where -((key3 <5 or key5 < 4) and (key1 < 4 or key2 < 4)) +((key3 < 4 or key5 < 4) and (key1 < 4 or key2 < 4)) or ((key3 >=5 or key5 < 2) and (key5 < 5 or key6 < 6)); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t0 ALL i1,i2,i3,i5,i6 NULL NULL NULL 1024 Using where explain select * from t0 force index(i1, i2, i3, i4, i5, i6 ) where -((key3 <5 or key5 < 4) and (key1 < 4 or key2 < 4)) +((key3 < 4 or key5 < 4) and (key1 < 4 or key2 < 4)) +or +((key3 >=5 or key5 < 2) and (key5 < 5 or key6 < 6)); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t0 index_merge i1,i2,i3,i5,i6 i3,i5 4,4 NULL 1024 Using sort_union(i3,i5); Using where +explain select * from t0 force index(i1, i2, i3, i4, i5, i6 ) where +((key3 < 5 or key5 < 4) and (key1 < 4 or key2 < 4)) or ((key3 >=5 or key5 < 2) and (key5 < 5 or key6 < 6)); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t0 index_merge i1,i2,i3,i5,i6 i3,i5 0,4 NULL 1024 Using sort_union(i3,i5); Using where +1 SIMPLE t0 ALL i1,i2,i3,i5,i6 NULL NULL NULL 1024 Using where +explain select * from t0 force index(i1, i2, i3, i4, i5, i6 ) where +((key3 < 10 or key5 < 4) and (key1 < 4 or key2 < 4)) +or +((key3 >=5 or key5 < 2) and (key5 < 5 or key6 < 6)); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t0 ALL i1,i2,i3,i5,i6 NULL NULL NULL 1024 Using where select * from t0 where key1 < 5 or key8 < 4 order by key1; key1 key2 key3 key4 key5 key6 key7 key8 1 1 1 1 1 1 1 1023 @@ -1690,7 +1702,7 @@ SELECT * FROM t1 FORCE KEY (PRIMARY , i , c1 , c2) WHERE pk = 255 OR i = 22 OR (pk IN (1 , 136) AND c2 IN ('c' , 'w') AND (c1 NOT BETWEEN 'e' AND 'i' OR c2 > 'g')) OR (pk is not null and (pk <1 or pk>1)) ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index_merge PRIMARY,c1,i,c2 PRIMARY,i 0,5 NULL 69 Using sort_union(PRIMARY,i); Using where +1 SIMPLE t1 ALL PRIMARY,c1,i,c2 NULL NULL NULL 69 Using where DROP TABLE t1; set optimizer_switch= @optimizer_switch_save; # diff --git a/mysql-test/main/information_schema.result b/mysql-test/main/information_schema.result index c497112f2ab..de9ff8d8e4d 100644 --- a/mysql-test/main/information_schema.result +++ b/mysql-test/main/information_schema.result @@ -230,7 +230,7 @@ Field Type Collation Null Key Default Extra Privileges Comment Insert_priv enum('N','Y') utf8mb3_general_ci NO N select,insert,update,references show full columns from v1; Field Type Collation Null Key Default Extra Privileges Comment -c varchar(64) utf8mb3_general_ci NO select,insert,update,references +c varchar(64) utf8mb3_general_ci NO NULL select,insert,update,references select * from information_schema.COLUMNS where table_name="t1" and column_name= "a"; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION @@ -609,19 +609,19 @@ drop table t1; SHOW CREATE TABLE INFORMATION_SCHEMA.character_sets; Table Create Table CHARACTER_SETS CREATE TEMPORARY TABLE `CHARACTER_SETS` ( - `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '', - `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '', - `DESCRIPTION` varchar(60) NOT NULL DEFAULT '', - `MAXLEN` bigint(3) NOT NULL DEFAULT 0 + `CHARACTER_SET_NAME` varchar(32) NOT NULL, + `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL, + `DESCRIPTION` varchar(60) NOT NULL, + `MAXLEN` bigint(3) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 set names latin2; SHOW CREATE TABLE INFORMATION_SCHEMA.character_sets; Table Create Table CHARACTER_SETS CREATE TEMPORARY TABLE `CHARACTER_SETS` ( - `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '', - `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '', - `DESCRIPTION` varchar(60) NOT NULL DEFAULT '', - `MAXLEN` bigint(3) NOT NULL DEFAULT 0 + `CHARACTER_SET_NAME` varchar(32) NOT NULL, + `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL, + `DESCRIPTION` varchar(60) NOT NULL, + `MAXLEN` bigint(3) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 set names latin1; create table t1 select * from information_schema.CHARACTER_SETS @@ -633,10 +633,10 @@ alter table t1 default character set utf8; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '', - `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '', - `DESCRIPTION` varchar(60) NOT NULL DEFAULT '', - `MAXLEN` bigint(3) NOT NULL DEFAULT 0 + `CHARACTER_SET_NAME` varchar(32) NOT NULL, + `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL, + `DESCRIPTION` varchar(60) NOT NULL, + `MAXLEN` bigint(3) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 drop table t1; create view v1 as select * from information_schema.TABLES; @@ -2499,5 +2499,30 @@ select * from t1 where (name, len) in (select name, len from information_schema name len drop table t1; # +# MDEV-20254 Problems with EMPTY_STRING_IS_NULL and I_S tables +# +SET SQL_MODE= 'EMPTY_STRING_IS_NULL'; +CREATE OR REPLACE TABLE t1 AS SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE 1 = 0; +SHOW returned: CREATE TABLE `t1` ( + `TABLE_NAME` varchar(64) CHARACTER SET utf8mb3 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE `t1` ( + `TABLE_NAME` varchar(64) CHARACTER SET utf8mb3 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `TABLE_NAME` varchar(64) CHARACTER SET utf8mb3 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +SET SQL_MODE=DEFAULT; +SET SQL_MODE= 'EMPTY_STRING_IS_NULL'; +CREATE OR REPLACE TABLE t1 AS SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE 1 = 0; +DROP TABLE t1; +# Executing the statement returned from SHOW CREATE TABLE +DROP TABLE t1; +SET SQL_MODE=DEFAULT; +# # End of 10.3 tests # diff --git a/mysql-test/main/information_schema.test b/mysql-test/main/information_schema.test index 59f657f4403..d8c23e1f673 100644 --- a/mysql-test/main/information_schema.test +++ b/mysql-test/main/information_schema.test @@ -2073,5 +2073,38 @@ select * from t1 where (name, len) in (select name, len from information_schema drop table t1; --echo # +--echo # MDEV-20254 Problems with EMPTY_STRING_IS_NULL and I_S tables +--echo # + +# Test one column with detailed output + +SET SQL_MODE= 'EMPTY_STRING_IS_NULL'; +CREATE OR REPLACE TABLE t1 AS SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE 1 = 0; +--let $myvar= query_get_value(SHOW CREATE TABLE test.t1, Create Table, 1) +--echo SHOW returned: $myvar +DROP TABLE t1; +--eval $myvar +SHOW CREATE TABLE t1; +DROP TABLE t1; +SET SQL_MODE=DEFAULT; + +# Test all columns without detailed output. +# Just make sure the SHOW CREATE TABLE result +# can be passed back to the server without errors. + +SET SQL_MODE= 'EMPTY_STRING_IS_NULL'; +CREATE OR REPLACE TABLE t1 AS SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE 1 = 0; +--let $myvar= query_get_value(SHOW CREATE TABLE test.t1, Create Table, 1) +DROP TABLE t1; +--disable_query_log +--echo # Executing the statement returned from SHOW CREATE TABLE +--eval $myvar +--enable_query_log +DROP TABLE t1; +SET SQL_MODE=DEFAULT; + + + +--echo # --echo # End of 10.3 tests --echo # diff --git a/mysql-test/main/information_schema_inno.result b/mysql-test/main/information_schema_inno.result index d952e4372ca..c81631728f0 100644 --- a/mysql-test/main/information_schema_inno.result +++ b/mysql-test/main/information_schema_inno.result @@ -1,4 +1,3 @@ -DROP TABLE IF EXISTS t1,t2,t3; CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB; CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id, id), FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE, diff --git a/mysql-test/main/information_schema_inno.test b/mysql-test/main/information_schema_inno.test index 3cdbb8111d9..6c50ff3ece0 100644 --- a/mysql-test/main/information_schema_inno.test +++ b/mysql-test/main/information_schema_inno.test @@ -1,8 +1,6 @@ -- source include/testdb_only.inc -- source include/have_innodb.inc ---disable_warnings -DROP TABLE IF EXISTS t1,t2,t3; ---enable_warnings +-- source include/have_symlink.inc # # Test for KEY_COLUMN_USAGE & TABLE_CONSTRAINTS tables diff --git a/mysql-test/main/information_schema_parameters.result b/mysql-test/main/information_schema_parameters.result index fd2be07326c..c0f2eda5427 100644 --- a/mysql-test/main/information_schema_parameters.result +++ b/mysql-test/main/information_schema_parameters.result @@ -3,22 +3,22 @@ USE INFORMATION_SCHEMA; SHOW CREATE TABLE INFORMATION_SCHEMA.PARAMETERS; Table Create Table PARAMETERS CREATE TEMPORARY TABLE `PARAMETERS` ( - `SPECIFIC_CATALOG` varchar(512) NOT NULL DEFAULT '', - `SPECIFIC_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `SPECIFIC_NAME` varchar(64) NOT NULL DEFAULT '', - `ORDINAL_POSITION` int(21) NOT NULL DEFAULT 0, - `PARAMETER_MODE` varchar(5) DEFAULT NULL, - `PARAMETER_NAME` varchar(64) DEFAULT NULL, - `DATA_TYPE` varchar(64) NOT NULL DEFAULT '', - `CHARACTER_MAXIMUM_LENGTH` int(21) DEFAULT NULL, - `CHARACTER_OCTET_LENGTH` int(21) DEFAULT NULL, - `NUMERIC_PRECISION` int(21) DEFAULT NULL, - `NUMERIC_SCALE` int(21) DEFAULT NULL, - `DATETIME_PRECISION` bigint(21) unsigned DEFAULT NULL, - `CHARACTER_SET_NAME` varchar(64) DEFAULT NULL, - `COLLATION_NAME` varchar(64) DEFAULT NULL, - `DTD_IDENTIFIER` longtext NOT NULL DEFAULT '', - `ROUTINE_TYPE` varchar(9) NOT NULL DEFAULT '' + `SPECIFIC_CATALOG` varchar(512) NOT NULL, + `SPECIFIC_SCHEMA` varchar(64) NOT NULL, + `SPECIFIC_NAME` varchar(64) NOT NULL, + `ORDINAL_POSITION` int(21) NOT NULL, + `PARAMETER_MODE` varchar(5), + `PARAMETER_NAME` varchar(64), + `DATA_TYPE` varchar(64) NOT NULL, + `CHARACTER_MAXIMUM_LENGTH` int(21), + `CHARACTER_OCTET_LENGTH` int(21), + `NUMERIC_PRECISION` int(21), + `NUMERIC_SCALE` int(21), + `DATETIME_PRECISION` bigint(21) unsigned, + `CHARACTER_SET_NAME` varchar(64), + `COLLATION_NAME` varchar(64), + `DTD_IDENTIFIER` longtext NOT NULL, + `ROUTINE_TYPE` varchar(9) NOT NULL ) DEFAULT CHARSET=utf8mb3 SELECT * FROM information_schema.columns WHERE table_schema = 'information_schema' @@ -29,7 +29,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PARAMETERS COLUMN_NAME SPECIFIC_CATALOG ORDINAL_POSITION 1 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 512 @@ -51,7 +51,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PARAMETERS COLUMN_NAME SPECIFIC_SCHEMA ORDINAL_POSITION 2 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 64 @@ -73,7 +73,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PARAMETERS COLUMN_NAME SPECIFIC_NAME ORDINAL_POSITION 3 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 64 @@ -95,7 +95,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PARAMETERS COLUMN_NAME ORDINAL_POSITION ORDINAL_POSITION 4 -COLUMN_DEFAULT 0 +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE int CHARACTER_MAXIMUM_LENGTH NULL @@ -161,7 +161,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PARAMETERS COLUMN_NAME DATA_TYPE ORDINAL_POSITION 7 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 64 @@ -337,7 +337,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PARAMETERS COLUMN_NAME DTD_IDENTIFIER ORDINAL_POSITION 15 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE longtext CHARACTER_MAXIMUM_LENGTH 4294967295 @@ -359,7 +359,7 @@ TABLE_SCHEMA information_schema TABLE_NAME PARAMETERS COLUMN_NAME ROUTINE_TYPE ORDINAL_POSITION 16 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 9 @@ -378,13 +378,13 @@ IS_GENERATED NEVER GENERATION_EXPRESSION NULL DESCRIBE INFORMATION_SCHEMA.PARAMETERS; Field Type Null Key Default Extra -SPECIFIC_CATALOG varchar(512) NO -SPECIFIC_SCHEMA varchar(64) NO -SPECIFIC_NAME varchar(64) NO -ORDINAL_POSITION int(21) NO 0 +SPECIFIC_CATALOG varchar(512) NO NULL +SPECIFIC_SCHEMA varchar(64) NO NULL +SPECIFIC_NAME varchar(64) NO NULL +ORDINAL_POSITION int(21) NO NULL PARAMETER_MODE varchar(5) YES NULL PARAMETER_NAME varchar(64) YES NULL -DATA_TYPE varchar(64) NO +DATA_TYPE varchar(64) NO NULL CHARACTER_MAXIMUM_LENGTH int(21) YES NULL CHARACTER_OCTET_LENGTH int(21) YES NULL NUMERIC_PRECISION int(21) YES NULL @@ -392,8 +392,8 @@ NUMERIC_SCALE int(21) YES NULL DATETIME_PRECISION bigint(21) unsigned YES NULL CHARACTER_SET_NAME varchar(64) YES NULL COLLATION_NAME varchar(64) YES NULL -DTD_IDENTIFIER longtext NO -ROUTINE_TYPE varchar(9) NO +DTD_IDENTIFIER longtext NO NULL +ROUTINE_TYPE varchar(9) NO NULL # ========== parameters.2 ========== DROP DATABASE IF EXISTS i_s_parameters_test; CREATE DATABASE i_s_parameters_test; diff --git a/mysql-test/main/information_schema_routines.result b/mysql-test/main/information_schema_routines.result index 9f1f1f16bcf..6f9b4c7e6aa 100644 --- a/mysql-test/main/information_schema_routines.result +++ b/mysql-test/main/information_schema_routines.result @@ -5,37 +5,37 @@ USE INFORMATION_SCHEMA; SHOW CREATE TABLE INFORMATION_SCHEMA.ROUTINES; Table Create Table ROUTINES CREATE TEMPORARY TABLE `ROUTINES` ( - `SPECIFIC_NAME` varchar(64) NOT NULL DEFAULT '', - `ROUTINE_CATALOG` varchar(512) NOT NULL DEFAULT '', - `ROUTINE_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `ROUTINE_NAME` varchar(64) NOT NULL DEFAULT '', - `ROUTINE_TYPE` varchar(13) NOT NULL DEFAULT '', - `DATA_TYPE` varchar(64) NOT NULL DEFAULT '', - `CHARACTER_MAXIMUM_LENGTH` int(21) DEFAULT NULL, - `CHARACTER_OCTET_LENGTH` int(21) DEFAULT NULL, - `NUMERIC_PRECISION` int(21) DEFAULT NULL, - `NUMERIC_SCALE` int(21) DEFAULT NULL, - `DATETIME_PRECISION` bigint(21) unsigned DEFAULT NULL, - `CHARACTER_SET_NAME` varchar(64) DEFAULT NULL, - `COLLATION_NAME` varchar(64) DEFAULT NULL, - `DTD_IDENTIFIER` longtext DEFAULT NULL, - `ROUTINE_BODY` varchar(8) NOT NULL DEFAULT '', - `ROUTINE_DEFINITION` longtext DEFAULT NULL, - `EXTERNAL_NAME` varchar(64) DEFAULT NULL, - `EXTERNAL_LANGUAGE` varchar(64) DEFAULT NULL, - `PARAMETER_STYLE` varchar(8) NOT NULL DEFAULT '', - `IS_DETERMINISTIC` varchar(3) NOT NULL DEFAULT '', - `SQL_DATA_ACCESS` varchar(64) NOT NULL DEFAULT '', - `SQL_PATH` varchar(64) DEFAULT NULL, - `SECURITY_TYPE` varchar(7) NOT NULL DEFAULT '', - `CREATED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `SQL_MODE` varchar(8192) NOT NULL DEFAULT '', - `ROUTINE_COMMENT` longtext NOT NULL DEFAULT '', - `DEFINER` varchar(384) NOT NULL DEFAULT '', - `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', - `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', - `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT '' + `SPECIFIC_NAME` varchar(64) NOT NULL, + `ROUTINE_CATALOG` varchar(512) NOT NULL, + `ROUTINE_SCHEMA` varchar(64) NOT NULL, + `ROUTINE_NAME` varchar(64) NOT NULL, + `ROUTINE_TYPE` varchar(13) NOT NULL, + `DATA_TYPE` varchar(64) NOT NULL, + `CHARACTER_MAXIMUM_LENGTH` int(21), + `CHARACTER_OCTET_LENGTH` int(21), + `NUMERIC_PRECISION` int(21), + `NUMERIC_SCALE` int(21), + `DATETIME_PRECISION` bigint(21) unsigned, + `CHARACTER_SET_NAME` varchar(64), + `COLLATION_NAME` varchar(64), + `DTD_IDENTIFIER` longtext, + `ROUTINE_BODY` varchar(8) NOT NULL, + `ROUTINE_DEFINITION` longtext, + `EXTERNAL_NAME` varchar(64), + `EXTERNAL_LANGUAGE` varchar(64), + `PARAMETER_STYLE` varchar(8) NOT NULL, + `IS_DETERMINISTIC` varchar(3) NOT NULL, + `SQL_DATA_ACCESS` varchar(64) NOT NULL, + `SQL_PATH` varchar(64), + `SECURITY_TYPE` varchar(7) NOT NULL, + `CREATED` datetime NOT NULL, + `LAST_ALTERED` datetime NOT NULL, + `SQL_MODE` varchar(8192) NOT NULL, + `ROUTINE_COMMENT` longtext NOT NULL, + `DEFINER` varchar(384) NOT NULL, + `CHARACTER_SET_CLIENT` varchar(32) NOT NULL, + `COLLATION_CONNECTION` varchar(32) NOT NULL, + `DATABASE_COLLATION` varchar(32) NOT NULL ) DEFAULT CHARSET=utf8mb3 SELECT * FROM information_schema.columns WHERE table_schema = 'information_schema' @@ -46,7 +46,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES COLUMN_NAME SPECIFIC_NAME ORDINAL_POSITION 1 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 64 @@ -68,7 +68,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES COLUMN_NAME ROUTINE_CATALOG ORDINAL_POSITION 2 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 512 @@ -90,7 +90,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES COLUMN_NAME ROUTINE_SCHEMA ORDINAL_POSITION 3 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 64 @@ -112,7 +112,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES COLUMN_NAME ROUTINE_NAME ORDINAL_POSITION 4 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 64 @@ -134,7 +134,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES COLUMN_NAME ROUTINE_TYPE ORDINAL_POSITION 5 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 13 @@ -156,7 +156,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES COLUMN_NAME DATA_TYPE ORDINAL_POSITION 6 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 64 @@ -354,7 +354,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES COLUMN_NAME ROUTINE_BODY ORDINAL_POSITION 15 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 8 @@ -442,7 +442,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES COLUMN_NAME PARAMETER_STYLE ORDINAL_POSITION 19 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 8 @@ -464,7 +464,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES COLUMN_NAME IS_DETERMINISTIC ORDINAL_POSITION 20 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 3 @@ -486,7 +486,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES COLUMN_NAME SQL_DATA_ACCESS ORDINAL_POSITION 21 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 64 @@ -530,7 +530,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES COLUMN_NAME SECURITY_TYPE ORDINAL_POSITION 23 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 7 @@ -552,7 +552,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES COLUMN_NAME CREATED ORDINAL_POSITION 24 -COLUMN_DEFAULT '0000-00-00 00:00:00' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE datetime CHARACTER_MAXIMUM_LENGTH NULL @@ -574,7 +574,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES COLUMN_NAME LAST_ALTERED ORDINAL_POSITION 25 -COLUMN_DEFAULT '0000-00-00 00:00:00' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE datetime CHARACTER_MAXIMUM_LENGTH NULL @@ -596,7 +596,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES COLUMN_NAME SQL_MODE ORDINAL_POSITION 26 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 8192 @@ -618,7 +618,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES COLUMN_NAME ROUTINE_COMMENT ORDINAL_POSITION 27 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE longtext CHARACTER_MAXIMUM_LENGTH 4294967295 @@ -640,7 +640,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES COLUMN_NAME DEFINER ORDINAL_POSITION 28 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 384 @@ -662,7 +662,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES COLUMN_NAME CHARACTER_SET_CLIENT ORDINAL_POSITION 29 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 32 @@ -684,7 +684,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES COLUMN_NAME COLLATION_CONNECTION ORDINAL_POSITION 30 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 32 @@ -706,7 +706,7 @@ TABLE_SCHEMA information_schema TABLE_NAME ROUTINES COLUMN_NAME DATABASE_COLLATION ORDINAL_POSITION 31 -COLUMN_DEFAULT '' +COLUMN_DEFAULT NULL IS_NULLABLE NO DATA_TYPE varchar CHARACTER_MAXIMUM_LENGTH 32 @@ -725,12 +725,12 @@ IS_GENERATED NEVER GENERATION_EXPRESSION NULL DESCRIBE INFORMATION_SCHEMA.ROUTINES; Field Type Null Key Default Extra -SPECIFIC_NAME varchar(64) NO -ROUTINE_CATALOG varchar(512) NO -ROUTINE_SCHEMA varchar(64) NO -ROUTINE_NAME varchar(64) NO -ROUTINE_TYPE varchar(13) NO -DATA_TYPE varchar(64) NO +SPECIFIC_NAME varchar(64) NO NULL +ROUTINE_CATALOG varchar(512) NO NULL +ROUTINE_SCHEMA varchar(64) NO NULL +ROUTINE_NAME varchar(64) NO NULL +ROUTINE_TYPE varchar(13) NO NULL +DATA_TYPE varchar(64) NO NULL CHARACTER_MAXIMUM_LENGTH int(21) YES NULL CHARACTER_OCTET_LENGTH int(21) YES NULL NUMERIC_PRECISION int(21) YES NULL @@ -739,23 +739,23 @@ DATETIME_PRECISION bigint(21) unsigned YES NULL CHARACTER_SET_NAME varchar(64) YES NULL COLLATION_NAME varchar(64) YES NULL DTD_IDENTIFIER longtext YES NULL -ROUTINE_BODY varchar(8) NO +ROUTINE_BODY varchar(8) NO NULL ROUTINE_DEFINITION longtext YES NULL EXTERNAL_NAME varchar(64) YES NULL EXTERNAL_LANGUAGE varchar(64) YES NULL -PARAMETER_STYLE varchar(8) NO -IS_DETERMINISTIC varchar(3) NO -SQL_DATA_ACCESS varchar(64) NO +PARAMETER_STYLE varchar(8) NO NULL +IS_DETERMINISTIC varchar(3) NO NULL +SQL_DATA_ACCESS varchar(64) NO NULL SQL_PATH varchar(64) YES NULL -SECURITY_TYPE varchar(7) NO -CREATED datetime NO 0000-00-00 00:00:00 -LAST_ALTERED datetime NO 0000-00-00 00:00:00 -SQL_MODE varchar(8192) NO -ROUTINE_COMMENT longtext NO -DEFINER varchar(384) NO -CHARACTER_SET_CLIENT varchar(32) NO -COLLATION_CONNECTION varchar(32) NO -DATABASE_COLLATION varchar(32) NO +SECURITY_TYPE varchar(7) NO NULL +CREATED datetime NO NULL +LAST_ALTERED datetime NO NULL +SQL_MODE varchar(8192) NO NULL +ROUTINE_COMMENT longtext NO NULL +DEFINER varchar(384) NO NULL +CHARACTER_SET_CLIENT varchar(32) NO NULL +COLLATION_CONNECTION varchar(32) NO NULL +DATABASE_COLLATION varchar(32) NO NULL # ========== routines.2 ========== DROP DATABASE IF EXISTS i_s_routines_test; CREATE DATABASE i_s_routines_test; diff --git a/mysql-test/main/insert_select.result b/mysql-test/main/insert_select.result index 5094638c92b..e85c4982137 100644 --- a/mysql-test/main/insert_select.result +++ b/mysql-test/main/insert_select.result @@ -865,3 +865,22 @@ t2 CREATE TABLE `t2` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1, t2; End of 5.5 tests +# +# Beginning of 10.2 test +# +# MDEV-26698: Incorrect row number upon INSERT .. SELECT from the same +# table: rows are counted twice +# +CREATE TABLE t1(a TINYINT); +INSERT INTO t1 VALUES (1), (100); +INSERT INTO t1 SELECT a*2 FROM t1; +Warnings: +Warning 1264 Out of range value for column 'a' at row 2 +TRUNCATE TABLE t1; +# using ORDER BY +INSERT INTO t1 VALUES(1), (2), (100), (3); +INSERT INTO t1 SELECT a*2 FROM t1 ORDER BY a; +Warnings: +Warning 1264 Out of range value for column 'a' at row 4 +DROP TABLE t1; +# End of 10.2 test diff --git a/mysql-test/main/insert_select.test b/mysql-test/main/insert_select.test index 0b5cdf95daf..91b2cc6f981 100644 --- a/mysql-test/main/insert_select.test +++ b/mysql-test/main/insert_select.test @@ -435,3 +435,28 @@ show create table t2; drop table t1, t2; --echo End of 5.5 tests + +--echo # +--echo # Beginning of 10.2 test +--echo # +--echo # MDEV-26698: Incorrect row number upon INSERT .. SELECT from the same +--echo # table: rows are counted twice +--echo # + +CREATE TABLE t1(a TINYINT); + +INSERT INTO t1 VALUES (1), (100); + +INSERT INTO t1 SELECT a*2 FROM t1; + +TRUNCATE TABLE t1; + +--echo # using ORDER BY + +INSERT INTO t1 VALUES(1), (2), (100), (3); + +INSERT INTO t1 SELECT a*2 FROM t1 ORDER BY a; + +DROP TABLE t1; + +--echo # End of 10.2 test diff --git a/mysql-test/main/mdev-25830.result b/mysql-test/main/mdev-25830.result new file mode 100644 index 00000000000..e62d1ff3f55 --- /dev/null +++ b/mysql-test/main/mdev-25830.result @@ -0,0 +1,56 @@ +SET SESSION DEFAULT_STORAGE_ENGINE='InnoDB'; +set @innodb_stats_persistent_save= @@innodb_stats_persistent; +set @innodb_stats_persistent_sample_pages_save= +@@innodb_stats_persistent_sample_pages; +set global innodb_stats_persistent= 1; +set global innodb_stats_persistent_sample_pages=100; +set optimizer_use_condition_selectivity=1; +analyze SELECT sysapproval_approver0.`sys_id` +FROM ((sysapproval_approver sysapproval_approver0 +INNER JOIN task task1 +ON sysapproval_approver0.`sysapproval` = task1.`sys_id` + AND (( task1.`sys_domain_path` = '/' + OR task1.`sys_domain_path` LIKE '!!!/!!#/!!$/%' + OR task1.`sys_domain_path` LIKE '!!!/!!!/%' ))) +INNER JOIN task task2 +ON task1.`parent` = task2.`sys_id` + AND (( task2.`sys_domain_path` = '/' + OR task2.`sys_domain_path` LIKE '!!!/!!#/!!$/%' + OR task2.`sys_domain_path` LIKE '!!!/!!!/%' ))) +WHERE task2.`sys_id` LIKE '8e7792a7dbfffb00fff8a345ca961934%' + AND ( sysapproval_approver0.`sys_domain_path` = '/' + OR sysapproval_approver0.`sys_domain_path` LIKE '!!!/!!#/!!$/%' + OR sysapproval_approver0.`sys_domain_path` LIKE '!!!/!!!/%' ) +ORDER BY sysapproval_approver0.`order` +LIMIT 0, 50 ; +id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra +1 SIMPLE task2 range PRIMARY,sys_class_name_2,sys_domain_path PRIMARY 96 NULL 1 0.00 100.00 100.00 Using where; Using temporary; Using filesort +1 SIMPLE task1 ref PRIMARY,task_parent,sys_class_name_2,sys_domain_path task_parent 99 test.task2.sys_id 1 NULL 100.00 NULL Using index condition; Using where +1 SIMPLE sysapproval_approver0 ref sysapproval_approver_ref5,sys_domain_path,sysapproval_approver_CHG1975376 sysapproval_approver_ref5 99 test.task1.sys_id 1 NULL 100.00 NULL Using index condition; Using where +set optimizer_use_condition_selectivity=4; +analyze SELECT sysapproval_approver0.`sys_id` +FROM ((sysapproval_approver sysapproval_approver0 +INNER JOIN task task1 +ON sysapproval_approver0.`sysapproval` = task1.`sys_id` + AND (( task1.`sys_domain_path` = '/' + OR task1.`sys_domain_path` LIKE '!!!/!!#/!!$/%' + OR task1.`sys_domain_path` LIKE '!!!/!!!/%' ))) +INNER JOIN task task2 +ON task1.`parent` = task2.`sys_id` + AND (( task2.`sys_domain_path` = '/' + OR task2.`sys_domain_path` LIKE '!!!/!!#/!!$/%' + OR task2.`sys_domain_path` LIKE '!!!/!!!/%' ))) +WHERE task2.`sys_id` LIKE '8e7792a7dbfffb00fff8a345ca961934%' + AND ( sysapproval_approver0.`sys_domain_path` = '/' + OR sysapproval_approver0.`sys_domain_path` LIKE '!!!/!!#/!!$/%' + OR sysapproval_approver0.`sys_domain_path` LIKE '!!!/!!!/%' ) +ORDER BY sysapproval_approver0.`order` +LIMIT 0, 50 ; +id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra +1 SIMPLE task2 range PRIMARY,sys_class_name_2,sys_domain_path PRIMARY 96 NULL 1 0.00 98.00 100.00 Using where; Using temporary; Using filesort +1 SIMPLE task1 ref PRIMARY,task_parent,sys_class_name_2,sys_domain_path task_parent 99 test.task2.sys_id 1 NULL 100.00 NULL Using index condition; Using where +1 SIMPLE sysapproval_approver0 ref sysapproval_approver_ref5,sys_domain_path,sysapproval_approver_CHG1975376 sysapproval_approver_ref5 99 test.task1.sys_id 1 NULL 100.00 NULL Using index condition; Using where +drop table sysapproval_approver,task; +set global innodb_stats_persistent= @innodb_stats_persistent_save; +set global innodb_stats_persistent_sample_pages= +@innodb_stats_persistent_sample_pages_save; diff --git a/mysql-test/main/mdev-25830.test b/mysql-test/main/mdev-25830.test new file mode 100644 index 00000000000..5521d1fad85 --- /dev/null +++ b/mysql-test/main/mdev-25830.test @@ -0,0 +1,104 @@ +# +# MDEV-25830: optimizer_use_condition_selectivity=4 sometimes produces worse plan than optimizer_use_condition_selectivity=1 +# https://jira.mariadb.org/browse/MDEV-25830 +# +--source include/innodb_prefix_index_cluster_optimization.inc + +SET SESSION DEFAULT_STORAGE_ENGINE='InnoDB'; + +set @innodb_stats_persistent_save= @@innodb_stats_persistent; +set @innodb_stats_persistent_sample_pages_save= + @@innodb_stats_persistent_sample_pages; + +set global innodb_stats_persistent= 1; +set global innodb_stats_persistent_sample_pages=100; + +--disable_query_log +--disable_result_log +--disable_warnings + +DROP TABLE IF EXISTS `sysapproval_approver`; +CREATE TABLE `sysapproval_approver` ( + `order` int(11) DEFAULT NULL, + `sysapproval` varchar(32) DEFAULT NULL, + `sys_id` char(32) NOT NULL DEFAULT '', + `sys_domain_path` varchar(255) DEFAULT NULL, + PRIMARY KEY (`sys_id`), + KEY `sysapproval_approver_ref5` (`sysapproval`), + KEY `sys_domain_path` (`sys_domain_path`), + KEY `sysapproval_approver_CHG1975376` (`sys_domain_path`,`sysapproval`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `sysapproval_approver` VALUES (NULL,'c00004d787a8a5003fff83bdff434dea','000004d787a8a5003fff83bdff434dee','!!!/!!#/!!$/'),(NULL,NULL,'00000741db8bfb480be6a345ca96198e','!!!/!!#/!!$/'),(NULL,NULL,'00001605dbce48d0f7fca851ca961967','!!!/!!#/!!$/'),(NULL,'23b53105db2f324c5a4af85e0f96194e','000016c1db6ffa445d2f7aa31f9619a0','!!!/!!#/!!$/'),(NULL,NULL,'00001730dbe24890f7fca851ca9619aa','!!!/!!#/!!$/'),(NULL,NULL,'000017a01b127b00ada243f6fe4bcb8c','!!!/!!#/!!$/'),(NULL,'7f660139db6088185ed4a851ca961986','00001ab1dbecc8185ed4a851ca961970','!!!/!!#/!!$/'),(NULL,'6226cd801b19dc10a59033f2cd4bcb22','00001d84db9918505ed4a851ca96193f','!!!/!!!/(8]/'),(NULL,NULL,'00002246db83874002f17c541f961999','!!!/!!#/!!$/'),(NULL,NULL,'000026e01b9eb700ada243f6fe4bcbc5','!!!/!!#/!!$/'),(NULL,NULL,'000028e16f064e807b658e4c2c3ee4ae','!!!/!!#/!!$/'),(NULL,NULL,'00002914dba8670c54250b55ca961928','!!!/!!#/!!$/'),(NULL,NULL,'00002914dba8670c54250b55ca961931','!!!/!!#/!!$/'),(NULL,NULL,'00002914dba8670c54250b55ca96193a','!!!/!!#/!!$/'),(NULL,NULL,'00002914dba8670c54250b55ca961943','!!!/!!#/!!$/'),(NULL,NULL,'000030a4dbb90b40002af47e0f9619b1','!!!/!!#/!!$/'),(NULL,NULL,'000033fedb41fb041cd8a345ca9619fa','!!!/!!#/!!$/'),(NULL,NULL,'0000341ddb4ce3804ac3a851ca961916','!!!/!!#/!!$/'),(NULL,NULL,'0000393ddb709b002b6dfb651f961908','!!!/!!#/!!$/'),(NULL,'a81ca740db5cdc9416d2a345ca9619b3','00003b00dbdcdc9416d2a345ca961907','!!!/!!#/!!$/'),(NULL,'04003c88db5e3304d6a102d5ca961913','00003c88db5e3304d6a102d5ca96192a','!!!/!!#/!!$/'),(NULL,'4affb00cdbbf0f800e3dfb651f9619a0','0000450cdbbf0f800e3dfb651f961973','!!!/!!#/!!$/'),(NULL,NULL,'00005634dbd11fc4e9737a9e0f961988','!!!/!!#/!!$/'),(NULL,NULL,'00005634dbd11fc4e9737a9e0f9619ce','!!!/!!#/!!$/'),(NULL,NULL,'00005634dbd11fc4e9737a9e0f9619d7','!!!/!!#/!!$/'),(NULL,NULL,'00005784dbc49b00852c7a9e0f96198a','!!!/!!#/!!$/'),(NULL,NULL,'00005bc1dbcdd7042d1efb651f961978','!!!/!!#/!!$/'),(NULL,NULL,'0000637b6f37c24013568e4c2c3ee4d6','!!!/!!#/!!$/'),(NULL,'080069db0f858240a2c9982be1050eae','000069db0f858240a2c9982be1050eb2','!!!/!!#/!!$/'),(NULL,'f98e3bb21b155c10a59033f2cd4bcbef','00006c47db5d9010d82ffb24399619d8','!!!/!!!/#YZ/'),(NULL,NULL,'00006c50db6a0450d58ea345ca961972','!!!/!!#/!!$/'),(NULL,NULL,'00006e38dbc19304032a7a9e0f9619e4','!!!/!!#/!!$/'),(NULL,NULL,'00006edddbec8c5813b5fb24399619b9','!!!/!!#/!!$/'),(NULL,NULL,'000073fedb41fb041cd8a345ca961934','!!!/!!#/!!$/'),(NULL,NULL,'000073fedb41fb041cd8a345ca96195c','!!!/!!#/!!$/'),(NULL,'d03c6ee61b774410a59033f2cd4bcbf5','000076bfdbb74c981cd8a345ca9619ee','!!!/!!!/!;B/'),(NULL,NULL,'000076ecdbde48502be0a851ca9619dd','!!!/!!#/!!$/'),(NULL,NULL,'000076ecdbde48502be0a851ca9619fe','!!!/!!#/!!$/'),(NULL,NULL,'0000778d6fd01a4000270bae9f3ee4ff','!!!/!!#/!!$/'),(NULL,NULL,'000077c21b3fbb0cada243f6fe4bcba7','!!!/!!#/!!$/'),(NULL,NULL,'000077c21b3fbb0cada243f6fe4bcbcb','!!!/!!#/!!$/'),(NULL,'f6c5f2110f75de401c7e938172050e1b','000077e10f7d5e00e59b982be1050e62','!!!/!!#/!!$/'),(NULL,NULL,'00007fa76ff70a0000270bae9f3ee4b1','!!!/!!#/!!$/'),(NULL,'73ff6fe76f4761007ceff7307f3ee478','00007fe76f4761007ceff7307f3ee47c','!!!/!!#/!!$/'),(NULL,'a4d63f4bdb8fbf00414ed0c5ca96191d','0000881b1b8f7f00fff162c4bd4bcbe7','!!!/!!!/$)(/'),(NULL,'a4d63f4bdb8fbf00414ed0c5ca96191d','0000881b1b8f7f00fff162c4bd4bcbec','!!!/!!!/$)(/'),(NULL,NULL,'000094eb6f781a0099c5409e9f3ee48e','!!!/!!#/!!$/'),(NULL,NULL,'000094eb6f781a0099c5409e9f3ee493','!!!/!!#/!!$/'),(NULL,'401fb78cdb18d8dc1cd8a345ca9619c8','00009c10dbdc98dcfeb1a851ca96192f','!!!/!!!/$$8/'),(NULL,'9dd30a24db5c1cdc23f4a345ca96192b','00009e2cdb1c589c4819fb243996195c','!!!/!!#/!!$/'); + +DROP TABLE IF EXISTS `task`; +CREATE TABLE `task` ( + `parent` varchar(32) DEFAULT NULL, + `sys_id` char(32) NOT NULL DEFAULT '', + `sys_domain_path` varchar(255) DEFAULT NULL, + PRIMARY KEY (`sys_id`), + KEY `task_parent` (`parent`), + KEY `sys_class_name_2` (`sys_domain_path`), + KEY `sys_domain_path` (`sys_domain_path`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `task` VALUES (NULL,'-1','!!!/!!#/!!$/'),(NULL,'00000195dbe7f30413b5fb2439961936','!!!/!!#/!!$/'),(NULL,'0000032edb160f04d7e37aa31f961964','!!!/!!#/!!$/'),('a6fe0637dbddfb8c1cd8a345ca96196f','000003dcdb31f3c0a39a0b55ca961916','!!!/!!#/!!$/'),('2f1df65d6fca3100e7f68e4c2c3ee4e6','000004466f127d40e7f68e4c2c3ee4ce','!!!/!!#/!!$/'),('50dfb42edbbdd3403eb27a9e0f96199e','0000056edbbdd3403eb27a9e0f961995','!!!/!!!/+0{/'),('5f5af922dbb804d03bf6a851ca961999','000006eedb7c04d03bf6a851ca96190c','!!!/!!!/$9;/'),(NULL,'00000904db1dd45014d6fb24399619b7','!!!/!!#/!!$/'),('33c6e522db2c10104ac3a851ca9619f3','00000a06dbf0181416d2a345ca96197b','!!!/!!#/!!$/'),(NULL,'00000ccd6f9196041501f7307f3ee406','!!!/!!#/!!$/'),(NULL,'00000ee2dbb9bf4014d6fb24399619a7','!!!/!!#/!!$/'),(NULL,'00000f065bba40000a4de1945e425441','!!!/!!#/!!$/'),(NULL,'000013dedbc0bf00bbc40b55ca961959','!!!/!!!/,*7/'),(NULL,'000016bcdb29009cf7fca851ca961927','!!!/!!#/!!$/'),(NULL,'0000171bdbdb770066e0a345ca96195a','!!!/!!!/+N?/'),('8eb9317f1b895450d01143f6fe4bcb26','00001c80db5d509022e0fb24399619ed','!!!/!!!/0RG/'),(NULL,'00001d84dbf6f2405a4af85e0f9619f9','!!!/!!#/!!$/'),(NULL,'00001e31db25d4105ed4a851ca96195c','!!!/!!#/!!$/'),(NULL,'00001ea3db73c89823f4a345ca9619b5','!!!/!!#/!!$/'),('c3baf3fadb234c54d82ffb24399619e0','00001f4fdbab4c542be0a851ca96190c','!!!/!!#/!!$/'),(NULL,'0000221bdbb4b3c466e0a345ca9619f0','!!!/!!!/$^{/'),(NULL,'000022bcdb9c04d022e0fb24399619e1','!!!/!!#/!!$/'),('9b7152434f995a80f347524e0210c7e0','0000234b6f59de00fbd4409e9f3ee446','/'),('c64ed870145461009a1c80cd6740d192','00002434145461009a1c80cd6740d1e5','!!!/!!#/!!$/'),(NULL,'0000247edb84d7040e3dfb651f9619b2','!!!/!!#/!!$/'),(NULL,'000025f8dbb6ba007fc27c541f96195b','!!!/!!#/!!$/'),('9b691033485d95c0c5abf6bd15eef576','0000287348dd95c0c5abf6bd15eef572','!!!/!!#/!!$/'),('3c4f591edb7ce2406015f47e0f96191b','00002952dbbce2406015f47e0f961999','!!!/!!!/#MU/'),(NULL,'000029b0db6d5c104819fb24399619a8','!!!/!!#/!!$/'),(NULL,'00002a3d1b5f0010a59033f2cd4bcb90','!!!/!!!/&<#/'),(NULL,'00002a9fdb5787840e3dfb651f9619a6','!!!/!!#/!!$/'),(NULL,'00002c5adb5a0fc0d7e37aa31f9619ba','!!!/!!#/!!$/'),('fa753886dbd8181014d6fb2439961989','00002d5edbdc949466e0a345ca9619e4','!!!/!!!/$44/'),('56ff56bfdb469c503fa35583ca961987','00002e73db0a9c50364a5583ca961922','!!!/!!#/!!$/'),(NULL,'000031f6dba76b40c9c302d5ca9619c4','!!!/!!#/!!$/'),(NULL,'000036fadb1a0344d7e37aa31f96196d','!!!/!!#/!!$/'),(NULL,'000036ffdb046744d58ea345ca961937','!!!/!!#/!!$/'),(NULL,'000037c2dbaae700fb115583ca961926','!!!/!!#/!!$/'),(NULL,'000038eedbe32380b1b102d5ca9619c9','!!!/!!!/#2J/'),(NULL,'00003925dbb1c300225d7aa31f961993','!!!/!!#/!!$/'),('58c865acdb2944184ac3a851ca961901','0000392cdbe944184ac3a851ca9619ea','!!!/!!!/(*S/'),(NULL,'00003966db307a800e58fb651f9619a7','!!!/!!!/&C[/'),('bdeae17bdbfed3045ed4a851ca961933','0000397bdbb217045ed4a851ca96192e','!!!/!!#/!!$/'),('1b951202dbbe7b8014d6fb2439961926','00003a02db767f80fec4fb243996198f','!!!/!!!/#*L/'),(NULL,'00003e5bdbe33b8416d2a345ca961919','!!!/!!#/!!$/'),(NULL,'00003eef1b0a4410fff162c4bd4bcb0e','!!!/!!#/!!$/'),(NULL,'000040b6dbcfcb000e58fb651f9619d2','!!!/!!#/!!$/'),(NULL,'000040e5db0a185011762183ca9619c5','!!!/!!#/!!$/'),('101abff70ff99200a2c9982be1050ee7','000044c86f4a120000270bae9f3ee475','/'),('15d6f3c8dbb3ab0023f4a345ca9619ee','000045f2db5f2700f2eb02d5ca9619c6','!!!/!!!/#*./'); + +ANALYZE TABLE sysapproval_approver PERSISTENT FOR COLUMNS() INDEXES(); +ANALYZE TABLE task PERSISTENT FOR COLUMNS() INDEXES(); + +--enable_warnings +--enable_result_log +--enable_query_log + +# The following explain is left here from the original bug report. +# Can be useful if one gets this issue again in a future MariaDB version + +#explain format= json SELECT sysapproval_approver0.`sys_id` FROM ((sysapproval_approver sysapproval_approver0 INNER JOIN task task1 ON sysapproval_approver0.`sysapproval` = task1.`sys_id` AND ((task1.`sys_domain_path` = '/' OR task1.`sys_domain_path` LIKE '!!!/!!#/!!$/%' OR task1.`sys_domain_path` LIKE '!!!/!!!/%'))) INNER JOIN task task2 ON task1.`parent` = task2.`sys_id` AND ((task2.`sys_domain_path` = '/' OR task2.`sys_domain_path` LIKE '!!!/!!#/!!$/%' OR task2.`sys_domain_path` LIKE '!!!/!!!/%'))) WHERE task2.`sys_id` LIKE '8e7792a7dbfffb00fff8a345ca961934%' AND (sysapproval_approver0.`sys_domain_path` = '/' OR sysapproval_approver0.`sys_domain_path` LIKE '!!!/!!#/!!$/%' OR sysapproval_approver0.`sys_domain_path` LIKE '!!!/!!!/%') ORDER BY sysapproval_approver0.`order` LIMIT 0, 50; + + +set optimizer_use_condition_selectivity=1; +analyze SELECT sysapproval_approver0.`sys_id` +FROM ((sysapproval_approver sysapproval_approver0 + INNER JOIN task task1 + ON sysapproval_approver0.`sysapproval` = task1.`sys_id` + AND (( task1.`sys_domain_path` = '/' + OR task1.`sys_domain_path` LIKE '!!!/!!#/!!$/%' + OR task1.`sys_domain_path` LIKE '!!!/!!!/%' ))) + INNER JOIN task task2 + ON task1.`parent` = task2.`sys_id` + AND (( task2.`sys_domain_path` = '/' + OR task2.`sys_domain_path` LIKE '!!!/!!#/!!$/%' + OR task2.`sys_domain_path` LIKE '!!!/!!!/%' ))) +WHERE task2.`sys_id` LIKE '8e7792a7dbfffb00fff8a345ca961934%' + AND ( sysapproval_approver0.`sys_domain_path` = '/' + OR sysapproval_approver0.`sys_domain_path` LIKE '!!!/!!#/!!$/%' + OR sysapproval_approver0.`sys_domain_path` LIKE '!!!/!!!/%' ) +ORDER BY sysapproval_approver0.`order` +LIMIT 0, 50 ; + +set optimizer_use_condition_selectivity=4; +analyze SELECT sysapproval_approver0.`sys_id` +FROM ((sysapproval_approver sysapproval_approver0 + INNER JOIN task task1 + ON sysapproval_approver0.`sysapproval` = task1.`sys_id` + AND (( task1.`sys_domain_path` = '/' + OR task1.`sys_domain_path` LIKE '!!!/!!#/!!$/%' + OR task1.`sys_domain_path` LIKE '!!!/!!!/%' ))) + INNER JOIN task task2 + ON task1.`parent` = task2.`sys_id` + AND (( task2.`sys_domain_path` = '/' + OR task2.`sys_domain_path` LIKE '!!!/!!#/!!$/%' + OR task2.`sys_domain_path` LIKE '!!!/!!!/%' ))) +WHERE task2.`sys_id` LIKE '8e7792a7dbfffb00fff8a345ca961934%' + AND ( sysapproval_approver0.`sys_domain_path` = '/' + OR sysapproval_approver0.`sys_domain_path` LIKE '!!!/!!#/!!$/%' + OR sysapproval_approver0.`sys_domain_path` LIKE '!!!/!!!/%' ) +ORDER BY sysapproval_approver0.`order` +LIMIT 0, 50 ; + +drop table sysapproval_approver,task; + +set global innodb_stats_persistent= @innodb_stats_persistent_save; +set global innodb_stats_persistent_sample_pages= + @innodb_stats_persistent_sample_pages_save; diff --git a/mysql-test/main/mysql_client_test-master.opt b/mysql-test/main/mysql_client_test-master.opt index 8d49abf6a10..e3d42121b45 100644 --- a/mysql-test/main/mysql_client_test-master.opt +++ b/mysql-test/main/mysql_client_test-master.opt @@ -3,3 +3,4 @@ --log-output=FILE,TABLE --max-allowed-packet=32000000 --proxy-protocol-networks=* +--sequence=on diff --git a/mysql-test/main/mysql_client_test_comp-master.opt b/mysql-test/main/mysql_client_test_comp-master.opt index 6c4a5e4c782..ccaa4a8ee6e 100644 --- a/mysql-test/main/mysql_client_test_comp-master.opt +++ b/mysql-test/main/mysql_client_test_comp-master.opt @@ -1,3 +1,4 @@ --loose-enable-performance-schema --max-allowed-packet=32000000 --proxy-protocol-networks=::1/32,127.0.0.0/8,localhost +--sequence=on diff --git a/mysql-test/main/mysql_client_test_nonblock-master.opt b/mysql-test/main/mysql_client_test_nonblock-master.opt index a39d0089562..f306d27feac 100644 --- a/mysql-test/main/mysql_client_test_nonblock-master.opt +++ b/mysql-test/main/mysql_client_test_nonblock-master.opt @@ -1,3 +1,4 @@ --general-log --general-log-file=$MYSQLTEST_VARDIR/log/master.log --log-output=FILE,TABLE --max-allowed-packet=32000000 --proxy-protocol-networks=::1,::ffff:127.0.0.1/97,localhost +--sequence=on diff --git a/mysql-test/main/mysql_tzinfo_to_sql_symlink.result b/mysql-test/main/mysql_tzinfo_to_sql_symlink.result index f4694cbedae..568a280158a 100644 --- a/mysql-test/main/mysql_tzinfo_to_sql_symlink.result +++ b/mysql-test/main/mysql_tzinfo_to_sql_symlink.result @@ -1,3 +1,14 @@ +use mysql; +RENAME TABLE time_zone TO time_zone_orig, +time_zone_name TO time_zone_name_orig, +time_zone_transition TO time_zone_transition_orig, +time_zone_transition_type TO time_zone_transition_type_orig, +time_zone_leap_second TO time_zone_leap_second_orig; +CREATE TABLE time_zone LIKE time_zone_orig; +CREATE TABLE time_zone_name LIKE time_zone_name_orig; +CREATE TABLE time_zone_transition LIKE time_zone_transition_orig; +CREATE TABLE time_zone_transition_type LIKE time_zone_transition_type_orig; +CREATE TABLE time_zone_leap_second LIKE time_zone_leap_second_orig; # # MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above # @@ -9,13 +20,18 @@ ALTER TABLE time_zone ENGINE=InnoDB; ALTER TABLE time_zone_name ENGINE=InnoDB; ALTER TABLE time_zone_transition ENGINE=InnoDB; ALTER TABLE time_zone_transition_type ENGINE=InnoDB; -END IF| -\d ; TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition_type; START TRANSACTION; +ELSE +TRUNCATE TABLE time_zone; +TRUNCATE TABLE time_zone_name; +TRUNCATE TABLE time_zone_transition; +TRUNCATE TABLE time_zone_transition_type; +END IF| +\d ; INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); SET @time_zone_id= LAST_INSERT_ID(); INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id); @@ -33,6 +49,7 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, `Offset Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/garbage' as time zone. Skipping it. Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/ignored.tab' as time zone. Skipping it. Warning: Skipping directory 'MYSQLTEST_VARDIR/zoneinfo/posix/posix': to avoid infinite symlink recursion. +UNLOCK TABLES; COMMIT; ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; @@ -41,11 +58,26 @@ IF (select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=Aria; ALTER TABLE time_zone_name ENGINE=Aria; -ALTER TABLE time_zone_transition ENGINE=Aria; -ALTER TABLE time_zone_transition_type ENGINE=Aria; +ALTER TABLE time_zone_transition ENGINE=Aria, ORDER BY Time_zone_id, Transition_time; +ALTER TABLE time_zone_transition_type ENGINE=Aria, ORDER BY Time_zone_id, Transition_type_id; END IF| \d ; -# Silent run +SELECT COUNT(*) FROM time_zone; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_name; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition_type; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_leap_second; +COUNT(*) +0 +# Run on zoneinfo directory \d | IF (select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON') = 1 THEN @@ -53,13 +85,18 @@ ALTER TABLE time_zone ENGINE=InnoDB; ALTER TABLE time_zone_name ENGINE=InnoDB; ALTER TABLE time_zone_transition ENGINE=InnoDB; ALTER TABLE time_zone_transition_type ENGINE=InnoDB; -END IF| -\d ; TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition_type; START TRANSACTION; +ELSE +TRUNCATE TABLE time_zone; +TRUNCATE TABLE time_zone_name; +TRUNCATE TABLE time_zone_transition; +TRUNCATE TABLE time_zone_transition_type; +END IF| +\d ; INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); SET @time_zone_id= LAST_INSERT_ID(); INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id); @@ -74,6 +111,7 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, `Offset (@time_zone_id, 0, 0, 0, 'GMT') ; Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/garbage' as time zone. Skipping it. +UNLOCK TABLES; COMMIT; ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; @@ -82,10 +120,78 @@ IF (select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=Aria; ALTER TABLE time_zone_name ENGINE=Aria; -ALTER TABLE time_zone_transition ENGINE=Aria; -ALTER TABLE time_zone_transition_type ENGINE=Aria; +ALTER TABLE time_zone_transition ENGINE=Aria, ORDER BY Time_zone_id, Transition_time; +ALTER TABLE time_zone_transition_type ENGINE=Aria, ORDER BY Time_zone_id, Transition_type_id; END IF| \d ; +SELECT COUNT(*) FROM time_zone; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_name; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_transition; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition_type; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_leap_second; +COUNT(*) +0 +# +# Run on zoneinfo directory --skip-write-binlog +# +set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?'); +prepare set_wsrep_write_binlog from @prep1; +set @toggle=0; execute set_wsrep_write_binlog using @toggle; +TRUNCATE TABLE time_zone; +TRUNCATE TABLE time_zone_name; +TRUNCATE TABLE time_zone_transition; +TRUNCATE TABLE time_zone_transition_type; +LOCK TABLES time_zone WRITE, + time_zone_leap_second WRITE, + time_zone_name WRITE, + time_zone_transition WRITE, + time_zone_transition_type WRITE; +INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); +SET @time_zone_id= LAST_INSERT_ID(); +INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id); +INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, `Offset`, Is_DST, Abbreviation) VALUES + (@time_zone_id, 0, 0, 0, 'GMT') +; +Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/garbage' as time zone. Skipping it. +INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); +SET @time_zone_id= LAST_INSERT_ID(); +INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('posix/GMT', @time_zone_id); +INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, `Offset`, Is_DST, Abbreviation) VALUES + (@time_zone_id, 0, 0, 0, 'GMT') +; +Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/garbage' as time zone. Skipping it. +UNLOCK TABLES; +COMMIT; +ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; +ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; +SELECT COUNT(*) FROM time_zone; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_name; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_transition; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition_type; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_leap_second; +COUNT(*) +0 +TRUNCATE TABLE time_zone; +TRUNCATE TABLE time_zone_name; +TRUNCATE TABLE time_zone_transition; +TRUNCATE TABLE time_zone_transition_type; +TRUNCATE TABLE time_zone_leap_second; # # Testing with explicit timezonefile # @@ -96,6 +202,10 @@ ALTER TABLE time_zone ENGINE=InnoDB; ALTER TABLE time_zone_name ENGINE=InnoDB; ALTER TABLE time_zone_transition ENGINE=InnoDB; ALTER TABLE time_zone_transition_type ENGINE=InnoDB; +SELECT 'skip truncate tables'; +START TRANSACTION; +ELSE +SELECT 'skip truncate tables'; END IF| \d ; INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); @@ -104,15 +214,79 @@ INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('XXX', @time_zone_id); INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, `Offset`, Is_DST, Abbreviation) VALUES (@time_zone_id, 0, 0, 0, 'GMT') ; +UNLOCK TABLES; +COMMIT; \d | IF (select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=Aria; ALTER TABLE time_zone_name ENGINE=Aria; -ALTER TABLE time_zone_transition ENGINE=Aria; -ALTER TABLE time_zone_transition_type ENGINE=Aria; +ALTER TABLE time_zone_transition ENGINE=Aria, ORDER BY Time_zone_id, Transition_time; +ALTER TABLE time_zone_transition_type ENGINE=Aria, ORDER BY Time_zone_id, Transition_type_id; END IF| \d ; +skip truncate tables +skip truncate tables +SELECT COUNT(*) FROM time_zone; +COUNT(*) +1 +SELECT COUNT(*) FROM time_zone_name; +COUNT(*) +1 +SELECT COUNT(*) FROM time_zone_transition; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition_type; +COUNT(*) +1 +SELECT COUNT(*) FROM time_zone_leap_second; +COUNT(*) +0 +TRUNCATE TABLE time_zone; +TRUNCATE TABLE time_zone_name; +TRUNCATE TABLE time_zone_transition; +TRUNCATE TABLE time_zone_transition_type; +TRUNCATE TABLE time_zone_leap_second; +# +# Testing with explicit timezonefile --skip-write-binlog +# +set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?'); +prepare set_wsrep_write_binlog from @prep1; +set @toggle=0; execute set_wsrep_write_binlog using @toggle; +SELECT 'skip truncate tables'; +LOCK TABLES time_zone WRITE, + time_zone_leap_second WRITE, + time_zone_name WRITE, + time_zone_transition WRITE, + time_zone_transition_type WRITE; +INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); +SET @time_zone_id= LAST_INSERT_ID(); +INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('XXX', @time_zone_id); +INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, `Offset`, Is_DST, Abbreviation) VALUES + (@time_zone_id, 0, 0, 0, 'GMT') +; +UNLOCK TABLES; +COMMIT; +SELECT COUNT(*) FROM time_zone; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_name; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition_type; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_leap_second; +COUNT(*) +0 +TRUNCATE TABLE time_zone; +TRUNCATE TABLE time_zone_name; +TRUNCATE TABLE time_zone_transition; +TRUNCATE TABLE time_zone_transition_type; +TRUNCATE TABLE time_zone_leap_second; # # Testing --leap # @@ -123,6 +297,10 @@ ALTER TABLE time_zone ENGINE=InnoDB; ALTER TABLE time_zone_name ENGINE=InnoDB; ALTER TABLE time_zone_transition ENGINE=InnoDB; ALTER TABLE time_zone_transition_type ENGINE=InnoDB; +SELECT 'skip truncate tables'; +START TRANSACTION; +ELSE +SELECT 'skip truncate tables'; END IF| \d ; \d | @@ -139,15 +317,72 @@ ALTER TABLE time_zone_leap_second ENGINE=Aria; END IF| \d ; ALTER TABLE time_zone_leap_second ORDER BY Transition_time; +UNLOCK TABLES; +COMMIT; \d | IF (select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=Aria; ALTER TABLE time_zone_name ENGINE=Aria; -ALTER TABLE time_zone_transition ENGINE=Aria; -ALTER TABLE time_zone_transition_type ENGINE=Aria; +ALTER TABLE time_zone_transition ENGINE=Aria, ORDER BY Time_zone_id, Transition_time; +ALTER TABLE time_zone_transition_type ENGINE=Aria, ORDER BY Time_zone_id, Transition_type_id; END IF| \d ; +skip truncate tables +skip truncate tables +SELECT COUNT(*) FROM time_zone; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_name; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition_type; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_leap_second; +COUNT(*) +0 +TRUNCATE TABLE time_zone; +TRUNCATE TABLE time_zone_name; +TRUNCATE TABLE time_zone_transition; +TRUNCATE TABLE time_zone_transition_type; +TRUNCATE TABLE time_zone_leap_second; +# +# Testing --skip-write-binlog --leap +# +set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?'); +prepare set_wsrep_write_binlog from @prep1; +set @toggle=0; execute set_wsrep_write_binlog using @toggle; +SELECT 'skip truncate tables'; +LOCK TABLES time_zone WRITE, + time_zone_leap_second WRITE, + time_zone_name WRITE, + time_zone_transition WRITE, + time_zone_transition_type WRITE; +TRUNCATE TABLE time_zone_leap_second; +ALTER TABLE time_zone_leap_second ORDER BY Transition_time; +UNLOCK TABLES; +COMMIT; +skip truncate tables +skip truncate tables +SELECT COUNT(*) FROM time_zone; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_name; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition_type; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_leap_second; +COUNT(*) +0 # # MDEV-6236 - [PATCH] mysql_tzinfo_to_sql may produce invalid SQL # @@ -158,13 +393,19 @@ ALTER TABLE time_zone ENGINE=InnoDB; ALTER TABLE time_zone_name ENGINE=InnoDB; ALTER TABLE time_zone_transition ENGINE=InnoDB; ALTER TABLE time_zone_transition_type ENGINE=InnoDB; -END IF| -\d ; TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition_type; START TRANSACTION; +ELSE +TRUNCATE TABLE time_zone; +TRUNCATE TABLE time_zone_name; +TRUNCATE TABLE time_zone_transition; +TRUNCATE TABLE time_zone_transition_type; +END IF| +\d ; +UNLOCK TABLES; COMMIT; ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; @@ -173,7 +414,17 @@ IF (select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=Aria; ALTER TABLE time_zone_name ENGINE=Aria; -ALTER TABLE time_zone_transition ENGINE=Aria; -ALTER TABLE time_zone_transition_type ENGINE=Aria; +ALTER TABLE time_zone_transition ENGINE=Aria, ORDER BY Time_zone_id, Transition_time; +ALTER TABLE time_zone_transition_type ENGINE=Aria, ORDER BY Time_zone_id, Transition_type_id; END IF| \d ; +DROP TABLE time_zone; +DROP TABLE time_zone_name; +DROP TABLE time_zone_transition; +DROP TABLE time_zone_transition_type; +DROP TABLE time_zone_leap_second; +RENAME TABLE time_zone_orig TO time_zone, +time_zone_name_orig TO time_zone_name, +time_zone_transition_orig TO time_zone_transition, +time_zone_transition_type_orig TO time_zone_transition_type, +time_zone_leap_second_orig TO time_zone_leap_second; diff --git a/mysql-test/main/mysql_tzinfo_to_sql_symlink.test b/mysql-test/main/mysql_tzinfo_to_sql_symlink.test index 8ca82b87e30..fe7275294d5 100644 --- a/mysql-test/main/mysql_tzinfo_to_sql_symlink.test +++ b/mysql-test/main/mysql_tzinfo_to_sql_symlink.test @@ -1,5 +1,18 @@ --source include/have_symlink.inc --source include/not_windows.inc +--source include/not_embedded.inc + +use mysql; +RENAME TABLE time_zone TO time_zone_orig, + time_zone_name TO time_zone_name_orig, + time_zone_transition TO time_zone_transition_orig, + time_zone_transition_type TO time_zone_transition_type_orig, + time_zone_leap_second TO time_zone_leap_second_orig; +CREATE TABLE time_zone LIKE time_zone_orig; +CREATE TABLE time_zone_name LIKE time_zone_name_orig; +CREATE TABLE time_zone_transition LIKE time_zone_transition_orig; +CREATE TABLE time_zone_transition_type LIKE time_zone_transition_type_orig; +CREATE TABLE time_zone_leap_second LIKE time_zone_leap_second_orig; --echo # --echo # MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above @@ -14,10 +27,41 @@ --echo # Verbose run --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --exec $MYSQL_TZINFO_TO_SQL --verbose $MYSQLTEST_VARDIR/zoneinfo 2>&1 +SELECT COUNT(*) FROM time_zone; +SELECT COUNT(*) FROM time_zone_name; +SELECT COUNT(*) FROM time_zone_transition; +SELECT COUNT(*) FROM time_zone_transition_type; +SELECT COUNT(*) FROM time_zone_leap_second; ---echo # Silent run +--echo # Run on zoneinfo directory --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo 2>&1 +--exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo 2>/dev/null | $MYSQL -S $MASTER_MYSOCK -u root mysql +SELECT COUNT(*) FROM time_zone; +SELECT COUNT(*) FROM time_zone_name; +SELECT COUNT(*) FROM time_zone_transition; +SELECT COUNT(*) FROM time_zone_transition_type; +SELECT COUNT(*) FROM time_zone_leap_second; + +--echo # +--echo # Run on zoneinfo directory --skip-write-binlog +--echo # + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo 2>&1 +--exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo 2>/dev/null | $MYSQL -S $MASTER_MYSOCK -u root mysql +SELECT COUNT(*) FROM time_zone; +SELECT COUNT(*) FROM time_zone_name; +SELECT COUNT(*) FROM time_zone_transition; +SELECT COUNT(*) FROM time_zone_transition_type; +SELECT COUNT(*) FROM time_zone_leap_second; + +# Below tests don't include TRUNCATE TABLE so clear them. +TRUNCATE TABLE time_zone; +TRUNCATE TABLE time_zone_name; +TRUNCATE TABLE time_zone_transition; +TRUNCATE TABLE time_zone_transition_type; +TRUNCATE TABLE time_zone_leap_second; --echo # --echo # Testing with explicit timezonefile @@ -25,13 +69,68 @@ --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo/GMT XXX 2>&1 +--exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo/GMT XXX 2>/dev/null | $MYSQL -S $MASTER_MYSOCK -u root mysql +SELECT COUNT(*) FROM time_zone; +SELECT COUNT(*) FROM time_zone_name; +SELECT COUNT(*) FROM time_zone_transition; +SELECT COUNT(*) FROM time_zone_transition_type; +SELECT COUNT(*) FROM time_zone_leap_second; + +TRUNCATE TABLE time_zone; +TRUNCATE TABLE time_zone_name; +TRUNCATE TABLE time_zone_transition; +TRUNCATE TABLE time_zone_transition_type; +TRUNCATE TABLE time_zone_leap_second; + +--echo # +--echo # Testing with explicit timezonefile --skip-write-binlog +--echo # + +--exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo/GMT XXX 2>&1 +--exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo/GMT 2>/dev/null | $MYSQL -S $MASTER_MYSOCK -u root mysql +SELECT COUNT(*) FROM time_zone; +SELECT COUNT(*) FROM time_zone_name; +SELECT COUNT(*) FROM time_zone_transition; +SELECT COUNT(*) FROM time_zone_transition_type; +SELECT COUNT(*) FROM time_zone_leap_second; + +TRUNCATE TABLE time_zone; +TRUNCATE TABLE time_zone_name; +TRUNCATE TABLE time_zone_transition; +TRUNCATE TABLE time_zone_transition_type; +TRUNCATE TABLE time_zone_leap_second; --echo # --echo # Testing --leap --echo # --exec $MYSQL_TZINFO_TO_SQL --leap $MYSQLTEST_VARDIR/zoneinfo/GMT 2>&1 +--exec $MYSQL_TZINFO_TO_SQL --leap $MYSQLTEST_VARDIR/zoneinfo/GMT 2>/dev/null | $MYSQL -S $MASTER_MYSOCK -u root mysql +SELECT COUNT(*) FROM time_zone; +SELECT COUNT(*) FROM time_zone_name; +SELECT COUNT(*) FROM time_zone_transition; +SELECT COUNT(*) FROM time_zone_transition_type; +SELECT COUNT(*) FROM time_zone_leap_second; +TRUNCATE TABLE time_zone; +TRUNCATE TABLE time_zone_name; +TRUNCATE TABLE time_zone_transition; +TRUNCATE TABLE time_zone_transition_type; +TRUNCATE TABLE time_zone_leap_second; + +--echo # +--echo # Testing --skip-write-binlog --leap +--echo # + +--exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog --leap $MYSQLTEST_VARDIR/zoneinfo/GMT 2>&1 +--exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog --leap $MYSQLTEST_VARDIR/zoneinfo/GMT 2>/dev/null | $MYSQL -S $MASTER_MYSOCK -u root mysql +SELECT COUNT(*) FROM time_zone; +SELECT COUNT(*) FROM time_zone_name; +SELECT COUNT(*) FROM time_zone_transition; +SELECT COUNT(*) FROM time_zone_transition_type; +SELECT COUNT(*) FROM time_zone_leap_second; + +# # # Cleanup # @@ -48,3 +147,13 @@ --exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo 2>&1 --exec rm -rf $MYSQLTEST_VARDIR/zoneinfo +DROP TABLE time_zone; +DROP TABLE time_zone_name; +DROP TABLE time_zone_transition; +DROP TABLE time_zone_transition_type; +DROP TABLE time_zone_leap_second; +RENAME TABLE time_zone_orig TO time_zone, + time_zone_name_orig TO time_zone_name, + time_zone_transition_orig TO time_zone_transition, + time_zone_transition_type_orig TO time_zone_transition_type, + time_zone_leap_second_orig TO time_zone_leap_second; diff --git a/mysql-test/main/mysql_upgrade-6984.test b/mysql-test/main/mysql_upgrade-6984.test index 4c5c44493e2..48a06bbd542 100644 --- a/mysql-test/main/mysql_upgrade-6984.test +++ b/mysql-test/main/mysql_upgrade-6984.test @@ -14,6 +14,7 @@ update mysql.global_priv set priv=json_set(priv, '$.plugin', 'mysql_native_password', '$.authentication_string', password('foo')) where user='root'; +--replace_regex /[^ ]*mysql_upgrade_info/...mysql_upgrade_info/ --exec $MYSQL_UPGRADE connect(con1,localhost,root,foo,,,); @@ -22,3 +23,6 @@ update mysql.global_priv set priv=json_compact(json_remove(priv, '$.plugin', '$. flush privileges; # Load event table set global event_scheduler=OFF; + +let MYSQLD_DATADIR= `select @@datadir`; +--remove_file $MYSQLD_DATADIR/mysql_upgrade_info diff --git a/mysql-test/main/mysql_upgrade.result b/mysql-test/main/mysql_upgrade.result index 317622a391c..0649c9139fd 100644 --- a/mysql-test/main/mysql_upgrade.result +++ b/mysql-test/main/mysql_upgrade.result @@ -149,7 +149,8 @@ test Phase 7/7: Running 'FLUSH PRIVILEGES' OK Run it again - should say already completed -This installation of MariaDB is already upgraded to VERSION, use --force if you still need to run mysql_upgrade +This installation of MariaDB is already upgraded to VERSION.There is no need to run mysql_upgrade again for VERSION. +You can use --force if you still want to run mysql_upgrade Force should run it regardless of whether it has been run before Phase 1/7: Checking and upgrading mysql database Processing databases @@ -451,11 +452,12 @@ test Phase 7/7: Running 'FLUSH PRIVILEGES' OK DROP USER mysqltest1@'%'; -Version check failed. Got the following error when calling the 'mysql' command line client +Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client ERROR 1045 (28000): Access denied for user 'mysqltest1'@'localhost' (using password: YES) FATAL ERROR: Upgrade failed Run mysql_upgrade with a non existing server socket -mysqlcheck: Got error: 2005: Unknown server host 'not_existing_host' (errno) when trying to connect +Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client +ERROR 2005 (HY000): Unknown server host 'not_existing_host' (errno) FATAL ERROR: Upgrade failed set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE'; Phase 1/7: Checking and upgrading mysql database @@ -1126,9 +1128,12 @@ OK # Bug #21489398: MYSQL_UPGRADE: FATAL ERROR: UPGRADE FAILED - IMPROVE ERROR # Run mysql_upgrade with unauthorized access -Version check failed. Got the following error when calling the 'mysql' command line client +Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) FATAL ERROR: Upgrade failed +Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client +ERROR 1045 (errno): Access denied for user 'root'@'localhost' (using password: YES) +FATAL ERROR: Upgrade failed # # MDEV-4332 Increase username length from 16 characters # MDEV-6068, MDEV-6178 mysql_upgrade breaks databases with long user names @@ -1890,6 +1895,34 @@ GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION GRANT USAGE ON *.* TO `aRole` DROP ROLE `aRole`; FLUSH PRIVILEGES; +# +# MDEV-27279: mariadb_upgrade add --check-if-upgrade-is-needed +# +This installation of MariaDB is already upgraded to MariaDB . +There is no need to run mysql_upgrade again for MariaDB . +Looking for 'mysql' as: mysql +This installation of MariaDB is already upgraded to MariaDB . +There is no need to run mysql_upgrade again for MariaDB . +# +# MDEV-27279: mariadb_upgrade check-if-upgrade absence is do it +# +Looking for 'mysql' as: mysql +Empty or non existent ...mysql_upgrade_info. Assuming mysql_upgrade has to be run! +# +# MDEV-27279: mariadb_upgrade check-if-upgrade with minor version change +# +Looking for 'mysql' as: mysql +This installation of MariaDB is already upgraded to MariaDB . +There is no need to run mysql_upgrade again for MariaDB . +This installation of MariaDB is already upgraded to MariaDB . +There is no need to run mysql_upgrade again for MariaDB . +You can use --force if you still want to run mysql_upgrade +# +# MDEV-27279: mariadb_upgrade check-if-upgrade with major version change +# +Major version upgrade detected from MariaDB to MariaDB . Check required! +Looking for 'mysql' as: mysql +Major version upgrade detected from MariaDB to MariaDB . Check required! drop table mysql.global_priv; rename table mysql.global_priv_bak to mysql.global_priv; # End of 10.2 tests diff --git a/mysql-test/main/mysql_upgrade.test b/mysql-test/main/mysql_upgrade.test index e81666585d3..083f033daf5 100644 --- a/mysql-test/main/mysql_upgrade.test +++ b/mysql-test/main/mysql_upgrade.test @@ -17,7 +17,7 @@ let $MYSQLD_DATADIR= `select @@datadir`; file_exists $MYSQLD_DATADIR/mysql_upgrade_info; --echo Run it again - should say already completed ---replace_regex /upgraded to .*, use/upgraded to VERSION, use/ +--replace_regex /upgraded to [^\n].*/upgraded to VERSION./ /again for [^\n]*/again for VERSION./ --exec $MYSQL_UPGRADE 2>&1 # It should have created a file in the MySQL Servers datadir @@ -125,7 +125,7 @@ let $MYSQLD_DATADIR= `select @@datadir`; --remove_file $MYSQLD_DATADIR/mysql_upgrade_info --echo # Running mysql_upgrade with --skip-write-binlog.. ---replace_result $MYSQLTEST_VARDIR var +--replace_regex /[^ ]*mysql_upgrade_info/...mysql_upgrade_info/ --exec $MYSQL_UPGRADE --skip-write-binlog # mysql_upgrade must have created mysql_upgrade_info file, @@ -139,6 +139,9 @@ let $MYSQLD_DATADIR= `select @@datadir`; --echo Run mysql_upgrade with unauthorized access --error 1 --exec $MYSQL_UPGRADE --skip-verbose --user=root --password=wrong_password 2>&1 +--replace_regex /.*mysqlcheck.*: Got/mysqlcheck: Got/ /\([0-9|-]*\)/(errno)/ +--error 1 +--exec $MYSQL_UPGRADE --skip-verbose --skip-version-check --user=root --password=wrong_password 2>&1 --echo # --echo # MDEV-4332 Increase username length from 16 characters @@ -232,6 +235,7 @@ FLUSH TABLES mysql.user; FLUSH PRIVILEGES; SHOW CREATE TABLE mysql.user; +--replace_result $MYSQLTEST_VARDIR var --exec $MYSQL_UPGRADE --force 2>&1 SHOW CREATE TABLE mysql.user; @@ -276,6 +280,79 @@ SHOW GRANTS; DROP ROLE `aRole`; --exec $MYSQL mysql < $MYSQLTEST_VARDIR/tmp/user.sql FLUSH PRIVILEGES; + +--echo # +--echo # MDEV-27279: mariadb_upgrade add --check-if-upgrade-is-needed +--echo # + +--error 1 +--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --silent +--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB / +--error 1 +--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed +--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB / /'mysql.* as:[^\n]*/'mysql' as: mysql/ +--error 1 +--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --verbose + +--echo # +--echo # MDEV-27279: mariadb_upgrade check-if-upgrade absence is do it +--echo # + +--remove_file $MYSQLD_DATADIR/mysql_upgrade_info +--replace_regex /[^ ]*mysql_upgrade_info/...mysql_upgrade_info/ +--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed + +--replace_regex /'mysql.* as:[^\n]*/'mysql' as: mysql/ /open .* Assuming/open XXX. Assuming/ /[^ ]*mysql_upgrade_info/...mysql_upgrade_info/ +--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --verbose + +--echo # +--echo # MDEV-27279: mariadb_upgrade check-if-upgrade with minor version change +--echo # + +# take 3rd number of version and change to 0 + +let DATADIR= $MYSQLD_DATADIR; + +perl; + my $ver= $ENV{'MYSQL_SERVER_VERSION'} or die "MYSQL_SERVER_VERSION not set"; + my $file= $ENV{'DATADIR'} or die "MYSQLD_DATADIR not set"; + $ver =~ s/^(\d*)\.(\d*).(\d*)(.*)/$1.$2.0$4/; + open(FILE, ">$file/mysql_upgrade_info") or die "Failed to open $file"; + print FILE "$ver\n"; + close(FILE); +EOF + +--error 1 +--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --silent +--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB / /'mysql.* as:[^\n]*/'mysql' as: mysql/ +--error 1 +--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --verbose +--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB / +--exec $MYSQL_UPGRADE +--remove_file $MYSQLD_DATADIR/mysql_upgrade_info + +--echo # +--echo # MDEV-27279: mariadb_upgrade check-if-upgrade with major version change +--echo # + +# take 2rd number of version and change to 0 + +let DATADIR= $MYSQLD_DATADIR; + +perl; + my $ver= $ENV{'MYSQL_SERVER_VERSION'} or die "MYSQL_SERVER_VERSION not set"; + my $file= $ENV{'DATADIR'} or die "MYSQLD_DATADIR not set"; + $ver =~ s/^(\d*)\.(\d*).(\d*)(.*)/$1.0.$3$4/; + open(FILE, ">$file/mysql_upgrade_info") or die "Failed to open $file"; + print FILE "$ver\n"; + close(FILE); +EOF + +--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --silent +--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB / +--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed +--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB / /'mysql.* as:[^\n]*/'mysql' as: mysql/ +--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --verbose --remove_file $MYSQLD_DATADIR/mysql_upgrade_info drop table mysql.global_priv; rename table mysql.global_priv_bak to mysql.global_priv; diff --git a/mysql-test/main/mysql_upgrade_noengine.result b/mysql-test/main/mysql_upgrade_noengine.result index 7d2bbca7c43..459a1a6ce34 100644 --- a/mysql-test/main/mysql_upgrade_noengine.result +++ b/mysql-test/main/mysql_upgrade_noengine.result @@ -55,6 +55,7 @@ Warnings: Level Warning Code 1286 Message Unknown storage engine 'ARCHIVE' +# upgrade from 10.1 - engines aren't enabled Phase 1/7: Checking and upgrading mysql database Processing databases mysql @@ -250,6 +251,8 @@ rename table mysql.global_priv_bak to mysql.global_priv; # switching from mysql.global_priv to mysql.user drop view mysql.user_bak; alter table mysql.user drop column default_role, drop column max_statement_time; +# still upgrade from 10.1 +Major version upgrade detected from MariaDB to MariaDB . Check required! Phase 1/7: Checking and upgrading mysql database Processing databases mysql @@ -445,6 +448,7 @@ rename table mysql.global_priv_bak to mysql.global_priv; # switching from mysql.global_priv to mysql.user drop view mysql.user_bak; alter table mysql.user drop column default_role, drop column max_statement_time; +# upgrade from 10.0 - engines are enabled Phase 1/7: Checking and upgrading mysql database Processing databases mysql diff --git a/mysql-test/main/mysql_upgrade_noengine.test b/mysql-test/main/mysql_upgrade_noengine.test index efe36c355ab..a2d229dc9be 100644 --- a/mysql-test/main/mysql_upgrade_noengine.test +++ b/mysql-test/main/mysql_upgrade_noengine.test @@ -32,7 +32,8 @@ uninstall plugin archive; select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test' and table_name='t1'; select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test' and table_name='t2'; -# upgrade from 10.1 - engines aren't enabled +--echo # upgrade from 10.1 - engines aren't enabled +--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB / exec $MYSQL_UPGRADE 2>&1; select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test' and table_name='t1'; select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test' and table_name='t2'; @@ -51,7 +52,8 @@ write_file $datadir/mysql_upgrade_info; 10.1.10-MariaDB EOF -# still upgrade from 10.1 +--echo # still upgrade from 10.1 +--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB / exec $MYSQL_UPGRADE 2>&1; select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test' and table_name='t1'; select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test' and table_name='t2'; @@ -64,7 +66,8 @@ drop view mysql.user_bak; alter table mysql.user drop column default_role, drop column max_statement_time; remove_file $datadir/mysql_upgrade_info; -# upgrade from 10.0 - engines are enabled +--echo # upgrade from 10.0 - engines are enabled +--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB / exec $MYSQL_UPGRADE 2>&1; select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test' and table_name='t1'; select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test' and table_name='t2'; diff --git a/mysql-test/main/mysqld--help-aria.result b/mysql-test/main/mysqld--help-aria.result index fb44c3ea3ee..3e72f0aaff4 100644 --- a/mysql-test/main/mysqld--help-aria.result +++ b/mysql-test/main/mysqld--help-aria.result @@ -1,3 +1,4 @@ +flush tables; # # Check that we don't write any data to wrong or not existing datadir # diff --git a/mysql-test/main/mysqld--help-aria.test b/mysql-test/main/mysqld--help-aria.test index 55131e9e4eb..2bd332c1484 100644 --- a/mysql-test/main/mysqld--help-aria.test +++ b/mysql-test/main/mysqld--help-aria.test @@ -1,6 +1,7 @@ # # Check errors from mysqld--help when providing different datadir # +flush tables; --let $args=--table-cache=5 --max-connections=10 --log-warnings=1 --silent-startup --lower-case-table-names=1 --help --verbose diff --git a/mysql-test/main/mysqldump-system,win.rdiff b/mysql-test/main/mysqldump-system,win.rdiff index a46b422e95f..57ce772a452 100644 --- a/mysql-test/main/mysqldump-system,win.rdiff +++ b/mysql-test/main/mysqldump-system,win.rdiff @@ -1,21 +1,26 @@ --- mysqldump-system.result +++ mysqldump-system,win.result -@@ -442,7 +442,7 @@ +@@ -449,9 +449,9 @@ + Table Checksum + mysql.roles_mapping 2510045525 mysql.time_zone_transition 3895294076 - mysql.plugin 0 - mysql.servers 2783974349 +-mysql.plugin 1587119305 ++mysql.plugin 2184891911 + mysql.servers 2079085450 -mysql.func 3241572444 +mysql.func 310494789 mysql.innodb_table_stats 347867921 mysql.table_stats 664320059 # Opps.... -@@ -477,7 +477,7 @@ +@@ -484,9 +484,9 @@ + Table Checksum + mysql.roles_mapping 2510045525 mysql.time_zone_transition 3895294076 - mysql.plugin 0 - mysql.servers 2783974349 +-mysql.plugin 1587119305 ++mysql.plugin 2184891911 + mysql.servers 2079085450 -mysql.func 3241572444 +mysql.func 310494789 mysql.innodb_table_stats 347867921 mysql.table_stats 664320059 DROP FUNCTION IF EXISTS metaphon; - diff --git a/mysql-test/main/mysqldump-system.result b/mysql-test/main/mysqldump-system.result index 3beaced5793..bf2d60c698c 100644 --- a/mysql-test/main/mysqldump-system.result +++ b/mysql-test/main/mysqldump-system.result @@ -1,3 +1,4 @@ +install soname 'auth_test_plugin'; # # MDEV-23630: mysqldump to logically dump system tables # @@ -9,13 +10,13 @@ insert into tables_priv select * from mysql.tables_priv; delete from mysql.global_priv where host not in ('localhost'); flush privileges; alter user 'mariadb.sys'@'localhost' ACCOUNT UNLOCK; -create user USER; +create user foobar IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; CREATE ROLE role_1; CREATE ROLE role_2 WITH ADMIN role_1; GRANT SHOW DATABASES ON *.* TO role_1; -GRANT role_1 TO USER; -GRANT role_2 TO USER; -SET DEFAULT ROLE role_2 FOR USER; +GRANT role_1 TO foobar; +GRANT role_2 TO foobar; +SET DEFAULT ROLE role_2 FOR foobar; ALTER TABLE mysql.roles_mapping ORDER BY Host, User, Role; set @save_innodb_stats_persistent= @@innodb_stats_persistent; create table mysql.tz like mysql.time_zone_transition; @@ -49,9 +50,11 @@ CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB"; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +INSTALL PLUGIN test_plugin_server SONAME 'AUTH_TEST_PLUGIN_LIB'; +INSTALL PLUGIN cleartext_plugin_server SONAME 'AUTH_TEST_PLUGIN_LIB'; CREATE USER `mariadb.sys`@`localhost` PASSWORD EXPIRE; CREATE USER `root`@`localhost`; -CREATE USER `USER`@`%`; +CREATE USER `foobar`@`%` IDENTIFIED VIA test_plugin_server USING 'plug_dest'; SELECT COALESCE(CURRENT_ROLE(),'NONE') into @current_role; CREATE ROLE IF NOT EXISTS mariadb_dump_import_role; GRANT mariadb_dump_import_role TO CURRENT_USER(); @@ -71,11 +74,11 @@ GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION; GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION; /*M!100005 SET DEFAULT ROLE NONE FOR 'root'@'localhost' */; /*!80001 ALTER USER 'root'@'localhost' DEFAULT ROLE NONE */; -GRANT `role_1` TO `USER`@`%`; -GRANT `role_2` TO `USER`@`%`; -GRANT USAGE ON *.* TO `USER`@`%`; -/*M!100005 SET DEFAULT ROLE 'role_2' FOR 'USER'@'%' */; -/*!80001 ALTER USER 'USER'@'%' DEFAULT ROLE 'role_2' */; +GRANT `role_1` TO `foobar`@`%`; +GRANT `role_2` TO `foobar`@`%`; +GRANT USAGE ON *.* TO `foobar`@`%` IDENTIFIED VIA test_plugin_server USING 'plug_dest'; +/*M!100005 SET DEFAULT ROLE 'role_2' FOR 'foobar'@'%' */; +/*!80001 ALTER USER 'foobar'@'%' DEFAULT ROLE 'role_2' */; GRANT `role_2` TO `role_1` WITH ADMIN OPTION; GRANT SHOW DATABASES ON *.* TO `role_1`; GRANT USAGE ON *.* TO `role_2`; @@ -90,31 +93,39 @@ USE mysql; LOCK TABLES `column_stats` WRITE; /*!40000 ALTER TABLE `column_stats` DISABLE KEYS */; -REPLACE INTO `column_stats` VALUES ('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,254,'DOUBLE_PREC_HB','\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿'); +REPLACE INTO `column_stats` VALUES +('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,254,'DOUBLE_PREC_HB','\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿'); /*!40000 ALTER TABLE `column_stats` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `index_stats` WRITE; /*!40000 ALTER TABLE `index_stats` DISABLE KEYS */; -REPLACE INTO `index_stats` VALUES ('mysql','tz','PRIMARY',1,98.2500); +REPLACE INTO `index_stats` VALUES +('mysql','tz','PRIMARY',1,98.2500); /*!40000 ALTER TABLE `index_stats` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `table_stats` WRITE; /*!40000 ALTER TABLE `table_stats` DISABLE KEYS */; -REPLACE INTO `table_stats` VALUES ('mysql','tz',393); +REPLACE INTO `table_stats` VALUES +('mysql','tz',393); /*!40000 ALTER TABLE `table_stats` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `innodb_index_stats` WRITE; /*!40000 ALTER TABLE `innodb_index_stats` DISABLE KEYS */; -REPLACE INTO `innodb_index_stats` VALUES ('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index'); +REPLACE INTO `innodb_index_stats` VALUES +('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'), +('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'), +('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'), +('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index'); /*!40000 ALTER TABLE `innodb_index_stats` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `innodb_table_stats` WRITE; /*!40000 ALTER TABLE `innodb_table_stats` DISABLE KEYS */; -REPLACE INTO `innodb_table_stats` VALUES ('mysql','tz','2019-12-31 21:00:00',393,1,0); +REPLACE INTO `innodb_table_stats` VALUES +('mysql','tz','2019-12-31 21:00:00',393,1,0); /*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */; UNLOCK TABLES; @@ -122,31 +133,488 @@ USE mysql; LOCK TABLES `time_zone` WRITE; /*!40000 ALTER TABLE `time_zone` DISABLE KEYS */; -REPLACE INTO `time_zone` VALUES (1,'N'),(2,'N'),(3,'N'),(4,'Y'),(5,'N'); +REPLACE INTO `time_zone` VALUES +(1,'N'), +(2,'N'), +(3,'N'), +(4,'Y'), +(5,'N'); /*!40000 ALTER TABLE `time_zone` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `time_zone_name` WRITE; /*!40000 ALTER TABLE `time_zone_name` DISABLE KEYS */; -REPLACE INTO `time_zone_name` VALUES ('Europe/Moscow',3),('Japan',5),('leap/Europe/Moscow',4),('MET',1),('Universal',2),('UTC',2); +REPLACE INTO `time_zone_name` VALUES +('Europe/Moscow',3), +('Japan',5), +('leap/Europe/Moscow',4), +('MET',1), +('Universal',2), +('UTC',2); /*!40000 ALTER TABLE `time_zone_name` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `time_zone_leap_second` WRITE; /*!40000 ALTER TABLE `time_zone_leap_second` DISABLE KEYS */; -REPLACE INTO `time_zone_leap_second` VALUES (78796800,1),(94694401,2),(126230402,3),(157766403,4),(189302404,5),(220924805,6),(252460806,7),(283996807,8),(315532808,9),(362793609,10),(394329610,11),(425865611,12),(489024012,13),(567993613,14),(631152014,15),(662688015,16),(709948816,17),(741484817,18),(773020818,19),(820454419,20),(867715220,21),(915148821,22); +REPLACE INTO `time_zone_leap_second` VALUES +(78796800,1), +(94694401,2), +(126230402,3), +(157766403,4), +(189302404,5), +(220924805,6), +(252460806,7), +(283996807,8), +(315532808,9), +(362793609,10), +(394329610,11), +(425865611,12), +(489024012,13), +(567993613,14), +(631152014,15), +(662688015,16), +(709948816,17), +(741484817,18), +(773020818,19), +(820454419,20), +(867715220,21), +(915148821,22); /*!40000 ALTER TABLE `time_zone_leap_second` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `time_zone_transition` WRITE; /*!40000 ALTER TABLE `time_zone_transition` DISABLE KEYS */; -REPLACE INTO `time_zone_transition` VALUES (1,-1693706400,0),(1,-1680483600,1),(1,-1663455600,2),(1,-1650150000,3),(1,-1632006000,2),(1,-1618700400,3),(1,-938905200,2),(1,-857257200,3),(1,-844556400,2),(1,-828226800,3),(1,-812502000,2),(1,-796777200,3),(1,228877200,2),(1,243997200,3),(1,260326800,2),(1,276051600,3),(1,291776400,2),(1,307501200,3),(1,323830800,2),(1,338950800,3),(1,354675600,2),(1,370400400,3),(1,386125200,2),(1,401850000,3),(1,417574800,2),(1,433299600,3),(1,449024400,2),(1,465354000,3),(1,481078800,2),(1,496803600,3),(1,512528400,2),(1,528253200,3),(1,543978000,2),(1,559702800,3),(1,575427600,2),(1,591152400,3),(1,606877200,2),(1,622602000,3),(1,638326800,2),(1,654656400,3),(1,670381200,2),(1,686106000,3),(1,701830800,2),(1,717555600,3),(1,733280400,2),(1,749005200,3),(1,764730000,2),(1,780454800,3),(1,796179600,2),(1,811904400,3),(1,828234000,2),(1,846378000,3),(1,859683600,2),(1,877827600,3),(1,891133200,2),(1,909277200,3),(1,922582800,2),(1,941331600,3),(1,954032400,2),(1,972781200,3),(1,985482000,2),(1,1004230800,3),(1,1017536400,2),(1,1035680400,3),(1,1048986000,2),(1,1067130000,3),(1,1080435600,2),(1,1099184400,3),(1,1111885200,2),(1,1130634000,3),(1,1143334800,2),(1,1162083600,3),(1,1174784400,2),(1,1193533200,3),(1,1206838800,2),(1,1224982800,3),(1,1238288400,2),(1,1256432400,3),(1,1269738000,2),(1,1288486800,3),(1,1301187600,2),(1,1319936400,3),(1,1332637200,2),(1,1351386000,3),(1,1364691600,2),(1,1382835600,3),(1,1396141200,2),(1,1414285200,3),(1,1427590800,2),(1,1445734800,3),(1,1459040400,2),(1,1477789200,3),(1,1490490000,2),(1,1509238800,3),(1,1521939600,2),(1,1540688400,3),(1,1553994000,2),(1,1572138000,3),(1,1585443600,2),(1,1603587600,3),(1,1616893200,2),(1,1635642000,3),(1,1648342800,2),(1,1667091600,3),(1,1679792400,2),(1,1698541200,3),(1,1711846800,2),(1,1729990800,3),(1,1743296400,2),(1,1761440400,3),(1,1774746000,2),(1,1792890000,3),(1,1806195600,2),(1,1824944400,3),(1,1837645200,2),(1,1856394000,3),(1,1869094800,2),(1,1887843600,3),(1,1901149200,2),(1,1919293200,3),(1,1932598800,2),(1,1950742800,3),(1,1964048400,2),(1,1982797200,3),(1,1995498000,2),(1,2014246800,3),(1,2026947600,2),(1,2045696400,3),(1,2058397200,2),(1,2077146000,3),(1,2090451600,2),(1,2108595600,3),(1,2121901200,2),(1,2140045200,3),(3,-1688265000,2),(3,-1656819048,1),(3,-1641353448,2),(3,-1627965048,3),(3,-1618716648,1),(3,-1596429048,3),(3,-1593829848,5),(3,-1589860800,4),(3,-1542427200,5),(3,-1539493200,6),(3,-1525323600,5),(3,-1522728000,4),(3,-1491188400,7),(3,-1247536800,4),(3,354920400,5),(3,370728000,4),(3,386456400,5),(3,402264000,4),(3,417992400,5),(3,433800000,4),(3,449614800,5),(3,465346800,8),(3,481071600,9),(3,496796400,8),(3,512521200,9),(3,528246000,8),(3,543970800,9),(3,559695600,8),(3,575420400,9),(3,591145200,8),(3,606870000,9),(3,622594800,8),(3,638319600,9),(3,654649200,8),(3,670374000,10),(3,686102400,11),(3,695779200,8),(3,701812800,5),(3,717534000,4),(3,733273200,9),(3,748998000,8),(3,764722800,9),(3,780447600,8),(3,796172400,9),(3,811897200,8),(3,828226800,9),(3,846370800,8),(3,859676400,9),(3,877820400,8),(3,891126000,9),(3,909270000,8),(3,922575600,9),(3,941324400,8),(3,954025200,9),(3,972774000,8),(3,985474800,9),(3,1004223600,8),(3,1017529200,9),(3,1035673200,8),(3,1048978800,9),(3,1067122800,8),(3,1080428400,9),(3,1099177200,8),(3,1111878000,9),(3,1130626800,8),(3,1143327600,9),(3,1162076400,8),(3,1174777200,9),(3,1193526000,8),(3,1206831600,9),(3,1224975600,8),(3,1238281200,9),(3,1256425200,8),(3,1269730800,9),(3,1288479600,8),(3,1301180400,9),(3,1319929200,8),(3,1332630000,9),(3,1351378800,8),(3,1364684400,9),(3,1382828400,8),(3,1396134000,9),(3,1414278000,8),(3,1427583600,9),(3,1445727600,8),(3,1459033200,9),(3,1477782000,8),(3,1490482800,9),(3,1509231600,8),(3,1521932400,9),(3,1540681200,8),(3,1553986800,9),(3,1572130800,8),(3,1585436400,9),(3,1603580400,8),(3,1616886000,9),(3,1635634800,8),(3,1648335600,9),(3,1667084400,8),(3,1679785200,9),(3,1698534000,8),(3,1711839600,9),(3,1729983600,8),(3,1743289200,9),(3,1761433200,8),(3,1774738800,9),(3,1792882800,8),(3,1806188400,9),(3,1824937200,8),(3,1837638000,9),(3,1856386800,8),(3,1869087600,9),(3,1887836400,8),(3,1901142000,9),(3,1919286000,8),(3,1932591600,9),(3,1950735600,8),(3,1964041200,9),(3,1982790000,8),(3,1995490800,9),(3,2014239600,8),(3,2026940400,9),(3,2045689200,8),(3,2058390000,9),(3,2077138800,8),(3,2090444400,9),(3,2108588400,8),(3,2121894000,9),(3,2140038000,8),(4,-1688265000,2),(4,-1656819048,1),(4,-1641353448,2),(4,-1627965048,3),(4,-1618716648,1),(4,-1596429048,3),(4,-1593829848,5),(4,-1589860800,4),(4,-1542427200,5),(4,-1539493200,6),(4,-1525323600,5),(4,-1522728000,4),(4,-1491188400,7),(4,-1247536800,4),(4,354920409,5),(4,370728010,4),(4,386456410,5),(4,402264011,4),(4,417992411,5),(4,433800012,4),(4,449614812,5),(4,465346812,8),(4,481071612,9),(4,496796413,8),(4,512521213,9),(4,528246013,8),(4,543970813,9),(4,559695613,8),(4,575420414,9),(4,591145214,8),(4,606870014,9),(4,622594814,8),(4,638319615,9),(4,654649215,8),(4,670374016,10),(4,686102416,11),(4,695779216,8),(4,701812816,5),(4,717534017,4),(4,733273217,9),(4,748998018,8),(4,764722818,9),(4,780447619,8),(4,796172419,9),(4,811897219,8),(4,828226820,9),(4,846370820,8),(4,859676420,9),(4,877820421,8),(4,891126021,9),(4,909270021,8),(4,922575622,9),(4,941324422,8),(4,954025222,9),(4,972774022,8),(4,985474822,9),(4,1004223622,8),(4,1017529222,9),(4,1035673222,8),(4,1048978822,9),(4,1067122822,8),(4,1080428422,9),(4,1099177222,8),(4,1111878022,9),(4,1130626822,8),(4,1143327622,9),(4,1162076422,8),(4,1174777222,9),(4,1193526022,8),(4,1206831622,9),(4,1224975622,8),(4,1238281222,9),(4,1256425222,8),(4,1269730822,9),(4,1288479622,8),(4,1301180422,9),(4,1319929222,8),(4,1332630022,9),(4,1351378822,8),(4,1364684422,9),(4,1382828422,8),(4,1396134022,9),(4,1414278022,8),(4,1427583622,9),(4,1445727622,8),(4,1459033222,9),(4,1477782022,8),(4,1490482822,9),(4,1509231622,8),(4,1521932422,9),(4,1540681222,8),(4,1553986822,9),(4,1572130822,8),(4,1585436422,9),(4,1603580422,8),(4,1616886022,9),(4,1635634822,8),(4,1648335622,9),(4,1667084422,8),(4,1679785222,9),(4,1698534022,8),(4,1711839622,9),(4,1729983622,8),(4,1743289222,9),(4,1761433222,8),(4,1774738822,9),(4,1792882822,8),(4,1806188422,9),(4,1824937222,8),(4,1837638022,9),(4,1856386822,8),(4,1869087622,9),(4,1887836422,8),(4,1901142022,9),(4,1919286022,8),(4,1932591622,9),(4,1950735622,8),(4,1964041222,9),(4,1982790022,8),(4,1995490822,9),(4,2014239622,8),(4,2026940422,9),(4,2045689222,8),(4,2058390022,9),(4,2077138822,8),(4,2090444422,9),(4,2108588422,8),(4,2121894022,9),(4,2140038022,8),(5,-1009875600,1); +REPLACE INTO `time_zone_transition` VALUES +(1,-1693706400,0), +(1,-1680483600,1), +(1,-1663455600,2), +(1,-1650150000,3), +(1,-1632006000,2), +(1,-1618700400,3), +(1,-938905200,2), +(1,-857257200,3), +(1,-844556400,2), +(1,-828226800,3), +(1,-812502000,2), +(1,-796777200,3), +(1,228877200,2), +(1,243997200,3), +(1,260326800,2), +(1,276051600,3), +(1,291776400,2), +(1,307501200,3), +(1,323830800,2), +(1,338950800,3), +(1,354675600,2), +(1,370400400,3), +(1,386125200,2), +(1,401850000,3), +(1,417574800,2), +(1,433299600,3), +(1,449024400,2), +(1,465354000,3), +(1,481078800,2), +(1,496803600,3), +(1,512528400,2), +(1,528253200,3), +(1,543978000,2), +(1,559702800,3), +(1,575427600,2), +(1,591152400,3), +(1,606877200,2), +(1,622602000,3), +(1,638326800,2), +(1,654656400,3), +(1,670381200,2), +(1,686106000,3), +(1,701830800,2), +(1,717555600,3), +(1,733280400,2), +(1,749005200,3), +(1,764730000,2), +(1,780454800,3), +(1,796179600,2), +(1,811904400,3), +(1,828234000,2), +(1,846378000,3), +(1,859683600,2), +(1,877827600,3), +(1,891133200,2), +(1,909277200,3), +(1,922582800,2), +(1,941331600,3), +(1,954032400,2), +(1,972781200,3), +(1,985482000,2), +(1,1004230800,3), +(1,1017536400,2), +(1,1035680400,3), +(1,1048986000,2), +(1,1067130000,3), +(1,1080435600,2), +(1,1099184400,3), +(1,1111885200,2), +(1,1130634000,3), +(1,1143334800,2), +(1,1162083600,3), +(1,1174784400,2), +(1,1193533200,3), +(1,1206838800,2), +(1,1224982800,3), +(1,1238288400,2), +(1,1256432400,3), +(1,1269738000,2), +(1,1288486800,3), +(1,1301187600,2), +(1,1319936400,3), +(1,1332637200,2), +(1,1351386000,3), +(1,1364691600,2), +(1,1382835600,3), +(1,1396141200,2), +(1,1414285200,3), +(1,1427590800,2), +(1,1445734800,3), +(1,1459040400,2), +(1,1477789200,3), +(1,1490490000,2), +(1,1509238800,3), +(1,1521939600,2), +(1,1540688400,3), +(1,1553994000,2), +(1,1572138000,3), +(1,1585443600,2), +(1,1603587600,3), +(1,1616893200,2), +(1,1635642000,3), +(1,1648342800,2), +(1,1667091600,3), +(1,1679792400,2), +(1,1698541200,3), +(1,1711846800,2), +(1,1729990800,3), +(1,1743296400,2), +(1,1761440400,3), +(1,1774746000,2), +(1,1792890000,3), +(1,1806195600,2), +(1,1824944400,3), +(1,1837645200,2), +(1,1856394000,3), +(1,1869094800,2), +(1,1887843600,3), +(1,1901149200,2), +(1,1919293200,3), +(1,1932598800,2), +(1,1950742800,3), +(1,1964048400,2), +(1,1982797200,3), +(1,1995498000,2), +(1,2014246800,3), +(1,2026947600,2), +(1,2045696400,3), +(1,2058397200,2), +(1,2077146000,3), +(1,2090451600,2), +(1,2108595600,3), +(1,2121901200,2), +(1,2140045200,3), +(3,-1688265000,2), +(3,-1656819048,1), +(3,-1641353448,2), +(3,-1627965048,3), +(3,-1618716648,1), +(3,-1596429048,3), +(3,-1593829848,5), +(3,-1589860800,4), +(3,-1542427200,5), +(3,-1539493200,6), +(3,-1525323600,5), +(3,-1522728000,4), +(3,-1491188400,7), +(3,-1247536800,4), +(3,354920400,5), +(3,370728000,4), +(3,386456400,5), +(3,402264000,4), +(3,417992400,5), +(3,433800000,4), +(3,449614800,5), +(3,465346800,8), +(3,481071600,9), +(3,496796400,8), +(3,512521200,9), +(3,528246000,8), +(3,543970800,9), +(3,559695600,8), +(3,575420400,9), +(3,591145200,8), +(3,606870000,9), +(3,622594800,8), +(3,638319600,9), +(3,654649200,8), +(3,670374000,10), +(3,686102400,11), +(3,695779200,8), +(3,701812800,5), +(3,717534000,4), +(3,733273200,9), +(3,748998000,8), +(3,764722800,9), +(3,780447600,8), +(3,796172400,9), +(3,811897200,8), +(3,828226800,9), +(3,846370800,8), +(3,859676400,9), +(3,877820400,8), +(3,891126000,9), +(3,909270000,8), +(3,922575600,9), +(3,941324400,8), +(3,954025200,9), +(3,972774000,8), +(3,985474800,9), +(3,1004223600,8), +(3,1017529200,9), +(3,1035673200,8), +(3,1048978800,9), +(3,1067122800,8), +(3,1080428400,9), +(3,1099177200,8), +(3,1111878000,9), +(3,1130626800,8), +(3,1143327600,9), +(3,1162076400,8), +(3,1174777200,9), +(3,1193526000,8), +(3,1206831600,9), +(3,1224975600,8), +(3,1238281200,9), +(3,1256425200,8), +(3,1269730800,9), +(3,1288479600,8), +(3,1301180400,9), +(3,1319929200,8), +(3,1332630000,9), +(3,1351378800,8), +(3,1364684400,9), +(3,1382828400,8), +(3,1396134000,9), +(3,1414278000,8), +(3,1427583600,9), +(3,1445727600,8), +(3,1459033200,9), +(3,1477782000,8), +(3,1490482800,9), +(3,1509231600,8), +(3,1521932400,9), +(3,1540681200,8), +(3,1553986800,9), +(3,1572130800,8), +(3,1585436400,9), +(3,1603580400,8), +(3,1616886000,9), +(3,1635634800,8), +(3,1648335600,9), +(3,1667084400,8), +(3,1679785200,9), +(3,1698534000,8), +(3,1711839600,9), +(3,1729983600,8), +(3,1743289200,9), +(3,1761433200,8), +(3,1774738800,9), +(3,1792882800,8), +(3,1806188400,9), +(3,1824937200,8), +(3,1837638000,9), +(3,1856386800,8), +(3,1869087600,9), +(3,1887836400,8), +(3,1901142000,9), +(3,1919286000,8), +(3,1932591600,9), +(3,1950735600,8), +(3,1964041200,9), +(3,1982790000,8), +(3,1995490800,9), +(3,2014239600,8), +(3,2026940400,9), +(3,2045689200,8), +(3,2058390000,9), +(3,2077138800,8), +(3,2090444400,9), +(3,2108588400,8), +(3,2121894000,9), +(3,2140038000,8), +(4,-1688265000,2), +(4,-1656819048,1), +(4,-1641353448,2), +(4,-1627965048,3), +(4,-1618716648,1), +(4,-1596429048,3), +(4,-1593829848,5), +(4,-1589860800,4), +(4,-1542427200,5), +(4,-1539493200,6), +(4,-1525323600,5), +(4,-1522728000,4), +(4,-1491188400,7), +(4,-1247536800,4), +(4,354920409,5), +(4,370728010,4), +(4,386456410,5), +(4,402264011,4), +(4,417992411,5), +(4,433800012,4), +(4,449614812,5), +(4,465346812,8), +(4,481071612,9), +(4,496796413,8), +(4,512521213,9), +(4,528246013,8), +(4,543970813,9), +(4,559695613,8), +(4,575420414,9), +(4,591145214,8), +(4,606870014,9), +(4,622594814,8), +(4,638319615,9), +(4,654649215,8), +(4,670374016,10), +(4,686102416,11), +(4,695779216,8), +(4,701812816,5), +(4,717534017,4), +(4,733273217,9), +(4,748998018,8), +(4,764722818,9), +(4,780447619,8), +(4,796172419,9), +(4,811897219,8), +(4,828226820,9), +(4,846370820,8), +(4,859676420,9), +(4,877820421,8), +(4,891126021,9), +(4,909270021,8), +(4,922575622,9), +(4,941324422,8), +(4,954025222,9), +(4,972774022,8), +(4,985474822,9), +(4,1004223622,8), +(4,1017529222,9), +(4,1035673222,8), +(4,1048978822,9), +(4,1067122822,8), +(4,1080428422,9), +(4,1099177222,8), +(4,1111878022,9), +(4,1130626822,8), +(4,1143327622,9), +(4,1162076422,8), +(4,1174777222,9), +(4,1193526022,8), +(4,1206831622,9), +(4,1224975622,8), +(4,1238281222,9), +(4,1256425222,8), +(4,1269730822,9), +(4,1288479622,8), +(4,1301180422,9), +(4,1319929222,8), +(4,1332630022,9), +(4,1351378822,8), +(4,1364684422,9), +(4,1382828422,8), +(4,1396134022,9), +(4,1414278022,8), +(4,1427583622,9), +(4,1445727622,8), +(4,1459033222,9), +(4,1477782022,8), +(4,1490482822,9), +(4,1509231622,8), +(4,1521932422,9), +(4,1540681222,8), +(4,1553986822,9), +(4,1572130822,8), +(4,1585436422,9), +(4,1603580422,8), +(4,1616886022,9), +(4,1635634822,8), +(4,1648335622,9), +(4,1667084422,8), +(4,1679785222,9), +(4,1698534022,8), +(4,1711839622,9), +(4,1729983622,8), +(4,1743289222,9), +(4,1761433222,8), +(4,1774738822,9), +(4,1792882822,8), +(4,1806188422,9), +(4,1824937222,8), +(4,1837638022,9), +(4,1856386822,8), +(4,1869087622,9), +(4,1887836422,8), +(4,1901142022,9), +(4,1919286022,8), +(4,1932591622,9), +(4,1950735622,8), +(4,1964041222,9), +(4,1982790022,8), +(4,1995490822,9), +(4,2014239622,8), +(4,2026940422,9), +(4,2045689222,8), +(4,2058390022,9), +(4,2077138822,8), +(4,2090444422,9), +(4,2108588422,8), +(4,2121894022,9), +(4,2140038022,8), +(5,-1009875600,1); /*!40000 ALTER TABLE `time_zone_transition` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `time_zone_transition_type` WRITE; /*!40000 ALTER TABLE `time_zone_transition_type` DISABLE KEYS */; -REPLACE INTO `time_zone_transition_type` VALUES (1,0,7200,1,'MEST'),(1,1,3600,0,'MET'),(1,2,7200,1,'MEST'),(1,3,3600,0,'MET'),(2,0,0,0,'UTC'),(3,0,9000,0,'MMT'),(3,1,12648,1,'MST'),(3,2,9048,0,'MMT'),(3,3,16248,1,'MDST'),(3,4,10800,0,'MSK'),(3,5,14400,1,'MSD'),(3,6,18000,1,'MSD'),(3,7,7200,0,'EET'),(3,8,10800,0,'MSK'),(3,9,14400,1,'MSD'),(3,10,10800,1,'EEST'),(3,11,7200,0,'EET'),(4,0,9000,0,'MMT'),(4,1,12648,1,'MST'),(4,2,9048,0,'MMT'),(4,3,16248,1,'MDST'),(4,4,10800,0,'MSK'),(4,5,14400,1,'MSD'),(4,6,18000,1,'MSD'),(4,7,7200,0,'EET'),(4,8,10800,0,'MSK'),(4,9,14400,1,'MSD'),(4,10,10800,1,'EEST'),(4,11,7200,0,'EET'),(5,0,32400,0,'CJT'),(5,1,32400,0,'JST'); +REPLACE INTO `time_zone_transition_type` VALUES +(1,0,7200,1,'MEST'), +(1,1,3600,0,'MET'), +(1,2,7200,1,'MEST'), +(1,3,3600,0,'MET'), +(2,0,0,0,'UTC'), +(3,0,9000,0,'MMT'), +(3,1,12648,1,'MST'), +(3,2,9048,0,'MMT'), +(3,3,16248,1,'MDST'), +(3,4,10800,0,'MSK'), +(3,5,14400,1,'MSD'), +(3,6,18000,1,'MSD'), +(3,7,7200,0,'EET'), +(3,8,10800,0,'MSK'), +(3,9,14400,1,'MSD'), +(3,10,10800,1,'EEST'), +(3,11,7200,0,'EET'), +(4,0,9000,0,'MMT'), +(4,1,12648,1,'MST'), +(4,2,9048,0,'MMT'), +(4,3,16248,1,'MDST'), +(4,4,10800,0,'MSK'), +(4,5,14400,1,'MSD'), +(4,6,18000,1,'MSD'), +(4,7,7200,0,'EET'), +(4,8,10800,0,'MSK'), +(4,9,14400,1,'MSD'), +(4,10,10800,1,'EEST'), +(4,11,7200,0,'EET'), +(5,0,32400,0,'CJT'), +(5,1,32400,0,'JST'); /*!40000 ALTER TABLE `time_zone_transition_type` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -173,6 +641,10 @@ UNLOCK TABLES; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*M!100401 UNINSTALL PLUGIN IF EXIST test_plugin_server */; +INSTALL PLUGIN test_plugin_server SONAME 'AUTH_TEST_PLUGIN_LIB'; +/*M!100401 UNINSTALL PLUGIN IF EXIST cleartext_plugin_server */; +INSTALL PLUGIN cleartext_plugin_server SONAME 'AUTH_TEST_PLUGIN_LIB'; DELIMITER | /*M!100101 IF current_user()="'mariadb.sys'@'localhost'" THEN SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001, MESSAGE_TEXT="Don't remove current user 'mariadb.sys'@'localhost''"; @@ -188,12 +660,12 @@ DELIMITER ; /*!50701 DROP USER IF EXISTS 'root'@'localhost' */; CREATE /*M!100103 OR REPLACE */ USER `root`@`localhost`; DELIMITER | -/*M!100101 IF current_user()="'USER'@'%'" THEN - SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001, MESSAGE_TEXT="Don't remove current user 'USER'@'%''"; +/*M!100101 IF current_user()="'foobar'@'%'" THEN + SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001, MESSAGE_TEXT="Don't remove current user 'foobar'@'%''"; END IF */| DELIMITER ; -/*!50701 DROP USER IF EXISTS 'USER'@'%' */; -CREATE /*M!100103 OR REPLACE */ USER `USER`@`%`; +/*!50701 DROP USER IF EXISTS 'foobar'@'%' */; +CREATE /*M!100103 OR REPLACE */ USER `foobar`@`%` IDENTIFIED VIA test_plugin_server USING 'plug_dest'; SELECT COALESCE(CURRENT_ROLE(),'NONE') into @current_role; CREATE ROLE IF NOT EXISTS mariadb_dump_import_role; GRANT mariadb_dump_import_role TO CURRENT_USER(); @@ -215,11 +687,11 @@ GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION; GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION; /*M!100005 SET DEFAULT ROLE NONE FOR 'root'@'localhost' */; /*!80001 ALTER USER 'root'@'localhost' DEFAULT ROLE NONE */; -GRANT `role_1` TO `USER`@`%`; -GRANT `role_2` TO `USER`@`%`; -GRANT USAGE ON *.* TO `USER`@`%`; -/*M!100005 SET DEFAULT ROLE 'role_2' FOR 'USER'@'%' */; -/*!80001 ALTER USER 'USER'@'%' DEFAULT ROLE 'role_2' */; +GRANT `role_1` TO `foobar`@`%`; +GRANT `role_2` TO `foobar`@`%`; +GRANT USAGE ON *.* TO `foobar`@`%` IDENTIFIED VIA test_plugin_server USING 'plug_dest'; +/*M!100005 SET DEFAULT ROLE 'role_2' FOR 'foobar'@'%' */; +/*!80001 ALTER USER 'foobar'@'%' DEFAULT ROLE 'role_2' */; GRANT `role_2` TO `role_1` WITH ADMIN OPTION; GRANT SHOW DATABASES ON *.* TO `role_1`; GRANT USAGE ON *.* TO `role_2`; @@ -235,31 +707,39 @@ USE mysql; LOCK TABLES `column_stats` WRITE; /*!40000 ALTER TABLE `column_stats` DISABLE KEYS */; -REPLACE INTO `column_stats` VALUES ('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,254,'DOUBLE_PREC_HB','\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿'); +REPLACE INTO `column_stats` VALUES +('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,254,'DOUBLE_PREC_HB','\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿'); /*!40000 ALTER TABLE `column_stats` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `index_stats` WRITE; /*!40000 ALTER TABLE `index_stats` DISABLE KEYS */; -REPLACE INTO `index_stats` VALUES ('mysql','tz','PRIMARY',1,98.2500); +REPLACE INTO `index_stats` VALUES +('mysql','tz','PRIMARY',1,98.2500); /*!40000 ALTER TABLE `index_stats` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `table_stats` WRITE; /*!40000 ALTER TABLE `table_stats` DISABLE KEYS */; -REPLACE INTO `table_stats` VALUES ('mysql','tz',393); +REPLACE INTO `table_stats` VALUES +('mysql','tz',393); /*!40000 ALTER TABLE `table_stats` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `innodb_index_stats` WRITE; /*!40000 ALTER TABLE `innodb_index_stats` DISABLE KEYS */; -REPLACE INTO `innodb_index_stats` VALUES ('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index'); +REPLACE INTO `innodb_index_stats` VALUES +('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'), +('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'), +('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'), +('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index'); /*!40000 ALTER TABLE `innodb_index_stats` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `innodb_table_stats` WRITE; /*!40000 ALTER TABLE `innodb_table_stats` DISABLE KEYS */; -REPLACE INTO `innodb_table_stats` VALUES ('mysql','tz','2019-12-31 21:00:00',393,1,0); +REPLACE INTO `innodb_table_stats` VALUES +('mysql','tz','2019-12-31 21:00:00',393,1,0); /*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */; UNLOCK TABLES; @@ -267,31 +747,488 @@ USE mysql; LOCK TABLES `time_zone` WRITE; /*!40000 ALTER TABLE `time_zone` DISABLE KEYS */; -REPLACE INTO `time_zone` VALUES (1,'N'),(2,'N'),(3,'N'),(4,'Y'),(5,'N'); +REPLACE INTO `time_zone` VALUES +(1,'N'), +(2,'N'), +(3,'N'), +(4,'Y'), +(5,'N'); /*!40000 ALTER TABLE `time_zone` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `time_zone_name` WRITE; /*!40000 ALTER TABLE `time_zone_name` DISABLE KEYS */; -REPLACE INTO `time_zone_name` VALUES ('Europe/Moscow',3),('Japan',5),('leap/Europe/Moscow',4),('MET',1),('Universal',2),('UTC',2); +REPLACE INTO `time_zone_name` VALUES +('Europe/Moscow',3), +('Japan',5), +('leap/Europe/Moscow',4), +('MET',1), +('Universal',2), +('UTC',2); /*!40000 ALTER TABLE `time_zone_name` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `time_zone_leap_second` WRITE; /*!40000 ALTER TABLE `time_zone_leap_second` DISABLE KEYS */; -REPLACE INTO `time_zone_leap_second` VALUES (78796800,1),(94694401,2),(126230402,3),(157766403,4),(189302404,5),(220924805,6),(252460806,7),(283996807,8),(315532808,9),(362793609,10),(394329610,11),(425865611,12),(489024012,13),(567993613,14),(631152014,15),(662688015,16),(709948816,17),(741484817,18),(773020818,19),(820454419,20),(867715220,21),(915148821,22); +REPLACE INTO `time_zone_leap_second` VALUES +(78796800,1), +(94694401,2), +(126230402,3), +(157766403,4), +(189302404,5), +(220924805,6), +(252460806,7), +(283996807,8), +(315532808,9), +(362793609,10), +(394329610,11), +(425865611,12), +(489024012,13), +(567993613,14), +(631152014,15), +(662688015,16), +(709948816,17), +(741484817,18), +(773020818,19), +(820454419,20), +(867715220,21), +(915148821,22); /*!40000 ALTER TABLE `time_zone_leap_second` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `time_zone_transition` WRITE; /*!40000 ALTER TABLE `time_zone_transition` DISABLE KEYS */; -REPLACE INTO `time_zone_transition` VALUES (1,-1693706400,0),(1,-1680483600,1),(1,-1663455600,2),(1,-1650150000,3),(1,-1632006000,2),(1,-1618700400,3),(1,-938905200,2),(1,-857257200,3),(1,-844556400,2),(1,-828226800,3),(1,-812502000,2),(1,-796777200,3),(1,228877200,2),(1,243997200,3),(1,260326800,2),(1,276051600,3),(1,291776400,2),(1,307501200,3),(1,323830800,2),(1,338950800,3),(1,354675600,2),(1,370400400,3),(1,386125200,2),(1,401850000,3),(1,417574800,2),(1,433299600,3),(1,449024400,2),(1,465354000,3),(1,481078800,2),(1,496803600,3),(1,512528400,2),(1,528253200,3),(1,543978000,2),(1,559702800,3),(1,575427600,2),(1,591152400,3),(1,606877200,2),(1,622602000,3),(1,638326800,2),(1,654656400,3),(1,670381200,2),(1,686106000,3),(1,701830800,2),(1,717555600,3),(1,733280400,2),(1,749005200,3),(1,764730000,2),(1,780454800,3),(1,796179600,2),(1,811904400,3),(1,828234000,2),(1,846378000,3),(1,859683600,2),(1,877827600,3),(1,891133200,2),(1,909277200,3),(1,922582800,2),(1,941331600,3),(1,954032400,2),(1,972781200,3),(1,985482000,2),(1,1004230800,3),(1,1017536400,2),(1,1035680400,3),(1,1048986000,2),(1,1067130000,3),(1,1080435600,2),(1,1099184400,3),(1,1111885200,2),(1,1130634000,3),(1,1143334800,2),(1,1162083600,3),(1,1174784400,2),(1,1193533200,3),(1,1206838800,2),(1,1224982800,3),(1,1238288400,2),(1,1256432400,3),(1,1269738000,2),(1,1288486800,3),(1,1301187600,2),(1,1319936400,3),(1,1332637200,2),(1,1351386000,3),(1,1364691600,2),(1,1382835600,3),(1,1396141200,2),(1,1414285200,3),(1,1427590800,2),(1,1445734800,3),(1,1459040400,2),(1,1477789200,3),(1,1490490000,2),(1,1509238800,3),(1,1521939600,2),(1,1540688400,3),(1,1553994000,2),(1,1572138000,3),(1,1585443600,2),(1,1603587600,3),(1,1616893200,2),(1,1635642000,3),(1,1648342800,2),(1,1667091600,3),(1,1679792400,2),(1,1698541200,3),(1,1711846800,2),(1,1729990800,3),(1,1743296400,2),(1,1761440400,3),(1,1774746000,2),(1,1792890000,3),(1,1806195600,2),(1,1824944400,3),(1,1837645200,2),(1,1856394000,3),(1,1869094800,2),(1,1887843600,3),(1,1901149200,2),(1,1919293200,3),(1,1932598800,2),(1,1950742800,3),(1,1964048400,2),(1,1982797200,3),(1,1995498000,2),(1,2014246800,3),(1,2026947600,2),(1,2045696400,3),(1,2058397200,2),(1,2077146000,3),(1,2090451600,2),(1,2108595600,3),(1,2121901200,2),(1,2140045200,3),(3,-1688265000,2),(3,-1656819048,1),(3,-1641353448,2),(3,-1627965048,3),(3,-1618716648,1),(3,-1596429048,3),(3,-1593829848,5),(3,-1589860800,4),(3,-1542427200,5),(3,-1539493200,6),(3,-1525323600,5),(3,-1522728000,4),(3,-1491188400,7),(3,-1247536800,4),(3,354920400,5),(3,370728000,4),(3,386456400,5),(3,402264000,4),(3,417992400,5),(3,433800000,4),(3,449614800,5),(3,465346800,8),(3,481071600,9),(3,496796400,8),(3,512521200,9),(3,528246000,8),(3,543970800,9),(3,559695600,8),(3,575420400,9),(3,591145200,8),(3,606870000,9),(3,622594800,8),(3,638319600,9),(3,654649200,8),(3,670374000,10),(3,686102400,11),(3,695779200,8),(3,701812800,5),(3,717534000,4),(3,733273200,9),(3,748998000,8),(3,764722800,9),(3,780447600,8),(3,796172400,9),(3,811897200,8),(3,828226800,9),(3,846370800,8),(3,859676400,9),(3,877820400,8),(3,891126000,9),(3,909270000,8),(3,922575600,9),(3,941324400,8),(3,954025200,9),(3,972774000,8),(3,985474800,9),(3,1004223600,8),(3,1017529200,9),(3,1035673200,8),(3,1048978800,9),(3,1067122800,8),(3,1080428400,9),(3,1099177200,8),(3,1111878000,9),(3,1130626800,8),(3,1143327600,9),(3,1162076400,8),(3,1174777200,9),(3,1193526000,8),(3,1206831600,9),(3,1224975600,8),(3,1238281200,9),(3,1256425200,8),(3,1269730800,9),(3,1288479600,8),(3,1301180400,9),(3,1319929200,8),(3,1332630000,9),(3,1351378800,8),(3,1364684400,9),(3,1382828400,8),(3,1396134000,9),(3,1414278000,8),(3,1427583600,9),(3,1445727600,8),(3,1459033200,9),(3,1477782000,8),(3,1490482800,9),(3,1509231600,8),(3,1521932400,9),(3,1540681200,8),(3,1553986800,9),(3,1572130800,8),(3,1585436400,9),(3,1603580400,8),(3,1616886000,9),(3,1635634800,8),(3,1648335600,9),(3,1667084400,8),(3,1679785200,9),(3,1698534000,8),(3,1711839600,9),(3,1729983600,8),(3,1743289200,9),(3,1761433200,8),(3,1774738800,9),(3,1792882800,8),(3,1806188400,9),(3,1824937200,8),(3,1837638000,9),(3,1856386800,8),(3,1869087600,9),(3,1887836400,8),(3,1901142000,9),(3,1919286000,8),(3,1932591600,9),(3,1950735600,8),(3,1964041200,9),(3,1982790000,8),(3,1995490800,9),(3,2014239600,8),(3,2026940400,9),(3,2045689200,8),(3,2058390000,9),(3,2077138800,8),(3,2090444400,9),(3,2108588400,8),(3,2121894000,9),(3,2140038000,8),(4,-1688265000,2),(4,-1656819048,1),(4,-1641353448,2),(4,-1627965048,3),(4,-1618716648,1),(4,-1596429048,3),(4,-1593829848,5),(4,-1589860800,4),(4,-1542427200,5),(4,-1539493200,6),(4,-1525323600,5),(4,-1522728000,4),(4,-1491188400,7),(4,-1247536800,4),(4,354920409,5),(4,370728010,4),(4,386456410,5),(4,402264011,4),(4,417992411,5),(4,433800012,4),(4,449614812,5),(4,465346812,8),(4,481071612,9),(4,496796413,8),(4,512521213,9),(4,528246013,8),(4,543970813,9),(4,559695613,8),(4,575420414,9),(4,591145214,8),(4,606870014,9),(4,622594814,8),(4,638319615,9),(4,654649215,8),(4,670374016,10),(4,686102416,11),(4,695779216,8),(4,701812816,5),(4,717534017,4),(4,733273217,9),(4,748998018,8),(4,764722818,9),(4,780447619,8),(4,796172419,9),(4,811897219,8),(4,828226820,9),(4,846370820,8),(4,859676420,9),(4,877820421,8),(4,891126021,9),(4,909270021,8),(4,922575622,9),(4,941324422,8),(4,954025222,9),(4,972774022,8),(4,985474822,9),(4,1004223622,8),(4,1017529222,9),(4,1035673222,8),(4,1048978822,9),(4,1067122822,8),(4,1080428422,9),(4,1099177222,8),(4,1111878022,9),(4,1130626822,8),(4,1143327622,9),(4,1162076422,8),(4,1174777222,9),(4,1193526022,8),(4,1206831622,9),(4,1224975622,8),(4,1238281222,9),(4,1256425222,8),(4,1269730822,9),(4,1288479622,8),(4,1301180422,9),(4,1319929222,8),(4,1332630022,9),(4,1351378822,8),(4,1364684422,9),(4,1382828422,8),(4,1396134022,9),(4,1414278022,8),(4,1427583622,9),(4,1445727622,8),(4,1459033222,9),(4,1477782022,8),(4,1490482822,9),(4,1509231622,8),(4,1521932422,9),(4,1540681222,8),(4,1553986822,9),(4,1572130822,8),(4,1585436422,9),(4,1603580422,8),(4,1616886022,9),(4,1635634822,8),(4,1648335622,9),(4,1667084422,8),(4,1679785222,9),(4,1698534022,8),(4,1711839622,9),(4,1729983622,8),(4,1743289222,9),(4,1761433222,8),(4,1774738822,9),(4,1792882822,8),(4,1806188422,9),(4,1824937222,8),(4,1837638022,9),(4,1856386822,8),(4,1869087622,9),(4,1887836422,8),(4,1901142022,9),(4,1919286022,8),(4,1932591622,9),(4,1950735622,8),(4,1964041222,9),(4,1982790022,8),(4,1995490822,9),(4,2014239622,8),(4,2026940422,9),(4,2045689222,8),(4,2058390022,9),(4,2077138822,8),(4,2090444422,9),(4,2108588422,8),(4,2121894022,9),(4,2140038022,8),(5,-1009875600,1); +REPLACE INTO `time_zone_transition` VALUES +(1,-1693706400,0), +(1,-1680483600,1), +(1,-1663455600,2), +(1,-1650150000,3), +(1,-1632006000,2), +(1,-1618700400,3), +(1,-938905200,2), +(1,-857257200,3), +(1,-844556400,2), +(1,-828226800,3), +(1,-812502000,2), +(1,-796777200,3), +(1,228877200,2), +(1,243997200,3), +(1,260326800,2), +(1,276051600,3), +(1,291776400,2), +(1,307501200,3), +(1,323830800,2), +(1,338950800,3), +(1,354675600,2), +(1,370400400,3), +(1,386125200,2), +(1,401850000,3), +(1,417574800,2), +(1,433299600,3), +(1,449024400,2), +(1,465354000,3), +(1,481078800,2), +(1,496803600,3), +(1,512528400,2), +(1,528253200,3), +(1,543978000,2), +(1,559702800,3), +(1,575427600,2), +(1,591152400,3), +(1,606877200,2), +(1,622602000,3), +(1,638326800,2), +(1,654656400,3), +(1,670381200,2), +(1,686106000,3), +(1,701830800,2), +(1,717555600,3), +(1,733280400,2), +(1,749005200,3), +(1,764730000,2), +(1,780454800,3), +(1,796179600,2), +(1,811904400,3), +(1,828234000,2), +(1,846378000,3), +(1,859683600,2), +(1,877827600,3), +(1,891133200,2), +(1,909277200,3), +(1,922582800,2), +(1,941331600,3), +(1,954032400,2), +(1,972781200,3), +(1,985482000,2), +(1,1004230800,3), +(1,1017536400,2), +(1,1035680400,3), +(1,1048986000,2), +(1,1067130000,3), +(1,1080435600,2), +(1,1099184400,3), +(1,1111885200,2), +(1,1130634000,3), +(1,1143334800,2), +(1,1162083600,3), +(1,1174784400,2), +(1,1193533200,3), +(1,1206838800,2), +(1,1224982800,3), +(1,1238288400,2), +(1,1256432400,3), +(1,1269738000,2), +(1,1288486800,3), +(1,1301187600,2), +(1,1319936400,3), +(1,1332637200,2), +(1,1351386000,3), +(1,1364691600,2), +(1,1382835600,3), +(1,1396141200,2), +(1,1414285200,3), +(1,1427590800,2), +(1,1445734800,3), +(1,1459040400,2), +(1,1477789200,3), +(1,1490490000,2), +(1,1509238800,3), +(1,1521939600,2), +(1,1540688400,3), +(1,1553994000,2), +(1,1572138000,3), +(1,1585443600,2), +(1,1603587600,3), +(1,1616893200,2), +(1,1635642000,3), +(1,1648342800,2), +(1,1667091600,3), +(1,1679792400,2), +(1,1698541200,3), +(1,1711846800,2), +(1,1729990800,3), +(1,1743296400,2), +(1,1761440400,3), +(1,1774746000,2), +(1,1792890000,3), +(1,1806195600,2), +(1,1824944400,3), +(1,1837645200,2), +(1,1856394000,3), +(1,1869094800,2), +(1,1887843600,3), +(1,1901149200,2), +(1,1919293200,3), +(1,1932598800,2), +(1,1950742800,3), +(1,1964048400,2), +(1,1982797200,3), +(1,1995498000,2), +(1,2014246800,3), +(1,2026947600,2), +(1,2045696400,3), +(1,2058397200,2), +(1,2077146000,3), +(1,2090451600,2), +(1,2108595600,3), +(1,2121901200,2), +(1,2140045200,3), +(3,-1688265000,2), +(3,-1656819048,1), +(3,-1641353448,2), +(3,-1627965048,3), +(3,-1618716648,1), +(3,-1596429048,3), +(3,-1593829848,5), +(3,-1589860800,4), +(3,-1542427200,5), +(3,-1539493200,6), +(3,-1525323600,5), +(3,-1522728000,4), +(3,-1491188400,7), +(3,-1247536800,4), +(3,354920400,5), +(3,370728000,4), +(3,386456400,5), +(3,402264000,4), +(3,417992400,5), +(3,433800000,4), +(3,449614800,5), +(3,465346800,8), +(3,481071600,9), +(3,496796400,8), +(3,512521200,9), +(3,528246000,8), +(3,543970800,9), +(3,559695600,8), +(3,575420400,9), +(3,591145200,8), +(3,606870000,9), +(3,622594800,8), +(3,638319600,9), +(3,654649200,8), +(3,670374000,10), +(3,686102400,11), +(3,695779200,8), +(3,701812800,5), +(3,717534000,4), +(3,733273200,9), +(3,748998000,8), +(3,764722800,9), +(3,780447600,8), +(3,796172400,9), +(3,811897200,8), +(3,828226800,9), +(3,846370800,8), +(3,859676400,9), +(3,877820400,8), +(3,891126000,9), +(3,909270000,8), +(3,922575600,9), +(3,941324400,8), +(3,954025200,9), +(3,972774000,8), +(3,985474800,9), +(3,1004223600,8), +(3,1017529200,9), +(3,1035673200,8), +(3,1048978800,9), +(3,1067122800,8), +(3,1080428400,9), +(3,1099177200,8), +(3,1111878000,9), +(3,1130626800,8), +(3,1143327600,9), +(3,1162076400,8), +(3,1174777200,9), +(3,1193526000,8), +(3,1206831600,9), +(3,1224975600,8), +(3,1238281200,9), +(3,1256425200,8), +(3,1269730800,9), +(3,1288479600,8), +(3,1301180400,9), +(3,1319929200,8), +(3,1332630000,9), +(3,1351378800,8), +(3,1364684400,9), +(3,1382828400,8), +(3,1396134000,9), +(3,1414278000,8), +(3,1427583600,9), +(3,1445727600,8), +(3,1459033200,9), +(3,1477782000,8), +(3,1490482800,9), +(3,1509231600,8), +(3,1521932400,9), +(3,1540681200,8), +(3,1553986800,9), +(3,1572130800,8), +(3,1585436400,9), +(3,1603580400,8), +(3,1616886000,9), +(3,1635634800,8), +(3,1648335600,9), +(3,1667084400,8), +(3,1679785200,9), +(3,1698534000,8), +(3,1711839600,9), +(3,1729983600,8), +(3,1743289200,9), +(3,1761433200,8), +(3,1774738800,9), +(3,1792882800,8), +(3,1806188400,9), +(3,1824937200,8), +(3,1837638000,9), +(3,1856386800,8), +(3,1869087600,9), +(3,1887836400,8), +(3,1901142000,9), +(3,1919286000,8), +(3,1932591600,9), +(3,1950735600,8), +(3,1964041200,9), +(3,1982790000,8), +(3,1995490800,9), +(3,2014239600,8), +(3,2026940400,9), +(3,2045689200,8), +(3,2058390000,9), +(3,2077138800,8), +(3,2090444400,9), +(3,2108588400,8), +(3,2121894000,9), +(3,2140038000,8), +(4,-1688265000,2), +(4,-1656819048,1), +(4,-1641353448,2), +(4,-1627965048,3), +(4,-1618716648,1), +(4,-1596429048,3), +(4,-1593829848,5), +(4,-1589860800,4), +(4,-1542427200,5), +(4,-1539493200,6), +(4,-1525323600,5), +(4,-1522728000,4), +(4,-1491188400,7), +(4,-1247536800,4), +(4,354920409,5), +(4,370728010,4), +(4,386456410,5), +(4,402264011,4), +(4,417992411,5), +(4,433800012,4), +(4,449614812,5), +(4,465346812,8), +(4,481071612,9), +(4,496796413,8), +(4,512521213,9), +(4,528246013,8), +(4,543970813,9), +(4,559695613,8), +(4,575420414,9), +(4,591145214,8), +(4,606870014,9), +(4,622594814,8), +(4,638319615,9), +(4,654649215,8), +(4,670374016,10), +(4,686102416,11), +(4,695779216,8), +(4,701812816,5), +(4,717534017,4), +(4,733273217,9), +(4,748998018,8), +(4,764722818,9), +(4,780447619,8), +(4,796172419,9), +(4,811897219,8), +(4,828226820,9), +(4,846370820,8), +(4,859676420,9), +(4,877820421,8), +(4,891126021,9), +(4,909270021,8), +(4,922575622,9), +(4,941324422,8), +(4,954025222,9), +(4,972774022,8), +(4,985474822,9), +(4,1004223622,8), +(4,1017529222,9), +(4,1035673222,8), +(4,1048978822,9), +(4,1067122822,8), +(4,1080428422,9), +(4,1099177222,8), +(4,1111878022,9), +(4,1130626822,8), +(4,1143327622,9), +(4,1162076422,8), +(4,1174777222,9), +(4,1193526022,8), +(4,1206831622,9), +(4,1224975622,8), +(4,1238281222,9), +(4,1256425222,8), +(4,1269730822,9), +(4,1288479622,8), +(4,1301180422,9), +(4,1319929222,8), +(4,1332630022,9), +(4,1351378822,8), +(4,1364684422,9), +(4,1382828422,8), +(4,1396134022,9), +(4,1414278022,8), +(4,1427583622,9), +(4,1445727622,8), +(4,1459033222,9), +(4,1477782022,8), +(4,1490482822,9), +(4,1509231622,8), +(4,1521932422,9), +(4,1540681222,8), +(4,1553986822,9), +(4,1572130822,8), +(4,1585436422,9), +(4,1603580422,8), +(4,1616886022,9), +(4,1635634822,8), +(4,1648335622,9), +(4,1667084422,8), +(4,1679785222,9), +(4,1698534022,8), +(4,1711839622,9), +(4,1729983622,8), +(4,1743289222,9), +(4,1761433222,8), +(4,1774738822,9), +(4,1792882822,8), +(4,1806188422,9), +(4,1824937222,8), +(4,1837638022,9), +(4,1856386822,8), +(4,1869087622,9), +(4,1887836422,8), +(4,1901142022,9), +(4,1919286022,8), +(4,1932591622,9), +(4,1950735622,8), +(4,1964041222,9), +(4,1982790022,8), +(4,1995490822,9), +(4,2014239622,8), +(4,2026940422,9), +(4,2045689222,8), +(4,2058390022,9), +(4,2077138822,8), +(4,2090444422,9), +(4,2108588422,8), +(4,2121894022,9), +(4,2140038022,8), +(5,-1009875600,1); /*!40000 ALTER TABLE `time_zone_transition` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `time_zone_transition_type` WRITE; /*!40000 ALTER TABLE `time_zone_transition_type` DISABLE KEYS */; -REPLACE INTO `time_zone_transition_type` VALUES (1,0,7200,1,'MEST'),(1,1,3600,0,'MET'),(1,2,7200,1,'MEST'),(1,3,3600,0,'MET'),(2,0,0,0,'UTC'),(3,0,9000,0,'MMT'),(3,1,12648,1,'MST'),(3,2,9048,0,'MMT'),(3,3,16248,1,'MDST'),(3,4,10800,0,'MSK'),(3,5,14400,1,'MSD'),(3,6,18000,1,'MSD'),(3,7,7200,0,'EET'),(3,8,10800,0,'MSK'),(3,9,14400,1,'MSD'),(3,10,10800,1,'EEST'),(3,11,7200,0,'EET'),(4,0,9000,0,'MMT'),(4,1,12648,1,'MST'),(4,2,9048,0,'MMT'),(4,3,16248,1,'MDST'),(4,4,10800,0,'MSK'),(4,5,14400,1,'MSD'),(4,6,18000,1,'MSD'),(4,7,7200,0,'EET'),(4,8,10800,0,'MSK'),(4,9,14400,1,'MSD'),(4,10,10800,1,'EEST'),(4,11,7200,0,'EET'),(5,0,32400,0,'CJT'),(5,1,32400,0,'JST'); +REPLACE INTO `time_zone_transition_type` VALUES +(1,0,7200,1,'MEST'), +(1,1,3600,0,'MET'), +(1,2,7200,1,'MEST'), +(1,3,3600,0,'MET'), +(2,0,0,0,'UTC'), +(3,0,9000,0,'MMT'), +(3,1,12648,1,'MST'), +(3,2,9048,0,'MMT'), +(3,3,16248,1,'MDST'), +(3,4,10800,0,'MSK'), +(3,5,14400,1,'MSD'), +(3,6,18000,1,'MSD'), +(3,7,7200,0,'EET'), +(3,8,10800,0,'MSK'), +(3,9,14400,1,'MSD'), +(3,10,10800,1,'EEST'), +(3,11,7200,0,'EET'), +(4,0,9000,0,'MMT'), +(4,1,12648,1,'MST'), +(4,2,9048,0,'MMT'), +(4,3,16248,1,'MDST'), +(4,4,10800,0,'MSK'), +(4,5,14400,1,'MSD'), +(4,6,18000,1,'MSD'), +(4,7,7200,0,'EET'), +(4,8,10800,0,'MSK'), +(4,9,14400,1,'MSD'), +(4,10,10800,1,'EEST'), +(4,11,7200,0,'EET'), +(5,0,32400,0,'CJT'), +(5,1,32400,0,'JST'); /*!40000 ALTER TABLE `time_zone_transition_type` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -318,9 +1255,11 @@ UNLOCK TABLES; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +INSTALL PLUGIN test_plugin_server /*M!100401 IF NOT EXISTS */ SONAME 'AUTH_TEST_PLUGIN_LIB'; +INSTALL PLUGIN cleartext_plugin_server /*M!100401 IF NOT EXISTS */ SONAME 'AUTH_TEST_PLUGIN_LIB'; CREATE USER IF NOT EXISTS `mariadb.sys`@`localhost` PASSWORD EXPIRE; CREATE USER IF NOT EXISTS `root`@`localhost`; -CREATE USER IF NOT EXISTS `USER`@`%`; +CREATE USER IF NOT EXISTS `foobar`@`%` IDENTIFIED VIA test_plugin_server USING 'plug_dest'; SELECT COALESCE(CURRENT_ROLE(),'NONE') into @current_role; CREATE ROLE IF NOT EXISTS mariadb_dump_import_role; GRANT mariadb_dump_import_role TO CURRENT_USER(); @@ -340,11 +1279,11 @@ GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION; GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION; /*M!100005 SET DEFAULT ROLE NONE FOR 'root'@'localhost' */; /*!80001 ALTER USER 'root'@'localhost' DEFAULT ROLE NONE */; -GRANT `role_1` TO `USER`@`%`; -GRANT `role_2` TO `USER`@`%`; -GRANT USAGE ON *.* TO `USER`@`%`; -/*M!100005 SET DEFAULT ROLE 'role_2' FOR 'USER'@'%' */; -/*!80001 ALTER USER 'USER'@'%' DEFAULT ROLE 'role_2' */; +GRANT `role_1` TO `foobar`@`%`; +GRANT `role_2` TO `foobar`@`%`; +GRANT USAGE ON *.* TO `foobar`@`%` IDENTIFIED VIA test_plugin_server USING 'plug_dest'; +/*M!100005 SET DEFAULT ROLE 'role_2' FOR 'foobar'@'%' */; +/*!80001 ALTER USER 'foobar'@'%' DEFAULT ROLE 'role_2' */; GRANT `role_2` TO `role_1` WITH ADMIN OPTION; GRANT SHOW DATABASES ON *.* TO `role_1`; GRANT USAGE ON *.* TO `role_2`; @@ -359,31 +1298,39 @@ USE mysql; LOCK TABLES `column_stats` WRITE; /*!40000 ALTER TABLE `column_stats` DISABLE KEYS */; -INSERT IGNORE INTO `column_stats` VALUES ('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,254,'DOUBLE_PREC_HB','\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿'); +INSERT IGNORE INTO `column_stats` VALUES +('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,254,'DOUBLE_PREC_HB','\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿'); /*!40000 ALTER TABLE `column_stats` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `index_stats` WRITE; /*!40000 ALTER TABLE `index_stats` DISABLE KEYS */; -INSERT IGNORE INTO `index_stats` VALUES ('mysql','tz','PRIMARY',1,98.2500); +INSERT IGNORE INTO `index_stats` VALUES +('mysql','tz','PRIMARY',1,98.2500); /*!40000 ALTER TABLE `index_stats` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `table_stats` WRITE; /*!40000 ALTER TABLE `table_stats` DISABLE KEYS */; -INSERT IGNORE INTO `table_stats` VALUES ('mysql','tz',393); +INSERT IGNORE INTO `table_stats` VALUES +('mysql','tz',393); /*!40000 ALTER TABLE `table_stats` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `innodb_index_stats` WRITE; /*!40000 ALTER TABLE `innodb_index_stats` DISABLE KEYS */; -INSERT IGNORE INTO `innodb_index_stats` VALUES ('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index'); +INSERT IGNORE INTO `innodb_index_stats` VALUES +('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'), +('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'), +('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'), +('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index'); /*!40000 ALTER TABLE `innodb_index_stats` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `innodb_table_stats` WRITE; /*!40000 ALTER TABLE `innodb_table_stats` DISABLE KEYS */; -INSERT IGNORE INTO `innodb_table_stats` VALUES ('mysql','tz','2019-12-31 21:00:00',393,1,0); +INSERT IGNORE INTO `innodb_table_stats` VALUES +('mysql','tz','2019-12-31 21:00:00',393,1,0); /*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */; UNLOCK TABLES; @@ -391,31 +1338,488 @@ USE mysql; LOCK TABLES `time_zone` WRITE; /*!40000 ALTER TABLE `time_zone` DISABLE KEYS */; -INSERT IGNORE INTO `time_zone` VALUES (1,'N'),(2,'N'),(3,'N'),(4,'Y'),(5,'N'); +INSERT IGNORE INTO `time_zone` VALUES +(1,'N'), +(2,'N'), +(3,'N'), +(4,'Y'), +(5,'N'); /*!40000 ALTER TABLE `time_zone` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `time_zone_name` WRITE; /*!40000 ALTER TABLE `time_zone_name` DISABLE KEYS */; -INSERT IGNORE INTO `time_zone_name` VALUES ('Europe/Moscow',3),('Japan',5),('leap/Europe/Moscow',4),('MET',1),('Universal',2),('UTC',2); +INSERT IGNORE INTO `time_zone_name` VALUES +('Europe/Moscow',3), +('Japan',5), +('leap/Europe/Moscow',4), +('MET',1), +('Universal',2), +('UTC',2); /*!40000 ALTER TABLE `time_zone_name` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `time_zone_leap_second` WRITE; /*!40000 ALTER TABLE `time_zone_leap_second` DISABLE KEYS */; -INSERT IGNORE INTO `time_zone_leap_second` VALUES (78796800,1),(94694401,2),(126230402,3),(157766403,4),(189302404,5),(220924805,6),(252460806,7),(283996807,8),(315532808,9),(362793609,10),(394329610,11),(425865611,12),(489024012,13),(567993613,14),(631152014,15),(662688015,16),(709948816,17),(741484817,18),(773020818,19),(820454419,20),(867715220,21),(915148821,22); +INSERT IGNORE INTO `time_zone_leap_second` VALUES +(78796800,1), +(94694401,2), +(126230402,3), +(157766403,4), +(189302404,5), +(220924805,6), +(252460806,7), +(283996807,8), +(315532808,9), +(362793609,10), +(394329610,11), +(425865611,12), +(489024012,13), +(567993613,14), +(631152014,15), +(662688015,16), +(709948816,17), +(741484817,18), +(773020818,19), +(820454419,20), +(867715220,21), +(915148821,22); /*!40000 ALTER TABLE `time_zone_leap_second` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `time_zone_transition` WRITE; /*!40000 ALTER TABLE `time_zone_transition` DISABLE KEYS */; -INSERT IGNORE INTO `time_zone_transition` VALUES (1,-1693706400,0),(1,-1680483600,1),(1,-1663455600,2),(1,-1650150000,3),(1,-1632006000,2),(1,-1618700400,3),(1,-938905200,2),(1,-857257200,3),(1,-844556400,2),(1,-828226800,3),(1,-812502000,2),(1,-796777200,3),(1,228877200,2),(1,243997200,3),(1,260326800,2),(1,276051600,3),(1,291776400,2),(1,307501200,3),(1,323830800,2),(1,338950800,3),(1,354675600,2),(1,370400400,3),(1,386125200,2),(1,401850000,3),(1,417574800,2),(1,433299600,3),(1,449024400,2),(1,465354000,3),(1,481078800,2),(1,496803600,3),(1,512528400,2),(1,528253200,3),(1,543978000,2),(1,559702800,3),(1,575427600,2),(1,591152400,3),(1,606877200,2),(1,622602000,3),(1,638326800,2),(1,654656400,3),(1,670381200,2),(1,686106000,3),(1,701830800,2),(1,717555600,3),(1,733280400,2),(1,749005200,3),(1,764730000,2),(1,780454800,3),(1,796179600,2),(1,811904400,3),(1,828234000,2),(1,846378000,3),(1,859683600,2),(1,877827600,3),(1,891133200,2),(1,909277200,3),(1,922582800,2),(1,941331600,3),(1,954032400,2),(1,972781200,3),(1,985482000,2),(1,1004230800,3),(1,1017536400,2),(1,1035680400,3),(1,1048986000,2),(1,1067130000,3),(1,1080435600,2),(1,1099184400,3),(1,1111885200,2),(1,1130634000,3),(1,1143334800,2),(1,1162083600,3),(1,1174784400,2),(1,1193533200,3),(1,1206838800,2),(1,1224982800,3),(1,1238288400,2),(1,1256432400,3),(1,1269738000,2),(1,1288486800,3),(1,1301187600,2),(1,1319936400,3),(1,1332637200,2),(1,1351386000,3),(1,1364691600,2),(1,1382835600,3),(1,1396141200,2),(1,1414285200,3),(1,1427590800,2),(1,1445734800,3),(1,1459040400,2),(1,1477789200,3),(1,1490490000,2),(1,1509238800,3),(1,1521939600,2),(1,1540688400,3),(1,1553994000,2),(1,1572138000,3),(1,1585443600,2),(1,1603587600,3),(1,1616893200,2),(1,1635642000,3),(1,1648342800,2),(1,1667091600,3),(1,1679792400,2),(1,1698541200,3),(1,1711846800,2),(1,1729990800,3),(1,1743296400,2),(1,1761440400,3),(1,1774746000,2),(1,1792890000,3),(1,1806195600,2),(1,1824944400,3),(1,1837645200,2),(1,1856394000,3),(1,1869094800,2),(1,1887843600,3),(1,1901149200,2),(1,1919293200,3),(1,1932598800,2),(1,1950742800,3),(1,1964048400,2),(1,1982797200,3),(1,1995498000,2),(1,2014246800,3),(1,2026947600,2),(1,2045696400,3),(1,2058397200,2),(1,2077146000,3),(1,2090451600,2),(1,2108595600,3),(1,2121901200,2),(1,2140045200,3),(3,-1688265000,2),(3,-1656819048,1),(3,-1641353448,2),(3,-1627965048,3),(3,-1618716648,1),(3,-1596429048,3),(3,-1593829848,5),(3,-1589860800,4),(3,-1542427200,5),(3,-1539493200,6),(3,-1525323600,5),(3,-1522728000,4),(3,-1491188400,7),(3,-1247536800,4),(3,354920400,5),(3,370728000,4),(3,386456400,5),(3,402264000,4),(3,417992400,5),(3,433800000,4),(3,449614800,5),(3,465346800,8),(3,481071600,9),(3,496796400,8),(3,512521200,9),(3,528246000,8),(3,543970800,9),(3,559695600,8),(3,575420400,9),(3,591145200,8),(3,606870000,9),(3,622594800,8),(3,638319600,9),(3,654649200,8),(3,670374000,10),(3,686102400,11),(3,695779200,8),(3,701812800,5),(3,717534000,4),(3,733273200,9),(3,748998000,8),(3,764722800,9),(3,780447600,8),(3,796172400,9),(3,811897200,8),(3,828226800,9),(3,846370800,8),(3,859676400,9),(3,877820400,8),(3,891126000,9),(3,909270000,8),(3,922575600,9),(3,941324400,8),(3,954025200,9),(3,972774000,8),(3,985474800,9),(3,1004223600,8),(3,1017529200,9),(3,1035673200,8),(3,1048978800,9),(3,1067122800,8),(3,1080428400,9),(3,1099177200,8),(3,1111878000,9),(3,1130626800,8),(3,1143327600,9),(3,1162076400,8),(3,1174777200,9),(3,1193526000,8),(3,1206831600,9),(3,1224975600,8),(3,1238281200,9),(3,1256425200,8),(3,1269730800,9),(3,1288479600,8),(3,1301180400,9),(3,1319929200,8),(3,1332630000,9),(3,1351378800,8),(3,1364684400,9),(3,1382828400,8),(3,1396134000,9),(3,1414278000,8),(3,1427583600,9),(3,1445727600,8),(3,1459033200,9),(3,1477782000,8),(3,1490482800,9),(3,1509231600,8),(3,1521932400,9),(3,1540681200,8),(3,1553986800,9),(3,1572130800,8),(3,1585436400,9),(3,1603580400,8),(3,1616886000,9),(3,1635634800,8),(3,1648335600,9),(3,1667084400,8),(3,1679785200,9),(3,1698534000,8),(3,1711839600,9),(3,1729983600,8),(3,1743289200,9),(3,1761433200,8),(3,1774738800,9),(3,1792882800,8),(3,1806188400,9),(3,1824937200,8),(3,1837638000,9),(3,1856386800,8),(3,1869087600,9),(3,1887836400,8),(3,1901142000,9),(3,1919286000,8),(3,1932591600,9),(3,1950735600,8),(3,1964041200,9),(3,1982790000,8),(3,1995490800,9),(3,2014239600,8),(3,2026940400,9),(3,2045689200,8),(3,2058390000,9),(3,2077138800,8),(3,2090444400,9),(3,2108588400,8),(3,2121894000,9),(3,2140038000,8),(4,-1688265000,2),(4,-1656819048,1),(4,-1641353448,2),(4,-1627965048,3),(4,-1618716648,1),(4,-1596429048,3),(4,-1593829848,5),(4,-1589860800,4),(4,-1542427200,5),(4,-1539493200,6),(4,-1525323600,5),(4,-1522728000,4),(4,-1491188400,7),(4,-1247536800,4),(4,354920409,5),(4,370728010,4),(4,386456410,5),(4,402264011,4),(4,417992411,5),(4,433800012,4),(4,449614812,5),(4,465346812,8),(4,481071612,9),(4,496796413,8),(4,512521213,9),(4,528246013,8),(4,543970813,9),(4,559695613,8),(4,575420414,9),(4,591145214,8),(4,606870014,9),(4,622594814,8),(4,638319615,9),(4,654649215,8),(4,670374016,10),(4,686102416,11),(4,695779216,8),(4,701812816,5),(4,717534017,4),(4,733273217,9),(4,748998018,8),(4,764722818,9),(4,780447619,8),(4,796172419,9),(4,811897219,8),(4,828226820,9),(4,846370820,8),(4,859676420,9),(4,877820421,8),(4,891126021,9),(4,909270021,8),(4,922575622,9),(4,941324422,8),(4,954025222,9),(4,972774022,8),(4,985474822,9),(4,1004223622,8),(4,1017529222,9),(4,1035673222,8),(4,1048978822,9),(4,1067122822,8),(4,1080428422,9),(4,1099177222,8),(4,1111878022,9),(4,1130626822,8),(4,1143327622,9),(4,1162076422,8),(4,1174777222,9),(4,1193526022,8),(4,1206831622,9),(4,1224975622,8),(4,1238281222,9),(4,1256425222,8),(4,1269730822,9),(4,1288479622,8),(4,1301180422,9),(4,1319929222,8),(4,1332630022,9),(4,1351378822,8),(4,1364684422,9),(4,1382828422,8),(4,1396134022,9),(4,1414278022,8),(4,1427583622,9),(4,1445727622,8),(4,1459033222,9),(4,1477782022,8),(4,1490482822,9),(4,1509231622,8),(4,1521932422,9),(4,1540681222,8),(4,1553986822,9),(4,1572130822,8),(4,1585436422,9),(4,1603580422,8),(4,1616886022,9),(4,1635634822,8),(4,1648335622,9),(4,1667084422,8),(4,1679785222,9),(4,1698534022,8),(4,1711839622,9),(4,1729983622,8),(4,1743289222,9),(4,1761433222,8),(4,1774738822,9),(4,1792882822,8),(4,1806188422,9),(4,1824937222,8),(4,1837638022,9),(4,1856386822,8),(4,1869087622,9),(4,1887836422,8),(4,1901142022,9),(4,1919286022,8),(4,1932591622,9),(4,1950735622,8),(4,1964041222,9),(4,1982790022,8),(4,1995490822,9),(4,2014239622,8),(4,2026940422,9),(4,2045689222,8),(4,2058390022,9),(4,2077138822,8),(4,2090444422,9),(4,2108588422,8),(4,2121894022,9),(4,2140038022,8),(5,-1009875600,1); +INSERT IGNORE INTO `time_zone_transition` VALUES +(1,-1693706400,0), +(1,-1680483600,1), +(1,-1663455600,2), +(1,-1650150000,3), +(1,-1632006000,2), +(1,-1618700400,3), +(1,-938905200,2), +(1,-857257200,3), +(1,-844556400,2), +(1,-828226800,3), +(1,-812502000,2), +(1,-796777200,3), +(1,228877200,2), +(1,243997200,3), +(1,260326800,2), +(1,276051600,3), +(1,291776400,2), +(1,307501200,3), +(1,323830800,2), +(1,338950800,3), +(1,354675600,2), +(1,370400400,3), +(1,386125200,2), +(1,401850000,3), +(1,417574800,2), +(1,433299600,3), +(1,449024400,2), +(1,465354000,3), +(1,481078800,2), +(1,496803600,3), +(1,512528400,2), +(1,528253200,3), +(1,543978000,2), +(1,559702800,3), +(1,575427600,2), +(1,591152400,3), +(1,606877200,2), +(1,622602000,3), +(1,638326800,2), +(1,654656400,3), +(1,670381200,2), +(1,686106000,3), +(1,701830800,2), +(1,717555600,3), +(1,733280400,2), +(1,749005200,3), +(1,764730000,2), +(1,780454800,3), +(1,796179600,2), +(1,811904400,3), +(1,828234000,2), +(1,846378000,3), +(1,859683600,2), +(1,877827600,3), +(1,891133200,2), +(1,909277200,3), +(1,922582800,2), +(1,941331600,3), +(1,954032400,2), +(1,972781200,3), +(1,985482000,2), +(1,1004230800,3), +(1,1017536400,2), +(1,1035680400,3), +(1,1048986000,2), +(1,1067130000,3), +(1,1080435600,2), +(1,1099184400,3), +(1,1111885200,2), +(1,1130634000,3), +(1,1143334800,2), +(1,1162083600,3), +(1,1174784400,2), +(1,1193533200,3), +(1,1206838800,2), +(1,1224982800,3), +(1,1238288400,2), +(1,1256432400,3), +(1,1269738000,2), +(1,1288486800,3), +(1,1301187600,2), +(1,1319936400,3), +(1,1332637200,2), +(1,1351386000,3), +(1,1364691600,2), +(1,1382835600,3), +(1,1396141200,2), +(1,1414285200,3), +(1,1427590800,2), +(1,1445734800,3), +(1,1459040400,2), +(1,1477789200,3), +(1,1490490000,2), +(1,1509238800,3), +(1,1521939600,2), +(1,1540688400,3), +(1,1553994000,2), +(1,1572138000,3), +(1,1585443600,2), +(1,1603587600,3), +(1,1616893200,2), +(1,1635642000,3), +(1,1648342800,2), +(1,1667091600,3), +(1,1679792400,2), +(1,1698541200,3), +(1,1711846800,2), +(1,1729990800,3), +(1,1743296400,2), +(1,1761440400,3), +(1,1774746000,2), +(1,1792890000,3), +(1,1806195600,2), +(1,1824944400,3), +(1,1837645200,2), +(1,1856394000,3), +(1,1869094800,2), +(1,1887843600,3), +(1,1901149200,2), +(1,1919293200,3), +(1,1932598800,2), +(1,1950742800,3), +(1,1964048400,2), +(1,1982797200,3), +(1,1995498000,2), +(1,2014246800,3), +(1,2026947600,2), +(1,2045696400,3), +(1,2058397200,2), +(1,2077146000,3), +(1,2090451600,2), +(1,2108595600,3), +(1,2121901200,2), +(1,2140045200,3), +(3,-1688265000,2), +(3,-1656819048,1), +(3,-1641353448,2), +(3,-1627965048,3), +(3,-1618716648,1), +(3,-1596429048,3), +(3,-1593829848,5), +(3,-1589860800,4), +(3,-1542427200,5), +(3,-1539493200,6), +(3,-1525323600,5), +(3,-1522728000,4), +(3,-1491188400,7), +(3,-1247536800,4), +(3,354920400,5), +(3,370728000,4), +(3,386456400,5), +(3,402264000,4), +(3,417992400,5), +(3,433800000,4), +(3,449614800,5), +(3,465346800,8), +(3,481071600,9), +(3,496796400,8), +(3,512521200,9), +(3,528246000,8), +(3,543970800,9), +(3,559695600,8), +(3,575420400,9), +(3,591145200,8), +(3,606870000,9), +(3,622594800,8), +(3,638319600,9), +(3,654649200,8), +(3,670374000,10), +(3,686102400,11), +(3,695779200,8), +(3,701812800,5), +(3,717534000,4), +(3,733273200,9), +(3,748998000,8), +(3,764722800,9), +(3,780447600,8), +(3,796172400,9), +(3,811897200,8), +(3,828226800,9), +(3,846370800,8), +(3,859676400,9), +(3,877820400,8), +(3,891126000,9), +(3,909270000,8), +(3,922575600,9), +(3,941324400,8), +(3,954025200,9), +(3,972774000,8), +(3,985474800,9), +(3,1004223600,8), +(3,1017529200,9), +(3,1035673200,8), +(3,1048978800,9), +(3,1067122800,8), +(3,1080428400,9), +(3,1099177200,8), +(3,1111878000,9), +(3,1130626800,8), +(3,1143327600,9), +(3,1162076400,8), +(3,1174777200,9), +(3,1193526000,8), +(3,1206831600,9), +(3,1224975600,8), +(3,1238281200,9), +(3,1256425200,8), +(3,1269730800,9), +(3,1288479600,8), +(3,1301180400,9), +(3,1319929200,8), +(3,1332630000,9), +(3,1351378800,8), +(3,1364684400,9), +(3,1382828400,8), +(3,1396134000,9), +(3,1414278000,8), +(3,1427583600,9), +(3,1445727600,8), +(3,1459033200,9), +(3,1477782000,8), +(3,1490482800,9), +(3,1509231600,8), +(3,1521932400,9), +(3,1540681200,8), +(3,1553986800,9), +(3,1572130800,8), +(3,1585436400,9), +(3,1603580400,8), +(3,1616886000,9), +(3,1635634800,8), +(3,1648335600,9), +(3,1667084400,8), +(3,1679785200,9), +(3,1698534000,8), +(3,1711839600,9), +(3,1729983600,8), +(3,1743289200,9), +(3,1761433200,8), +(3,1774738800,9), +(3,1792882800,8), +(3,1806188400,9), +(3,1824937200,8), +(3,1837638000,9), +(3,1856386800,8), +(3,1869087600,9), +(3,1887836400,8), +(3,1901142000,9), +(3,1919286000,8), +(3,1932591600,9), +(3,1950735600,8), +(3,1964041200,9), +(3,1982790000,8), +(3,1995490800,9), +(3,2014239600,8), +(3,2026940400,9), +(3,2045689200,8), +(3,2058390000,9), +(3,2077138800,8), +(3,2090444400,9), +(3,2108588400,8), +(3,2121894000,9), +(3,2140038000,8), +(4,-1688265000,2), +(4,-1656819048,1), +(4,-1641353448,2), +(4,-1627965048,3), +(4,-1618716648,1), +(4,-1596429048,3), +(4,-1593829848,5), +(4,-1589860800,4), +(4,-1542427200,5), +(4,-1539493200,6), +(4,-1525323600,5), +(4,-1522728000,4), +(4,-1491188400,7), +(4,-1247536800,4), +(4,354920409,5), +(4,370728010,4), +(4,386456410,5), +(4,402264011,4), +(4,417992411,5), +(4,433800012,4), +(4,449614812,5), +(4,465346812,8), +(4,481071612,9), +(4,496796413,8), +(4,512521213,9), +(4,528246013,8), +(4,543970813,9), +(4,559695613,8), +(4,575420414,9), +(4,591145214,8), +(4,606870014,9), +(4,622594814,8), +(4,638319615,9), +(4,654649215,8), +(4,670374016,10), +(4,686102416,11), +(4,695779216,8), +(4,701812816,5), +(4,717534017,4), +(4,733273217,9), +(4,748998018,8), +(4,764722818,9), +(4,780447619,8), +(4,796172419,9), +(4,811897219,8), +(4,828226820,9), +(4,846370820,8), +(4,859676420,9), +(4,877820421,8), +(4,891126021,9), +(4,909270021,8), +(4,922575622,9), +(4,941324422,8), +(4,954025222,9), +(4,972774022,8), +(4,985474822,9), +(4,1004223622,8), +(4,1017529222,9), +(4,1035673222,8), +(4,1048978822,9), +(4,1067122822,8), +(4,1080428422,9), +(4,1099177222,8), +(4,1111878022,9), +(4,1130626822,8), +(4,1143327622,9), +(4,1162076422,8), +(4,1174777222,9), +(4,1193526022,8), +(4,1206831622,9), +(4,1224975622,8), +(4,1238281222,9), +(4,1256425222,8), +(4,1269730822,9), +(4,1288479622,8), +(4,1301180422,9), +(4,1319929222,8), +(4,1332630022,9), +(4,1351378822,8), +(4,1364684422,9), +(4,1382828422,8), +(4,1396134022,9), +(4,1414278022,8), +(4,1427583622,9), +(4,1445727622,8), +(4,1459033222,9), +(4,1477782022,8), +(4,1490482822,9), +(4,1509231622,8), +(4,1521932422,9), +(4,1540681222,8), +(4,1553986822,9), +(4,1572130822,8), +(4,1585436422,9), +(4,1603580422,8), +(4,1616886022,9), +(4,1635634822,8), +(4,1648335622,9), +(4,1667084422,8), +(4,1679785222,9), +(4,1698534022,8), +(4,1711839622,9), +(4,1729983622,8), +(4,1743289222,9), +(4,1761433222,8), +(4,1774738822,9), +(4,1792882822,8), +(4,1806188422,9), +(4,1824937222,8), +(4,1837638022,9), +(4,1856386822,8), +(4,1869087622,9), +(4,1887836422,8), +(4,1901142022,9), +(4,1919286022,8), +(4,1932591622,9), +(4,1950735622,8), +(4,1964041222,9), +(4,1982790022,8), +(4,1995490822,9), +(4,2014239622,8), +(4,2026940422,9), +(4,2045689222,8), +(4,2058390022,9), +(4,2077138822,8), +(4,2090444422,9), +(4,2108588422,8), +(4,2121894022,9), +(4,2140038022,8), +(5,-1009875600,1); /*!40000 ALTER TABLE `time_zone_transition` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `time_zone_transition_type` WRITE; /*!40000 ALTER TABLE `time_zone_transition_type` DISABLE KEYS */; -INSERT IGNORE INTO `time_zone_transition_type` VALUES (1,0,7200,1,'MEST'),(1,1,3600,0,'MET'),(1,2,7200,1,'MEST'),(1,3,3600,0,'MET'),(2,0,0,0,'UTC'),(3,0,9000,0,'MMT'),(3,1,12648,1,'MST'),(3,2,9048,0,'MMT'),(3,3,16248,1,'MDST'),(3,4,10800,0,'MSK'),(3,5,14400,1,'MSD'),(3,6,18000,1,'MSD'),(3,7,7200,0,'EET'),(3,8,10800,0,'MSK'),(3,9,14400,1,'MSD'),(3,10,10800,1,'EEST'),(3,11,7200,0,'EET'),(4,0,9000,0,'MMT'),(4,1,12648,1,'MST'),(4,2,9048,0,'MMT'),(4,3,16248,1,'MDST'),(4,4,10800,0,'MSK'),(4,5,14400,1,'MSD'),(4,6,18000,1,'MSD'),(4,7,7200,0,'EET'),(4,8,10800,0,'MSK'),(4,9,14400,1,'MSD'),(4,10,10800,1,'EEST'),(4,11,7200,0,'EET'),(5,0,32400,0,'CJT'),(5,1,32400,0,'JST'); +INSERT IGNORE INTO `time_zone_transition_type` VALUES +(1,0,7200,1,'MEST'), +(1,1,3600,0,'MET'), +(1,2,7200,1,'MEST'), +(1,3,3600,0,'MET'), +(2,0,0,0,'UTC'), +(3,0,9000,0,'MMT'), +(3,1,12648,1,'MST'), +(3,2,9048,0,'MMT'), +(3,3,16248,1,'MDST'), +(3,4,10800,0,'MSK'), +(3,5,14400,1,'MSD'), +(3,6,18000,1,'MSD'), +(3,7,7200,0,'EET'), +(3,8,10800,0,'MSK'), +(3,9,14400,1,'MSD'), +(3,10,10800,1,'EEST'), +(3,11,7200,0,'EET'), +(4,0,9000,0,'MMT'), +(4,1,12648,1,'MST'), +(4,2,9048,0,'MMT'), +(4,3,16248,1,'MDST'), +(4,4,10800,0,'MSK'), +(4,5,14400,1,'MSD'), +(4,6,18000,1,'MSD'), +(4,7,7200,0,'EET'), +(4,8,10800,0,'MSK'), +(4,9,14400,1,'MSD'), +(4,10,10800,1,'EEST'), +(4,11,7200,0,'EET'), +(5,0,32400,0,'CJT'), +(5,1,32400,0,'JST'); /*!40000 ALTER TABLE `time_zone_transition_type` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -430,7 +1834,7 @@ UNLOCK TABLES; SELECT * FROM mysql.global_priv ORDER BY User,Host; Host User Priv -% USER {"access":0,"version_id":VERSION,"plugin":"mysql_native_password","authentication_string":"","password_last_changed":NOW,"default_role":"role_2"} +% foobar {"access":0,"version_id":VERSION,"plugin":"test_plugin_server","authentication_string":"plug_dest","password_last_changed":NOW,"default_role":"role_2"} localhost mariadb.sys {"access":0,"plugin":"mysql_native_password","authentication_string":"","account_locked":false,"password_last_changed":NOW,"version_id":VERSION} role_1 {"access":16384,"version_id":VERSION,"is_role":true} role_2 {"access":0,"version_id":VERSION,"is_role":true} @@ -438,9 +1842,9 @@ localhost root {"access":18446744073709551615} CHECKSUM TABLE mysql.roles_mapping, mysql.time_zone_transition, mysql.plugin, mysql.servers, mysql.func, mysql.innodb_table_stats, mysql.table_stats; Table Checksum -mysql.roles_mapping 4108206491 +mysql.roles_mapping 2510045525 mysql.time_zone_transition 3895294076 -mysql.plugin 0 +mysql.plugin 1587119305 mysql.servers 2079085450 mysql.func 3241572444 mysql.innodb_table_stats 347867921 @@ -450,7 +1854,7 @@ CREATE USER mariadb_test_restore IDENTIFIED BY 'getitback'; GRANT ALL ON *.* TO mariadb_test_restore WITH GRANT OPTION; GRANT PROXY ON ''@'%' TO mariadb_test_restore WITH GRANT OPTION; GRANT SUPER, CREATE USER /*M!100502 ,FEDERATED ADMIN */ ON *.* TO mariadb_test_restore WITH GRANT OPTION; -drop user USER; +drop user foobar; delete from mysql.table_stats; delete from mysql.innodb_table_stats; delete from mysql.time_zone_transition; @@ -465,7 +1869,7 @@ set time_zone= @@global.time_zone; DROP USER mariadb_test_restore; SELECT * FROM mysql.global_priv ORDER BY User,Host; Host User Priv -% USER {"access":0,"version_id":VERSION,"plugin":"mysql_native_password","authentication_string":"","password_last_changed":NOW,"default_role":"role_2"} +% foobar {"access":0,"version_id":VERSION,"plugin":"test_plugin_server","authentication_string":"plug_dest","password_last_changed":NOW,"default_role":"role_2"} localhost mariadb.sys {"access":0,"version_id":VERSION,"plugin":"mysql_native_password","authentication_string":"","password_last_changed":NOW,"password_lifetime":-1,"default_role":""} role_1 {"access":16384,"version_id":VERSION,"is_role":true} role_2 {"access":0,"version_id":VERSION,"is_role":true} @@ -473,9 +1877,9 @@ localhost root {"access":549755813887,"version_id":VERSION,"plugin":"mysql_nativ CHECKSUM TABLE mysql.roles_mapping, mysql.time_zone_transition, mysql.plugin, mysql.servers, mysql.func, mysql.innodb_table_stats, mysql.table_stats; Table Checksum -mysql.roles_mapping 4108206491 +mysql.roles_mapping 2510045525 mysql.time_zone_transition 3895294076 -mysql.plugin 0 +mysql.plugin 1587119305 mysql.servers 2079085450 mysql.func 3241572444 mysql.innodb_table_stats 347867921 @@ -490,8 +1894,9 @@ DELETE FROM mysql.innodb_table_stats WHERE database_name='mysql' and table_name drop table mysql.tz; DROP ROLE role_2; DROP ROLE role_1; -drop user USER; +drop user foobar; replace into mysql.global_priv select * from backup_users; replace into mysql.tables_priv select * from tables_priv; flush privileges; drop table backup_users, tables_priv; +uninstall soname 'auth_test_plugin'; diff --git a/mysql-test/main/mysqldump-system.test b/mysql-test/main/mysqldump-system.test index c1965410167..7e85fcc1a11 100644 --- a/mysql-test/main/mysqldump-system.test +++ b/mysql-test/main/mysqldump-system.test @@ -3,9 +3,10 @@ --source include/have_udf.inc --source include/platform.inc -if (!$AUTH_SOCKET_SO) { - --skip Need auth socket plugin +if (!$AUTH_TEST_PLUGIN_SO) { + --skip Need auth test plugin } +install soname 'auth_test_plugin'; --echo # --echo # MDEV-23630: mysqldump to logically dump system tables @@ -21,7 +22,7 @@ flush privileges; # mariadb.sys because of MDEV-24098 alter user 'mariadb.sys'@'localhost' ACCOUNT UNLOCK; -create user USER; +create user foobar IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; # time zone data already loaded @@ -29,9 +30,9 @@ CREATE ROLE role_1; CREATE ROLE role_2 WITH ADMIN role_1; GRANT SHOW DATABASES ON *.* TO role_1; -GRANT role_1 TO USER; -GRANT role_2 TO USER; -SET DEFAULT ROLE role_2 FOR USER; +GRANT role_1 TO foobar; +GRANT role_2 TO foobar; +SET DEFAULT ROLE role_2 FOR foobar; ALTER TABLE mysql.roles_mapping ORDER BY Host, User, Role; @@ -66,7 +67,7 @@ eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO"; --echo # mysqldump of system tables with --system=all --echo # ---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB +--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB $AUTH_TEST_PLUGIN_SO AUTH_TEST_PLUGIN_LIB --exec $MYSQL_DUMP --skip-comments --system=all @@ -74,7 +75,7 @@ eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO"; --echo # mysqldump of system tables with --system=all --replace --echo # ---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB +--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB $AUTH_TEST_PLUGIN_SO AUTH_TEST_PLUGIN_LIB --exec $MYSQL_DUMP --skip-comments --system=all --replace @@ -85,7 +86,7 @@ eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO"; --echo # mysqldump of system tables with --system=all --insert-ignore --echo # ---replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB +--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB $AUTH_TEST_PLUGIN_SO AUTH_TEST_PLUGIN_LIB --exec $MYSQL_DUMP --skip-comments --system=all --insert-ignore @@ -107,7 +108,7 @@ GRANT ALL ON *.* TO mariadb_test_restore WITH GRANT OPTION; GRANT PROXY ON ''@'%' TO mariadb_test_restore WITH GRANT OPTION; GRANT SUPER, CREATE USER /*M!100502 ,FEDERATED ADMIN */ ON *.* TO mariadb_test_restore WITH GRANT OPTION; -drop user USER; +drop user foobar; delete from mysql.table_stats; delete from mysql.innodb_table_stats; delete from mysql.time_zone_transition; @@ -151,9 +152,10 @@ drop table mysql.tz; DROP ROLE role_2; DROP ROLE role_1; -drop user USER; +drop user foobar; replace into mysql.global_priv select * from backup_users; replace into mysql.tables_priv select * from tables_priv; flush privileges; drop table backup_users, tables_priv; +uninstall soname 'auth_test_plugin'; diff --git a/mysql-test/main/mysqldump.result b/mysql-test/main/mysqldump.result index eae0e1b03c6..8b2550d4d51 100644 --- a/mysql-test/main/mysqldump.result +++ b/mysql-test/main/mysqldump.result @@ -3814,29 +3814,29 @@ DROP TABLE IF EXISTS `TABLES`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TEMPORARY TABLE `TABLES` ( - `TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '', - `TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `TABLE_NAME` varchar(64) NOT NULL DEFAULT '', - `TABLE_TYPE` varchar(64) NOT NULL DEFAULT '', - `ENGINE` varchar(64) DEFAULT NULL, - `VERSION` bigint(21) unsigned DEFAULT NULL, - `ROW_FORMAT` varchar(10) DEFAULT NULL, - `TABLE_ROWS` bigint(21) unsigned DEFAULT NULL, - `AVG_ROW_LENGTH` bigint(21) unsigned DEFAULT NULL, - `DATA_LENGTH` bigint(21) unsigned DEFAULT NULL, - `MAX_DATA_LENGTH` bigint(21) unsigned DEFAULT NULL, - `INDEX_LENGTH` bigint(21) unsigned DEFAULT NULL, - `DATA_FREE` bigint(21) unsigned DEFAULT NULL, - `AUTO_INCREMENT` bigint(21) unsigned DEFAULT NULL, - `CREATE_TIME` datetime DEFAULT NULL, - `UPDATE_TIME` datetime DEFAULT NULL, - `CHECK_TIME` datetime DEFAULT NULL, - `TABLE_COLLATION` varchar(32) DEFAULT NULL, - `CHECKSUM` bigint(21) unsigned DEFAULT NULL, - `CREATE_OPTIONS` varchar(2048) DEFAULT NULL, - `TABLE_COMMENT` varchar(2048) NOT NULL DEFAULT '', - `MAX_INDEX_LENGTH` bigint(21) unsigned DEFAULT NULL, - `TEMPORARY` varchar(1) DEFAULT NULL + `TABLE_CATALOG` varchar(512) NOT NULL, + `TABLE_SCHEMA` varchar(64) NOT NULL, + `TABLE_NAME` varchar(64) NOT NULL, + `TABLE_TYPE` varchar(64) NOT NULL, + `ENGINE` varchar(64), + `VERSION` bigint(21) unsigned, + `ROW_FORMAT` varchar(10), + `TABLE_ROWS` bigint(21) unsigned, + `AVG_ROW_LENGTH` bigint(21) unsigned, + `DATA_LENGTH` bigint(21) unsigned, + `MAX_DATA_LENGTH` bigint(21) unsigned, + `INDEX_LENGTH` bigint(21) unsigned, + `DATA_FREE` bigint(21) unsigned, + `AUTO_INCREMENT` bigint(21) unsigned, + `CREATE_TIME` datetime, + `UPDATE_TIME` datetime, + `CHECK_TIME` datetime, + `TABLE_COLLATION` varchar(32), + `CHECKSUM` bigint(21) unsigned, + `CREATE_OPTIONS` varchar(2048), + `TABLE_COMMENT` varchar(2048) NOT NULL, + `MAX_INDEX_LENGTH` bigint(21) unsigned, + `TEMPORARY` varchar(1) ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3; /*!40101 SET character_set_client = @saved_cs_client */; # diff --git a/mysql-test/main/opt_trace_index_merge_innodb.result b/mysql-test/main/opt_trace_index_merge_innodb.result index 0ddaaeae89d..fbc7faa0d04 100644 --- a/mysql-test/main/opt_trace_index_merge_innodb.result +++ b/mysql-test/main/opt_trace_index_merge_innodb.result @@ -184,12 +184,12 @@ explain select * from t1 where pk1 != 0 and key1 = 1 { { "selectivity_for_indexes": [ { - "index_name": "PRIMARY", - "selectivity_from_index": 1 - }, - { "index_name": "key1", "selectivity_from_index": 0.001 + }, + { + "index_name": "PRIMARY", + "selectivity_from_index": 1 } ], "selectivity_for_columns": [], diff --git a/mysql-test/main/order_by.result b/mysql-test/main/order_by.result index e9f4b1d599a..1df737f2c37 100644 --- a/mysql-test/main/order_by.result +++ b/mysql-test/main/order_by.result @@ -3562,6 +3562,29 @@ b a 40 1 30 4 drop table t1,t2; +# +# MDEV-22256 Assertion `length == pack_length()' failed in Field_timestamp_with_dec::sort_string +# +SET sql_mode=''; +SET @@SESSION.max_sort_length=4; +Warnings: +Warning 1292 Truncated incorrect max_sort_length value: '4' +CREATE TABLE t1 (c TIMESTAMP(1)); +INSERT INTO t1 VALUES(0); +DELETE FROM t1 ORDER BY c; +DROP TABLE t1; +SET @@SESSION.max_sort_length=DEFAULT; +SET sql_mode=DEFAULT; +SET sql_mode=''; +SET @@SESSION.max_sort_length=1; +Warnings: +Warning 1292 Truncated incorrect max_sort_length value: '1' +CREATE TEMPORARY TABLE t1 (c DATETIME); +INSERT INTO t1 VALUES(0); +DELETE FROM t1 ORDER BY c; +DROP TABLE t1; +SET @@SESSION.max_sort_length=DEFAULT; +SET sql_mode=DEFAULT; # End of 10.2 tests # # MDEV-16214: Incorrect plan taken by the optimizer , uses INDEX instead of ref access with ORDER BY diff --git a/mysql-test/main/order_by.test b/mysql-test/main/order_by.test index 9ad0af1d21f..e8b51ce15d1 100644 --- a/mysql-test/main/order_by.test +++ b/mysql-test/main/order_by.test @@ -2311,6 +2311,29 @@ explain (select b,a from t2 order by a limit 3) order by b desc; drop table t1,t2; +--echo # +--echo # MDEV-22256 Assertion `length == pack_length()' failed in Field_timestamp_with_dec::sort_string +--echo # + +SET sql_mode=''; +SET @@SESSION.max_sort_length=4; +CREATE TABLE t1 (c TIMESTAMP(1)); +INSERT INTO t1 VALUES(0); +DELETE FROM t1 ORDER BY c; +DROP TABLE t1; +SET @@SESSION.max_sort_length=DEFAULT; +SET sql_mode=DEFAULT; + +SET sql_mode=''; +SET @@SESSION.max_sort_length=1; +CREATE TEMPORARY TABLE t1 (c DATETIME); +INSERT INTO t1 VALUES(0); +DELETE FROM t1 ORDER BY c; +DROP TABLE t1; +SET @@SESSION.max_sort_length=DEFAULT; +SET sql_mode=DEFAULT; + + --echo # End of 10.2 tests --echo # diff --git a/mysql-test/main/partition_sp.result b/mysql-test/main/partition_sp.result new file mode 100644 index 00000000000..585e2c7ab9d --- /dev/null +++ b/mysql-test/main/partition_sp.result @@ -0,0 +1,22 @@ +# +# MDEV-8652: Partitioned table creation problem when +# creating from procedure context twice in same session +# +CREATE PROCEDURE p1() +BEGIN +DROP TABLE IF EXISTS t1 ; +CREATE TABLE t1 ( +id INT PRIMARY KEY +) +PARTITION BY RANGE (id) ( +PARTITION P1 VALUES LESS THAN (2), +PARTITION P2 VALUES LESS THAN (3) +); +END | +call p1(); +call p1(); +drop procedure p1; +drop table t1; +# +# End of 10.2 tests +# diff --git a/mysql-test/main/partition_sp.test b/mysql-test/main/partition_sp.test new file mode 100644 index 00000000000..1d3d1d707c7 --- /dev/null +++ b/mysql-test/main/partition_sp.test @@ -0,0 +1,35 @@ +--source include/have_partition.inc + +--echo # +--echo # MDEV-8652: Partitioned table creation problem when +--echo # creating from procedure context twice in same session +--echo # + + +DELIMITER |; + +CREATE PROCEDURE p1() +BEGIN + DROP TABLE IF EXISTS t1 ; + + CREATE TABLE t1 ( + id INT PRIMARY KEY + ) + PARTITION BY RANGE (id) ( + PARTITION P1 VALUES LESS THAN (2), + PARTITION P2 VALUES LESS THAN (3) + ); +END | + +DELIMITER ;| + +call p1(); +call p1(); + +drop procedure p1; +drop table t1; + +--echo # +--echo # End of 10.2 tests +--echo # + diff --git a/mysql-test/main/partition_symlink.result b/mysql-test/main/partition_symlink.result index 90048eb3438..b5a976e3a9e 100644 --- a/mysql-test/main/partition_symlink.result +++ b/mysql-test/main/partition_symlink.result @@ -177,3 +177,97 @@ partition by key (a) (partition p0, partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); Got one of the listed errors +# +# MDEV-25917 create table like fails if source table is partitioned and engine is myisam or aria with data directory. +# +CREATE TABLE t1 (a INT) +ENGINE = MyISAM +PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0) +DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp' + INDEX DIRECTORY 'MYSQLTEST_VARDIR/tmp', +PARTITION p1 VALUES IN (1) +DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp' + INDEX DIRECTORY 'MYSQLTEST_VARDIR/tmp', +PARTITION p2 VALUES IN (2)); +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + PARTITION BY LIST (`a`) +(PARTITION `p0` VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp' ENGINE = MyISAM, + PARTITION `p1` VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp' ENGINE = MyISAM, + PARTITION `p2` VALUES IN (2) ENGINE = MyISAM) +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + PARTITION BY LIST (`a`) +(PARTITION `p0` VALUES IN (0) ENGINE = MyISAM, + PARTITION `p1` VALUES IN (1) ENGINE = MyISAM, + PARTITION `p2` VALUES IN (2) ENGINE = MyISAM) +DROP TABLE t1, t2; +CREATE TABLE t1 ( +ID int(11) NOT NULL, +type int(11)) Engine=MyISAM +PARTITION BY RANGE(ID) +SUBPARTITION BY HASH(type) +( +PARTITION p01 VALUES LESS THAN(100) +(SUBPARTITION s11 +DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp' + INDEX DIRECTORY 'MYSQLTEST_VARDIR/tmp', +SUBPARTITION s12 +DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp' + INDEX DIRECTORY 'MYSQLTEST_VARDIR/tmp' + ), +PARTITION p11 VALUES LESS THAN(200) +(SUBPARTITION s21, SUBPARTITION s22), +PARTITION p21 VALUES LESS THAN MAXVALUE +(SUBPARTITION s31 +DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp' + INDEX DIRECTORY 'MYSQLTEST_VARDIR/tmp', +SUBPARTITION s32 +DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp' + INDEX DIRECTORY 'MYSQLTEST_VARDIR/tmp' + ) +); +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ID` int(11) NOT NULL, + `type` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + PARTITION BY RANGE (`ID`) +SUBPARTITION BY HASH (`type`) +(PARTITION `p01` VALUES LESS THAN (100) + (SUBPARTITION `s11` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp' ENGINE = MyISAM, + SUBPARTITION `s12` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp' ENGINE = MyISAM), + PARTITION `p11` VALUES LESS THAN (200) + (SUBPARTITION `s21` ENGINE = MyISAM, + SUBPARTITION `s22` ENGINE = MyISAM), + PARTITION `p21` VALUES LESS THAN MAXVALUE + (SUBPARTITION `s31` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp' ENGINE = MyISAM, + SUBPARTITION `s32` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp' ENGINE = MyISAM)) +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `ID` int(11) NOT NULL, + `type` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + PARTITION BY RANGE (`ID`) +SUBPARTITION BY HASH (`type`) +(PARTITION `p01` VALUES LESS THAN (100) + (SUBPARTITION `s11` ENGINE = MyISAM, + SUBPARTITION `s12` ENGINE = MyISAM), + PARTITION `p11` VALUES LESS THAN (200) + (SUBPARTITION `s21` ENGINE = MyISAM, + SUBPARTITION `s22` ENGINE = MyISAM), + PARTITION `p21` VALUES LESS THAN MAXVALUE + (SUBPARTITION `s31` ENGINE = MyISAM, + SUBPARTITION `s32` ENGINE = MyISAM)) +DROP TABLE t1, t2; diff --git a/mysql-test/main/partition_symlink.test b/mysql-test/main/partition_symlink.test index 8f6e837299a..7e09c7d0642 100644 --- a/mysql-test/main/partition_symlink.test +++ b/mysql-test/main/partition_symlink.test @@ -220,3 +220,58 @@ ENGINE = MyISAM partition by key (a) (partition p0, partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); + +--echo # +--echo # MDEV-25917 create table like fails if source table is partitioned and engine is myisam or aria with data directory. +--echo # +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval CREATE TABLE t1 (a INT) +ENGINE = MyISAM +PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0) + DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' + INDEX DIRECTORY '$MYSQLTEST_VARDIR/tmp', + PARTITION p1 VALUES IN (1) + DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' + INDEX DIRECTORY '$MYSQLTEST_VARDIR/tmp', + PARTITION p2 VALUES IN (2)); + +CREATE TABLE t2 LIKE t1; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +SHOW CREATE TABLE t1; +SHOW CREATE TABLE t2; +DROP TABLE t1, t2; + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval CREATE TABLE t1 ( + ID int(11) NOT NULL, + type int(11)) Engine=MyISAM +PARTITION BY RANGE(ID) +SUBPARTITION BY HASH(type) +( + PARTITION p01 VALUES LESS THAN(100) + (SUBPARTITION s11 + DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' + INDEX DIRECTORY '$MYSQLTEST_VARDIR/tmp', + SUBPARTITION s12 + DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' + INDEX DIRECTORY '$MYSQLTEST_VARDIR/tmp' + ), + PARTITION p11 VALUES LESS THAN(200) + (SUBPARTITION s21, SUBPARTITION s22), + PARTITION p21 VALUES LESS THAN MAXVALUE + (SUBPARTITION s31 + DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' + INDEX DIRECTORY '$MYSQLTEST_VARDIR/tmp', + SUBPARTITION s32 + DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp' + INDEX DIRECTORY '$MYSQLTEST_VARDIR/tmp' + ) +); + +CREATE TABLE t2 LIKE t1; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +SHOW CREATE TABLE t1; +SHOW CREATE TABLE t2; + +DROP TABLE t1, t2; diff --git a/mysql-test/main/range_innodb.result b/mysql-test/main/range_innodb.result index be7e89b9fd2..1d98fad0295 100644 --- a/mysql-test/main/range_innodb.result +++ b/mysql-test/main/range_innodb.result @@ -110,6 +110,112 @@ SET @@GLOBAL.debug_dbug = @saved_dbug; set @@optimizer_switch= @optimizer_switch_save; # End of 10.1 tests # +# MDEV-27262: Index intersection with full scan over an index +# +CREATE TABLE t1 ( +id int(10) unsigned NOT NULL AUTO_INCREMENT, +p char(32) DEFAULT NULL, +es tinyint(3) unsigned NOT NULL DEFAULT 0, +er tinyint(3) unsigned NOT NULL DEFAULT 0, +x mediumint(8) unsigned NOT NULL DEFAULT 0, +PRIMARY KEY (id), +INDEX es (es), +INDEX x (x), +INDEX er (er,x), +INDEX p (p) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +insert into t1(es,er) select 0, 1 from seq_1_to_45; +insert into t1(es,er) select 0, 2 from seq_1_to_49; +insert into t1(es,er) select 0, 3 from seq_1_to_951; +insert into t1(es,er) select 0, 3 from seq_1_to_1054; +insert into t1(es,er) select 0, 6 from seq_1_to_25; +insert into t1(es,er) select 0, 11 from seq_1_to_1; +insert into t1(es,er) select 1, 1 from seq_1_to_45; +insert into t1(es,er) select 1, 2 from seq_1_to_16; +insert into t1(es,er) select 1, 3 from seq_1_to_511; +insert into t1(es,er) select 1, 4 from seq_1_to_687; +insert into t1(es,er) select 1, 6 from seq_1_to_50; +insert into t1(es,er) select 1, 7 from seq_1_to_4; +insert into t1(es,er) select 1, 11 from seq_1_to_1; +insert into t1(es,er) select 2, 1 from seq_1_to_82; +insert into t1(es,er) select 2, 2 from seq_1_to_82; +insert into t1(es,er) select 2, 3 from seq_1_to_1626; +insert into t1(es,er) select 2, 4 from seq_1_to_977; +insert into t1(es,er) select 2, 6 from seq_1_to_33; +insert into t1(es,er) select 2, 11 from seq_1_to_1; +insert into t1(es,er) select 3, 1 from seq_1_to_245; +insert into t1(es,er) select 3, 2 from seq_1_to_81; +insert into t1(es,er) select 3, 3 from seq_1_to_852; +insert into t1(es,er) select 3, 4 from seq_1_to_2243; +insert into t1(es,er) select 3, 6 from seq_1_to_44; +insert into t1(es,er) select 3, 11 from seq_1_to_1; +insert into t1(es,er) select 4, 1 from seq_1_to_91; +insert into t1(es,er) select 4, 2 from seq_1_to_83; +insert into t1(es,er) select 4, 3 from seq_1_to_297; +insert into t1(es,er) select 4, 4 from seq_1_to_2456; +insert into t1(es,er) select 4, 6 from seq_1_to_19; +insert into t1(es,er) select 4, 11 from seq_1_to_1; +update t1 set p='foobar'; +update t1 set x=0; +set @save_isp=@@innodb_stats_persistent; +set global innodb_stats_persistent= 1; +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +set optimizer_switch='index_merge_sort_intersection=on'; +SELECT * FROM t1 +WHERE ((p = 'foo' AND er != 4) OR er = 4 ) AND (es >= 4) LIMIT 2; +id p es er x +14645 foobar 4 4 0 +14646 foobar 4 4 0 +EXPLAIN EXTENDED SELECT * FROM t1 +WHERE ((p = 'foo' AND er != 4) OR er = 4 ) AND (es >= 4) LIMIT 2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 range es,er,p es 1 NULL # 100.00 Using index condition; Using where +Warnings: +Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`p` AS `p`,`test`.`t1`.`es` AS `es`,`test`.`t1`.`er` AS `er`,`test`.`t1`.`x` AS `x` from `test`.`t1` where (`test`.`t1`.`p` = 'foo' and `test`.`t1`.`er` <> 4 or `test`.`t1`.`er` = 4) and `test`.`t1`.`es` >= 4 limit 2 +set optimizer_switch='index_merge_sort_intersection=off'; +SELECT * FROM t1 +WHERE ((p = 'foo' AND er != 4) OR er = 4 ) AND (es >= 4) LIMIT 2; +id p es er x +14645 foobar 4 4 0 +14646 foobar 4 4 0 +EXPLAIN EXTENDED SELECT * FROM t1 +WHERE ((p = 'foo' AND er != 4) OR er = 4 ) AND (es >= 4) LIMIT 2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 range es,er,p es 1 NULL # 100.00 Using index condition; Using where +Warnings: +Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`p` AS `p`,`test`.`t1`.`es` AS `es`,`test`.`t1`.`er` AS `er`,`test`.`t1`.`x` AS `x` from `test`.`t1` where (`test`.`t1`.`p` = 'foo' and `test`.`t1`.`er` <> 4 or `test`.`t1`.`er` = 4) and `test`.`t1`.`es` >= 4 limit 2 +set optimizer_switch='index_merge_sort_intersection=on'; +SELECT * FROM t1 +WHERE ((p = 'foo' AND er < 6) OR er >=2 ) AND (es >= 4) LIMIT 2; +id p es er x +14007 foobar 4 2 0 +14008 foobar 4 2 0 +EXPLAIN EXTENDED SELECT * FROM t1 +WHERE ((p = 'foo' AND er < 6) OR er >=2 ) AND (es >= 4) LIMIT 2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 range es,er,p es 1 NULL # 100.00 Using index condition; Using where +Warnings: +Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`p` AS `p`,`test`.`t1`.`es` AS `es`,`test`.`t1`.`er` AS `er`,`test`.`t1`.`x` AS `x` from `test`.`t1` where (`test`.`t1`.`p` = 'foo' and `test`.`t1`.`er` < 6 or `test`.`t1`.`er` >= 2) and `test`.`t1`.`es` >= 4 limit 2 +set optimizer_switch='index_merge_sort_intersection=off'; +SELECT * FROM t1 +WHERE ((p = 'foo' AND er < 6) OR er >=2 ) AND (es >= 4) LIMIT 2; +id p es er x +14007 foobar 4 2 0 +14008 foobar 4 2 0 +EXPLAIN EXTENDED SELECT * FROM t1 +WHERE ((p = 'foo' AND er < 6) OR er >=2 ) AND (es >= 4) LIMIT 2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 range es,er,p es 1 NULL # 100.00 Using index condition; Using where +Warnings: +Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`p` AS `p`,`test`.`t1`.`es` AS `es`,`test`.`t1`.`er` AS `er`,`test`.`t1`.`x` AS `x` from `test`.`t1` where (`test`.`t1`.`p` = 'foo' and `test`.`t1`.`er` < 6 or `test`.`t1`.`er` >= 2) and `test`.`t1`.`es` >= 4 limit 2 +set optimizer_switch='index_merge_sort_intersection=default'; +set global innodb_stats_persistent= @save_isp; +DROP TABLE t1; +# End of 10.2 tests +# # MDEV-19634: Assertion `0' failed in row_sel_convert_mysql_key_to_innobase, # [Warning] InnoDB: Using a partial-field key prefix in search # diff --git a/mysql-test/main/range_innodb.test b/mysql-test/main/range_innodb.test index f79104fde85..8b9771d1d1e 100644 --- a/mysql-test/main/range_innodb.test +++ b/mysql-test/main/range_innodb.test @@ -118,6 +118,99 @@ set @@optimizer_switch= @optimizer_switch_save; --echo # End of 10.1 tests --echo # +--echo # MDEV-27262: Index intersection with full scan over an index +--echo # + +--source include/have_sequence.inc + +CREATE TABLE t1 ( + id int(10) unsigned NOT NULL AUTO_INCREMENT, + p char(32) DEFAULT NULL, + es tinyint(3) unsigned NOT NULL DEFAULT 0, + er tinyint(3) unsigned NOT NULL DEFAULT 0, + x mediumint(8) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (id), + INDEX es (es), + INDEX x (x), + INDEX er (er,x), + INDEX p (p) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +insert into t1(es,er) select 0, 1 from seq_1_to_45; +insert into t1(es,er) select 0, 2 from seq_1_to_49; +insert into t1(es,er) select 0, 3 from seq_1_to_951; +insert into t1(es,er) select 0, 3 from seq_1_to_1054; +insert into t1(es,er) select 0, 6 from seq_1_to_25; +insert into t1(es,er) select 0, 11 from seq_1_to_1; +insert into t1(es,er) select 1, 1 from seq_1_to_45; +insert into t1(es,er) select 1, 2 from seq_1_to_16; +insert into t1(es,er) select 1, 3 from seq_1_to_511; +insert into t1(es,er) select 1, 4 from seq_1_to_687; +insert into t1(es,er) select 1, 6 from seq_1_to_50; +insert into t1(es,er) select 1, 7 from seq_1_to_4; +insert into t1(es,er) select 1, 11 from seq_1_to_1; +insert into t1(es,er) select 2, 1 from seq_1_to_82; +insert into t1(es,er) select 2, 2 from seq_1_to_82; +insert into t1(es,er) select 2, 3 from seq_1_to_1626; +insert into t1(es,er) select 2, 4 from seq_1_to_977; +insert into t1(es,er) select 2, 6 from seq_1_to_33; +insert into t1(es,er) select 2, 11 from seq_1_to_1; +insert into t1(es,er) select 3, 1 from seq_1_to_245; +insert into t1(es,er) select 3, 2 from seq_1_to_81; +insert into t1(es,er) select 3, 3 from seq_1_to_852; +insert into t1(es,er) select 3, 4 from seq_1_to_2243; +insert into t1(es,er) select 3, 6 from seq_1_to_44; +insert into t1(es,er) select 3, 11 from seq_1_to_1; +insert into t1(es,er) select 4, 1 from seq_1_to_91; +insert into t1(es,er) select 4, 2 from seq_1_to_83; +insert into t1(es,er) select 4, 3 from seq_1_to_297; +insert into t1(es,er) select 4, 4 from seq_1_to_2456; +insert into t1(es,er) select 4, 6 from seq_1_to_19; +insert into t1(es,er) select 4, 11 from seq_1_to_1; +update t1 set p='foobar'; +update t1 set x=0; +set @save_isp=@@innodb_stats_persistent; +set global innodb_stats_persistent= 1; +analyze table t1; + +let $q= +SELECT * FROM t1 + WHERE ((p = 'foo' AND er != 4) OR er = 4 ) AND (es >= 4) LIMIT 2; + +set optimizer_switch='index_merge_sort_intersection=on'; +eval $q; +--replace_column 9 # +eval EXPLAIN EXTENDED $q; + +set optimizer_switch='index_merge_sort_intersection=off'; +# execution of $q and explain for it led to an assertion failure in 10.4 +# (with the optimizer switch rowid_filter set to 'on') +eval $q; +--replace_column 9 # +eval EXPLAIN EXTENDED $q; + +let $q= +SELECT * FROM t1 + WHERE ((p = 'foo' AND er < 6) OR er >=2 ) AND (es >= 4) LIMIT 2; + +set optimizer_switch='index_merge_sort_intersection=on'; +eval $q; +--replace_column 9 # +eval EXPLAIN EXTENDED $q; + +set optimizer_switch='index_merge_sort_intersection=off'; +eval $q; +--replace_column 9 # +eval EXPLAIN EXTENDED $q; + +set optimizer_switch='index_merge_sort_intersection=default'; + +set global innodb_stats_persistent= @save_isp; +DROP TABLE t1; + +--echo # End of 10.2 tests + +--echo # --echo # MDEV-19634: Assertion `0' failed in row_sel_convert_mysql_key_to_innobase, --echo # [Warning] InnoDB: Using a partial-field key prefix in search --echo # diff --git a/mysql-test/main/range_vs_index_merge.result b/mysql-test/main/range_vs_index_merge.result index 7108fd89a7d..1729b95a105 100644 --- a/mysql-test/main/range_vs_index_merge.result +++ b/mysql-test/main/range_vs_index_merge.result @@ -1810,7 +1810,7 @@ EXPLAIN SELECT * FROM t1 WHERE a BETWEEN 4 AND 5 AND b IN (255,4) OR a IN (2,14,25) OR (a<2 or a>2); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY,idx PRIMARY 0 NULL 2 Using index condition; Using where +1 SIMPLE t1 ALL PRIMARY,idx NULL NULL NULL 2 Using where SELECT * FROM t1 WHERE a BETWEEN 4 AND 5 AND b IN (255,4) OR a IN (2,14,25) OR (a<2 or a>2); a b diff --git a/mysql-test/main/rowid_filter_innodb.result b/mysql-test/main/rowid_filter_innodb.result index 44dd89fa722..49e74d1ba2d 100644 --- a/mysql-test/main/rowid_filter_innodb.result +++ b/mysql-test/main/rowid_filter_innodb.result @@ -2971,3 +2971,48 @@ set optimizer_switch=@save_optimizer_switch; set join_cache_level=@save_join_cache_level; drop table filt, acei, acli; set global innodb_stats_persistent= @stats.save; +# +# MDEV-22846: ref access with full scan on keys with NULLs + rowid_filter +# +set @stats.save= @@innodb_stats_persistent; +set global innodb_stats_persistent=0; +CREATE TABLE t1 (pk int NOT NULL, c1 varchar(1)) engine=innodb; +INSERT INTO t1 VALUES +(1,NULL),(15,'o'),(16,'x'),(19,'t'),(35,'k'),(36,'h'),(42,'t'),(43,'h'), +(53,'l'),(62,'a'),(71,NULL),(79,'u'),(128,'y'),(129,NULL),(133,NULL); +CREATE TABLE t2 ( +i1 int, c1 varchar(1) NOT NULL, KEY c1 (c1), KEY i1 (i1) +) engine=innodb; +INSERT INTO t2 VALUES +(1,'1'),(NULL,'1'),(42,'t'),(NULL,'1'),(79,'u'),(NULL,'1'), +(NULL,'4'),(NULL,'4'),(NULL,'1'),(NULL,'u'),(2,'1'),(NULL,'w'); +INSERT INTO t2 SELECT * FROM t2; +SELECT * FROM t1 +WHERE t1.c1 NOT IN (SELECT t2.c1 FROM t2, t1 AS a1 +WHERE t2.i1 = t1.pk AND t2.i1 IS NOT NULL); +pk c1 +15 o +16 x +19 t +35 k +36 h +43 h +53 l +62 a +71 NULL +128 y +129 NULL +133 NULL +EXPLAIN EXTENDED SELECT * FROM t1 +WHERE t1.c1 NOT IN (SELECT t2.c1 FROM t2, t1 AS a1 +WHERE t2.i1 = t1.pk AND t2.i1 IS NOT NULL); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 15 100.00 Using where +2 DEPENDENT SUBQUERY t2 ref|filter c1,i1 c1|i1 3|5 func 6 (33%) 33.33 Using where; Full scan on NULL key; Using rowid filter +2 DEPENDENT SUBQUERY a1 ALL NULL NULL NULL NULL 15 100.00 Using join buffer (flat, BNL join) +Warnings: +Note 1276 Field or reference 'test.t1.pk' of SELECT #2 was resolved in SELECT #1 +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1` AS `c1` from `test`.`t1` where !<expr_cache><`test`.`t1`.`c1`,`test`.`t1`.`pk`>(<in_optimizer>(`test`.`t1`.`c1`,<exists>(/* select#2 */ select `test`.`t2`.`c1` from `test`.`t2` join `test`.`t1` `a1` where `test`.`t2`.`i1` = `test`.`t1`.`pk` and `test`.`t2`.`i1` is not null and trigcond(<cache>(`test`.`t1`.`c1`) = `test`.`t2`.`c1`)))) +DROP TABLE t1,t2; +set global innodb_stats_persistent= @stats.save; +# End of 10.4 tests diff --git a/mysql-test/main/rowid_filter_innodb.test b/mysql-test/main/rowid_filter_innodb.test index bc5518eba8d..97b9aa0102c 100644 --- a/mysql-test/main/rowid_filter_innodb.test +++ b/mysql-test/main/rowid_filter_innodb.test @@ -540,3 +540,37 @@ set join_cache_level=@save_join_cache_level; drop table filt, acei, acli; set global innodb_stats_persistent= @stats.save; + +--echo # +--echo # MDEV-22846: ref access with full scan on keys with NULLs + rowid_filter +--echo # + +set @stats.save= @@innodb_stats_persistent; +set global innodb_stats_persistent=0; + +CREATE TABLE t1 (pk int NOT NULL, c1 varchar(1)) engine=innodb; +INSERT INTO t1 VALUES +(1,NULL),(15,'o'),(16,'x'),(19,'t'),(35,'k'),(36,'h'),(42,'t'),(43,'h'), +(53,'l'),(62,'a'),(71,NULL),(79,'u'),(128,'y'),(129,NULL),(133,NULL); + +CREATE TABLE t2 ( +i1 int, c1 varchar(1) NOT NULL, KEY c1 (c1), KEY i1 (i1) +) engine=innodb; +INSERT INTO t2 VALUES +(1,'1'),(NULL,'1'),(42,'t'),(NULL,'1'),(79,'u'),(NULL,'1'), +(NULL,'4'),(NULL,'4'),(NULL,'1'),(NULL,'u'),(2,'1'),(NULL,'w'); +INSERT INTO t2 SELECT * FROM t2; + +let $q= +SELECT * FROM t1 +WHERE t1.c1 NOT IN (SELECT t2.c1 FROM t2, t1 AS a1 + WHERE t2.i1 = t1.pk AND t2.i1 IS NOT NULL); + +eval $q; +eval EXPLAIN EXTENDED $q; + +DROP TABLE t1,t2; + +set global innodb_stats_persistent= @stats.save; + +--echo # End of 10.4 tests diff --git a/mysql-test/main/show.result b/mysql-test/main/show.result index d1b373d8969..4a9e2738346 100644 --- a/mysql-test/main/show.result +++ b/mysql-test/main/show.result @@ -40,5 +40,16 @@ nm varchar(32) YES NULL a int(11) YES NULL drop table t1; # +# MDEV-4621 select returns null for information_schema.statistics.collation field +# +create table t1 (f varchar(64), key(f)); +select index_name, column_name, collation, cardinality from information_schema.STATISTICS where table_schema='test' and table_name='t1'; +index_name column_name collation cardinality +f f A NULL +select index_name, column_name, collation from information_schema.STATISTICS where table_schema='test' and table_name='t1'; +index_name column_name collation +f f A +drop table t1; +# # End of 10.2 tests # diff --git a/mysql-test/main/show.test b/mysql-test/main/show.test index f2f6efc4e45..9b0b58349d5 100644 --- a/mysql-test/main/show.test +++ b/mysql-test/main/show.test @@ -35,5 +35,13 @@ show fields from test.t1 where field in drop table t1; --echo # +--echo # MDEV-4621 select returns null for information_schema.statistics.collation field +--echo # +create table t1 (f varchar(64), key(f)); +select index_name, column_name, collation, cardinality from information_schema.STATISTICS where table_schema='test' and table_name='t1'; +select index_name, column_name, collation from information_schema.STATISTICS where table_schema='test' and table_name='t1'; +drop table t1; + +--echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/main/show_check.result b/mysql-test/main/show_check.result index f07c19261d0..cc50587cbc1 100644 --- a/mysql-test/main/show_check.result +++ b/mysql-test/main/show_check.result @@ -63,20 +63,20 @@ Table Op Msg_type Msg_text test.t1 check status OK show index from t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema STATISTICS STATISTICS TABLE_NAME Table 253 64 2 N 1 0 8 -def information_schema STATISTICS STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63 -def information_schema STATISTICS STATISTICS INDEX_NAME Key_name 253 64 7 N 1 0 8 -def information_schema STATISTICS STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63 -def information_schema STATISTICS STATISTICS COLUMN_NAME Column_name 253 64 1 N 1 0 8 -def information_schema STATISTICS STATISTICS COLLATION Collation 253 1 1 Y 0 0 8 -def information_schema STATISTICS STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63 -def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 0 Y 32768 0 63 -def information_schema STATISTICS STATISTICS PACKED Packed 253 10 0 Y 0 0 8 -def information_schema STATISTICS STATISTICS NULLABLE Null 253 3 0 N 1 0 8 -def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 16 5 N 1 0 8 -def information_schema STATISTICS STATISTICS COMMENT Comment 253 16 0 Y 0 0 8 -def information_schema STATISTICS STATISTICS INDEX_COMMENT Index_comment 253 1024 0 N 1 0 8 -def information_schema STATISTICS STATISTICS IGNORED Ignored 253 3 2 N 1 0 8 +def information_schema STATISTICS STATISTICS TABLE_NAME Table 253 64 2 N 4097 0 8 +def information_schema STATISTICS STATISTICS NON_UNIQUE Non_unique 8 1 1 N 36865 0 63 +def information_schema STATISTICS STATISTICS INDEX_NAME Key_name 253 64 7 N 4097 0 8 +def information_schema STATISTICS STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 36865 0 63 +def information_schema STATISTICS STATISTICS COLUMN_NAME Column_name 253 64 1 N 4097 0 8 +def information_schema STATISTICS STATISTICS COLLATION Collation 253 1 1 Y 4096 0 8 +def information_schema STATISTICS STATISTICS CARDINALITY Cardinality 8 21 1 Y 36864 0 63 +def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 0 Y 36864 0 63 +def information_schema STATISTICS STATISTICS PACKED Packed 253 10 0 Y 4096 0 8 +def information_schema STATISTICS STATISTICS NULLABLE Null 253 3 0 N 4097 0 8 +def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 16 5 N 4097 0 8 +def information_schema STATISTICS STATISTICS COMMENT Comment 253 16 0 Y 4096 0 8 +def information_schema STATISTICS STATISTICS INDEX_COMMENT Index_comment 253 1024 0 N 4097 0 8 +def information_schema STATISTICS STATISTICS IGNORED Ignored 253 3 2 N 4097 0 8 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored t1 0 PRIMARY 1 a A 5 NULL NULL BTREE NO t1 1 b 1 b A 1 NULL NULL BTREE NO @@ -103,47 +103,47 @@ drop table t1; -- after Bug#29394 is implemented. show variables like "wait_timeout%"; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8 -def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 253 2048 5 N 1 0 8 +def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 4097 0 8 +def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 253 2048 5 N 4097 0 8 Variable_name Value wait_timeout 28800 show variables like "WAIT_timeout%"; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8 -def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 253 2048 5 N 1 0 8 +def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 4097 0 8 +def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 253 2048 5 N 4097 0 8 Variable_name Value wait_timeout 28800 show variables like "this_doesn't_exists%"; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_NAME Variable_name 253 64 0 N 1 0 8 -def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 253 2048 0 N 1 0 8 +def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_NAME Variable_name 253 64 0 N 4097 0 8 +def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 253 2048 0 N 4097 0 8 Variable_name Value show table status from test like "this_doesn't_exists%"; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema TABLES TABLES TABLE_NAME Name 253 64 0 N 1 0 8 -def information_schema TABLES TABLES ENGINE Engine 253 64 0 Y 0 0 8 -def information_schema TABLES TABLES VERSION Version 8 21 0 Y 32800 0 63 -def information_schema TABLES TABLES ROW_FORMAT Row_format 253 10 0 Y 0 0 8 -def information_schema TABLES TABLES TABLE_ROWS Rows 8 21 0 Y 32800 0 63 -def information_schema TABLES TABLES AVG_ROW_LENGTH Avg_row_length 8 21 0 Y 32800 0 63 -def information_schema TABLES TABLES DATA_LENGTH Data_length 8 21 0 Y 32800 0 63 -def information_schema TABLES TABLES MAX_DATA_LENGTH Max_data_length 8 21 0 Y 32800 0 63 -def information_schema TABLES TABLES INDEX_LENGTH Index_length 8 21 0 Y 32800 0 63 -def information_schema TABLES TABLES DATA_FREE Data_free 8 21 0 Y 32800 0 63 -def information_schema TABLES TABLES AUTO_INCREMENT Auto_increment 8 21 0 Y 32800 0 63 -def information_schema TABLES TABLES CREATE_TIME Create_time 12 19 0 Y 128 0 63 -def information_schema TABLES TABLES UPDATE_TIME Update_time 12 19 0 Y 128 0 63 -def information_schema TABLES TABLES CHECK_TIME Check_time 12 19 0 Y 128 0 63 -def information_schema TABLES TABLES TABLE_COLLATION Collation 253 32 0 Y 0 0 8 -def information_schema TABLES TABLES CHECKSUM Checksum 8 21 0 Y 32800 0 63 -def information_schema TABLES TABLES CREATE_OPTIONS Create_options 253 2048 0 Y 0 0 8 -def information_schema TABLES TABLES TABLE_COMMENT Comment 253 2048 0 N 1 0 8 -def information_schema TABLES TABLES MAX_INDEX_LENGTH Max_index_length 8 21 0 Y 32800 0 63 -def information_schema TABLES TABLES TEMPORARY Temporary 253 1 0 Y 0 0 8 +def information_schema TABLES TABLES TABLE_NAME Name 253 64 0 N 4097 0 8 +def information_schema TABLES TABLES ENGINE Engine 253 64 0 Y 4096 0 8 +def information_schema TABLES TABLES VERSION Version 8 21 0 Y 36896 0 63 +def information_schema TABLES TABLES ROW_FORMAT Row_format 253 10 0 Y 4096 0 8 +def information_schema TABLES TABLES TABLE_ROWS Rows 8 21 0 Y 36896 0 63 +def information_schema TABLES TABLES AVG_ROW_LENGTH Avg_row_length 8 21 0 Y 36896 0 63 +def information_schema TABLES TABLES DATA_LENGTH Data_length 8 21 0 Y 36896 0 63 +def information_schema TABLES TABLES MAX_DATA_LENGTH Max_data_length 8 21 0 Y 36896 0 63 +def information_schema TABLES TABLES INDEX_LENGTH Index_length 8 21 0 Y 36896 0 63 +def information_schema TABLES TABLES DATA_FREE Data_free 8 21 0 Y 36896 0 63 +def information_schema TABLES TABLES AUTO_INCREMENT Auto_increment 8 21 0 Y 36896 0 63 +def information_schema TABLES TABLES CREATE_TIME Create_time 12 19 0 Y 4224 0 63 +def information_schema TABLES TABLES UPDATE_TIME Update_time 12 19 0 Y 4224 0 63 +def information_schema TABLES TABLES CHECK_TIME Check_time 12 19 0 Y 4224 0 63 +def information_schema TABLES TABLES TABLE_COLLATION Collation 253 32 0 Y 4096 0 8 +def information_schema TABLES TABLES CHECKSUM Checksum 8 21 0 Y 36896 0 63 +def information_schema TABLES TABLES CREATE_OPTIONS Create_options 253 2048 0 Y 4096 0 8 +def information_schema TABLES TABLES TABLE_COMMENT Comment 253 2048 0 N 4097 0 8 +def information_schema TABLES TABLES MAX_INDEX_LENGTH Max_index_length 8 21 0 Y 36896 0 63 +def information_schema TABLES TABLES TEMPORARY Temporary 253 1 0 Y 4096 0 8 Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary show databases; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema SCHEMATA SCHEMATA SCHEMA_NAME Database 253 64 18 N 1 0 8 +def information_schema SCHEMATA SCHEMATA SCHEMA_NAME Database 253 64 18 N 4097 0 8 Database information_schema mtr @@ -153,7 +153,7 @@ sys test show databases like "test%"; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema SCHEMATA SCHEMATA SCHEMA_NAME Database (test%) 253 64 4 N 1 0 8 +def information_schema SCHEMATA SCHEMATA SCHEMA_NAME Database (test%) 253 64 4 N 4097 0 8 Database (test%) test create table t1 (f1 int not null, f2 int not null, f3 int not null, f4 int not null, primary key(f1,f2,f3,f4)); @@ -649,20 +649,20 @@ PRIMARY KEY(field1(1000)) ); show index from t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema STATISTICS STATISTICS TABLE_NAME Table 253 64 2 N 1 0 63 -def information_schema STATISTICS STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63 -def information_schema STATISTICS STATISTICS INDEX_NAME Key_name 253 64 7 N 1 0 63 -def information_schema STATISTICS STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63 -def information_schema STATISTICS STATISTICS COLUMN_NAME Column_name 253 64 6 N 1 0 63 -def information_schema STATISTICS STATISTICS COLLATION Collation 253 1 1 Y 0 0 63 -def information_schema STATISTICS STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63 -def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 4 Y 32768 0 63 -def information_schema STATISTICS STATISTICS PACKED Packed 253 10 0 Y 0 0 63 -def information_schema STATISTICS STATISTICS NULLABLE Null 253 3 0 N 1 0 63 -def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 16 5 N 1 0 63 -def information_schema STATISTICS STATISTICS COMMENT Comment 253 16 0 Y 0 0 63 -def information_schema STATISTICS STATISTICS INDEX_COMMENT Index_comment 253 1024 0 N 1 0 63 -def information_schema STATISTICS STATISTICS IGNORED Ignored 253 3 2 N 1 0 63 +def information_schema STATISTICS STATISTICS TABLE_NAME Table 253 64 2 N 4097 0 63 +def information_schema STATISTICS STATISTICS NON_UNIQUE Non_unique 8 1 1 N 36865 0 63 +def information_schema STATISTICS STATISTICS INDEX_NAME Key_name 253 64 7 N 4097 0 63 +def information_schema STATISTICS STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 36865 0 63 +def information_schema STATISTICS STATISTICS COLUMN_NAME Column_name 253 64 6 N 4097 0 63 +def information_schema STATISTICS STATISTICS COLLATION Collation 253 1 1 Y 4096 0 63 +def information_schema STATISTICS STATISTICS CARDINALITY Cardinality 8 21 1 Y 36864 0 63 +def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 4 Y 36864 0 63 +def information_schema STATISTICS STATISTICS PACKED Packed 253 10 0 Y 4096 0 63 +def information_schema STATISTICS STATISTICS NULLABLE Null 253 3 0 N 4097 0 63 +def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 16 5 N 4097 0 63 +def information_schema STATISTICS STATISTICS COMMENT Comment 253 16 0 Y 4096 0 63 +def information_schema STATISTICS STATISTICS INDEX_COMMENT Index_comment 253 1024 0 N 4097 0 63 +def information_schema STATISTICS STATISTICS IGNORED Ignored 253 3 2 N 4097 0 63 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored t1 0 PRIMARY 1 field1 A 0 1000 NULL BTREE NO drop table t1; @@ -877,21 +877,21 @@ set names utf8; ---------------------------------------------------------------- SHOW CHARACTER SET LIKE 'utf8mb3'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema CHARACTER_SETS CHARACTER_SETS CHARACTER_SET_NAME Charset 253 96 7 N 1 0 33 -def information_schema CHARACTER_SETS CHARACTER_SETS DESCRIPTION Description 253 180 13 N 1 0 33 -def information_schema CHARACTER_SETS CHARACTER_SETS DEFAULT_COLLATE_NAME Default collation 253 96 18 N 1 0 33 -def information_schema CHARACTER_SETS CHARACTER_SETS MAXLEN Maxlen 8 3 1 N 32769 0 63 +def information_schema CHARACTER_SETS CHARACTER_SETS CHARACTER_SET_NAME Charset 253 96 7 N 4097 0 33 +def information_schema CHARACTER_SETS CHARACTER_SETS DESCRIPTION Description 253 180 13 N 4097 0 33 +def information_schema CHARACTER_SETS CHARACTER_SETS DEFAULT_COLLATE_NAME Default collation 253 96 18 N 4097 0 33 +def information_schema CHARACTER_SETS CHARACTER_SETS MAXLEN Maxlen 8 3 1 N 36865 0 63 Charset Description Default collation Maxlen utf8mb3 UTF-8 Unicode utf8mb3_general_ci 3 ---------------------------------------------------------------- SHOW COLLATION LIKE 'latin1_bin'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema COLLATIONS COLLATIONS COLLATION_NAME Collation 253 96 10 N 1 0 33 -def information_schema COLLATIONS COLLATIONS CHARACTER_SET_NAME Charset 253 96 6 N 1 0 33 -def information_schema COLLATIONS COLLATIONS ID Id 8 11 2 N 32769 0 63 -def information_schema COLLATIONS COLLATIONS IS_DEFAULT Default 253 9 0 N 1 0 33 -def information_schema COLLATIONS COLLATIONS IS_COMPILED Compiled 253 9 3 N 1 0 33 -def information_schema COLLATIONS COLLATIONS SORTLEN Sortlen 8 3 1 N 32769 0 63 +def information_schema COLLATIONS COLLATIONS COLLATION_NAME Collation 253 96 10 N 4097 0 33 +def information_schema COLLATIONS COLLATIONS CHARACTER_SET_NAME Charset 253 96 6 N 4097 0 33 +def information_schema COLLATIONS COLLATIONS ID Id 8 11 2 N 36865 0 63 +def information_schema COLLATIONS COLLATIONS IS_DEFAULT Default 253 9 0 N 4097 0 33 +def information_schema COLLATIONS COLLATIONS IS_COMPILED Compiled 253 9 3 N 4097 0 33 +def information_schema COLLATIONS COLLATIONS SORTLEN Sortlen 8 3 1 N 36865 0 63 Collation Charset Id Default Compiled Sortlen latin1_bin latin1 47 Yes 1 ---------------------------------------------------------------- @@ -904,7 +904,7 @@ mysqltest1 CREATE DATABASE `mysqltest1` /*!40100 DEFAULT CHARACTER SET latin1 */ ---------------------------------------------------------------- SHOW DATABASES LIKE 'mysqltest1'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema SCHEMATA SCHEMATA SCHEMA_NAME Database (mysqltest1) 253 192 10 N 1 0 33 +def information_schema SCHEMATA SCHEMATA SCHEMA_NAME Database (mysqltest1) 253 192 10 N 4097 0 33 Database (mysqltest1) mysqltest1 ---------------------------------------------------------------- @@ -920,20 +920,20 @@ t1 CREATE TABLE `t1` ( ---------------------------------------------------------------- SHOW INDEX FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema STATISTICS STATISTICS TABLE_NAME Table 253 192 2 N 1 0 33 -def information_schema STATISTICS STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63 -def information_schema STATISTICS STATISTICS INDEX_NAME Key_name 253 192 7 N 1 0 33 -def information_schema STATISTICS STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63 -def information_schema STATISTICS STATISTICS COLUMN_NAME Column_name 253 192 1 N 1 0 33 -def information_schema STATISTICS STATISTICS COLLATION Collation 253 3 1 Y 0 0 33 -def information_schema STATISTICS STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63 -def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 0 Y 32768 0 63 -def information_schema STATISTICS STATISTICS PACKED Packed 253 30 0 Y 0 0 33 -def information_schema STATISTICS STATISTICS NULLABLE Null 253 9 0 N 1 0 33 -def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 48 5 N 1 0 33 -def information_schema STATISTICS STATISTICS COMMENT Comment 253 48 0 Y 0 0 33 -def information_schema STATISTICS STATISTICS INDEX_COMMENT Index_comment 253 3072 0 N 1 0 33 -def information_schema STATISTICS STATISTICS IGNORED Ignored 253 9 2 N 1 0 33 +def information_schema STATISTICS STATISTICS TABLE_NAME Table 253 192 2 N 4097 0 33 +def information_schema STATISTICS STATISTICS NON_UNIQUE Non_unique 8 1 1 N 36865 0 63 +def information_schema STATISTICS STATISTICS INDEX_NAME Key_name 253 192 7 N 4097 0 33 +def information_schema STATISTICS STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 36865 0 63 +def information_schema STATISTICS STATISTICS COLUMN_NAME Column_name 253 192 1 N 4097 0 33 +def information_schema STATISTICS STATISTICS COLLATION Collation 253 3 1 Y 4096 0 33 +def information_schema STATISTICS STATISTICS CARDINALITY Cardinality 8 21 1 Y 36864 0 63 +def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 0 Y 36864 0 63 +def information_schema STATISTICS STATISTICS PACKED Packed 253 30 0 Y 4096 0 33 +def information_schema STATISTICS STATISTICS NULLABLE Null 253 9 0 N 4097 0 33 +def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 48 5 N 4097 0 33 +def information_schema STATISTICS STATISTICS COMMENT Comment 253 48 0 Y 4096 0 33 +def information_schema STATISTICS STATISTICS INDEX_COMMENT Index_comment 253 3072 0 N 4097 0 33 +def information_schema STATISTICS STATISTICS IGNORED Ignored 253 9 2 N 4097 0 33 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored t1 0 PRIMARY 1 c A 0 NULL NULL BTREE NO ---------------------------------------------------------------- @@ -950,15 +950,15 @@ TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't1'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema TABLES TABLES TABLE_CATALOG TABLE_CATALOG 253 1536 3 N 1 0 33 -def information_schema TABLES TABLES TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33 -def information_schema TABLES TABLES TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33 -def information_schema TABLES TABLES TABLE_TYPE TABLE_TYPE 253 192 10 N 1 0 33 -def information_schema TABLES TABLES ENGINE ENGINE 253 192 6 Y 0 0 33 -def information_schema TABLES TABLES ROW_FORMAT ROW_FORMAT 253 30 5 Y 0 0 33 -def information_schema TABLES TABLES TABLE_COLLATION TABLE_COLLATION 253 96 17 Y 0 0 33 -def information_schema TABLES TABLES CREATE_OPTIONS CREATE_OPTIONS 253 6144 0 Y 0 0 33 -def information_schema TABLES TABLES TABLE_COMMENT TABLE_COMMENT 253 6144 0 N 1 0 33 +def information_schema TABLES TABLES TABLE_CATALOG TABLE_CATALOG 253 1536 3 N 4097 0 33 +def information_schema TABLES TABLES TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 4097 0 33 +def information_schema TABLES TABLES TABLE_NAME TABLE_NAME 253 192 2 N 4097 0 33 +def information_schema TABLES TABLES TABLE_TYPE TABLE_TYPE 253 192 10 N 4097 0 33 +def information_schema TABLES TABLES ENGINE ENGINE 253 192 6 Y 4096 0 33 +def information_schema TABLES TABLES ROW_FORMAT ROW_FORMAT 253 30 5 Y 4096 0 33 +def information_schema TABLES TABLES TABLE_COLLATION TABLE_COLLATION 253 96 17 Y 4096 0 33 +def information_schema TABLES TABLES CREATE_OPTIONS CREATE_OPTIONS 253 6144 0 Y 4096 0 33 +def information_schema TABLES TABLES TABLE_COMMENT TABLE_COMMENT 253 6144 0 N 4097 0 33 TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_COLLATION CREATE_OPTIONS TABLE_COMMENT def test t1 BASE TABLE MyISAM Fixed latin1_swedish_ci ---------------------------------------------------------------- @@ -980,53 +980,53 @@ COLUMN_COMMENT FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 't1'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema COLUMNS COLUMNS TABLE_CATALOG TABLE_CATALOG 253 1536 3 N 1 0 33 -def information_schema COLUMNS COLUMNS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33 -def information_schema COLUMNS COLUMNS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33 -def information_schema COLUMNS COLUMNS COLUMN_NAME COLUMN_NAME 253 192 1 N 1 0 33 -def information_schema COLUMNS COLUMNS COLUMN_DEFAULT COLUMN_DEFAULT 252 589788 0 Y 16 0 33 -def information_schema COLUMNS COLUMNS IS_NULLABLE IS_NULLABLE 253 9 2 N 1 0 33 -def information_schema COLUMNS COLUMNS DATA_TYPE DATA_TYPE 253 192 3 N 1 0 33 -def information_schema COLUMNS COLUMNS CHARACTER_SET_NAME CHARACTER_SET_NAME 253 96 0 Y 0 0 33 -def information_schema COLUMNS COLUMNS COLLATION_NAME COLLATION_NAME 253 96 0 Y 0 0 33 -def information_schema COLUMNS COLUMNS COLUMN_TYPE COLUMN_TYPE 252 589815 7 N 17 0 33 -def information_schema COLUMNS COLUMNS COLUMN_KEY COLUMN_KEY 253 9 3 N 1 0 33 -def information_schema COLUMNS COLUMNS EXTRA EXTRA 253 90 0 N 1 0 33 -def information_schema COLUMNS COLUMNS PRIVILEGES PRIVILEGES 253 240 31 N 1 0 33 -def information_schema COLUMNS COLUMNS COLUMN_COMMENT COLUMN_COMMENT 253 3072 0 N 1 0 33 +def information_schema COLUMNS COLUMNS TABLE_CATALOG TABLE_CATALOG 253 1536 3 N 4097 0 33 +def information_schema COLUMNS COLUMNS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 4097 0 33 +def information_schema COLUMNS COLUMNS TABLE_NAME TABLE_NAME 253 192 2 N 4097 0 33 +def information_schema COLUMNS COLUMNS COLUMN_NAME COLUMN_NAME 253 192 1 N 4097 0 33 +def information_schema COLUMNS COLUMNS COLUMN_DEFAULT COLUMN_DEFAULT 252 589788 0 Y 4112 0 33 +def information_schema COLUMNS COLUMNS IS_NULLABLE IS_NULLABLE 253 9 2 N 4097 0 33 +def information_schema COLUMNS COLUMNS DATA_TYPE DATA_TYPE 253 192 3 N 4097 0 33 +def information_schema COLUMNS COLUMNS CHARACTER_SET_NAME CHARACTER_SET_NAME 253 96 0 Y 4096 0 33 +def information_schema COLUMNS COLUMNS COLLATION_NAME COLLATION_NAME 253 96 0 Y 4096 0 33 +def information_schema COLUMNS COLUMNS COLUMN_TYPE COLUMN_TYPE 252 589815 7 N 4113 0 33 +def information_schema COLUMNS COLUMNS COLUMN_KEY COLUMN_KEY 253 9 3 N 4097 0 33 +def information_schema COLUMNS COLUMNS EXTRA EXTRA 253 90 0 N 4097 0 33 +def information_schema COLUMNS COLUMNS PRIVILEGES PRIVILEGES 253 240 31 N 4097 0 33 +def information_schema COLUMNS COLUMNS COLUMN_COMMENT COLUMN_COMMENT 253 3072 0 N 4097 0 33 TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT def test t1 c NULL NO int NULL NULL int(11) PRI select,insert,update,references ---------------------------------------------------------------- SHOW TABLES LIKE 't1'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema TABLE_NAMES TABLE_NAMES TABLE_NAME Tables_in_test (t1) 253 219 2 N 1 0 33 +def information_schema TABLE_NAMES TABLE_NAMES TABLE_NAME Tables_in_test (t1) 253 219 2 N 4097 0 33 Tables_in_test (t1) t1 ---------------------------------------------------------------- SHOW COLUMNS FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema COLUMNS COLUMNS COLUMN_NAME Field 253 192 1 N 1 0 33 -def information_schema COLUMNS COLUMNS COLUMN_TYPE Type 252 589815 7 N 17 0 33 -def information_schema COLUMNS COLUMNS IS_NULLABLE Null 253 9 2 N 1 0 33 -def information_schema COLUMNS COLUMNS COLUMN_KEY Key 253 9 3 N 1 0 33 -def information_schema COLUMNS COLUMNS COLUMN_DEFAULT Default 252 589788 0 Y 16 0 33 -def information_schema COLUMNS COLUMNS EXTRA Extra 253 90 0 N 1 0 33 +def information_schema COLUMNS COLUMNS COLUMN_NAME Field 253 192 1 N 4097 0 33 +def information_schema COLUMNS COLUMNS COLUMN_TYPE Type 252 589815 7 N 4113 0 33 +def information_schema COLUMNS COLUMNS IS_NULLABLE Null 253 9 2 N 4097 0 33 +def information_schema COLUMNS COLUMNS COLUMN_KEY Key 253 9 3 N 4097 0 33 +def information_schema COLUMNS COLUMNS COLUMN_DEFAULT Default 252 589788 0 Y 4112 0 33 +def information_schema COLUMNS COLUMNS EXTRA Extra 253 90 0 N 4097 0 33 Field Type Null Key Default Extra c int(11) NO PRI NULL ---------------------------------------------------------------- SHOW TRIGGERS LIKE 't1'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema TRIGGERS TRIGGERS TRIGGER_NAME Trigger 253 192 5 N 1 0 33 -def information_schema TRIGGERS TRIGGERS EVENT_MANIPULATION Event 253 18 6 N 1 0 33 -def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_TABLE Table 253 192 2 N 1 0 33 -def information_schema TRIGGERS TRIGGERS ACTION_STATEMENT Statement 252 589815 10 N 17 0 33 -def information_schema TRIGGERS TRIGGERS ACTION_TIMING Timing 253 18 6 N 1 0 33 -def information_schema TRIGGERS TRIGGERS CREATED Created 12 22 22 Y 128 2 63 -def information_schema TRIGGERS TRIGGERS SQL_MODE sql_mode 253 24576 89 N 1 0 33 -def information_schema TRIGGERS TRIGGERS DEFINER Definer 253 1152 14 N 1 0 33 -def information_schema TRIGGERS TRIGGERS CHARACTER_SET_CLIENT character_set_client 253 96 6 N 1 0 33 -def information_schema TRIGGERS TRIGGERS COLLATION_CONNECTION collation_connection 253 96 6 N 1 0 33 -def information_schema TRIGGERS TRIGGERS DATABASE_COLLATION Database Collation 253 96 17 N 1 0 33 +def information_schema TRIGGERS TRIGGERS TRIGGER_NAME Trigger 253 192 5 N 4097 0 33 +def information_schema TRIGGERS TRIGGERS EVENT_MANIPULATION Event 253 18 6 N 4097 0 33 +def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_TABLE Table 253 192 2 N 4097 0 33 +def information_schema TRIGGERS TRIGGERS ACTION_STATEMENT Statement 252 589815 10 N 4113 0 33 +def information_schema TRIGGERS TRIGGERS ACTION_TIMING Timing 253 18 6 N 4097 0 33 +def information_schema TRIGGERS TRIGGERS CREATED Created 12 22 22 Y 4224 2 63 +def information_schema TRIGGERS TRIGGERS SQL_MODE sql_mode 253 24576 89 N 4097 0 33 +def information_schema TRIGGERS TRIGGERS DEFINER Definer 253 1152 14 N 4097 0 33 +def information_schema TRIGGERS TRIGGERS CHARACTER_SET_CLIENT character_set_client 253 96 6 N 4097 0 33 +def information_schema TRIGGERS TRIGGERS COLLATION_CONNECTION collation_connection 253 96 6 N 4097 0 33 +def information_schema TRIGGERS TRIGGERS DATABASE_COLLATION Database Collation 253 96 17 N 4097 0 33 Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation t1_bi INSERT t1 SET @a = 1 BEFORE # STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost binary binary latin1_swedish_ci ---------------------------------------------------------------- @@ -1051,28 +1051,28 @@ DEFINER FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 't1_bi'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema TRIGGERS TRIGGERS TRIGGER_CATALOG TRIGGER_CATALOG 253 1536 3 N 1 0 33 -def information_schema TRIGGERS TRIGGERS TRIGGER_SCHEMA TRIGGER_SCHEMA 253 192 4 N 1 0 33 -def information_schema TRIGGERS TRIGGERS TRIGGER_NAME TRIGGER_NAME 253 192 5 N 1 0 33 -def information_schema TRIGGERS TRIGGERS EVENT_MANIPULATION EVENT_MANIPULATION 253 18 6 N 1 0 33 -def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_CATALOG EVENT_OBJECT_CATALOG 253 1536 3 N 1 0 33 -def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_SCHEMA EVENT_OBJECT_SCHEMA 253 192 4 N 1 0 33 -def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_TABLE EVENT_OBJECT_TABLE 253 192 2 N 1 0 33 -def information_schema TRIGGERS TRIGGERS ACTION_CONDITION ACTION_CONDITION 252 589815 0 Y 16 0 33 -def information_schema TRIGGERS TRIGGERS ACTION_STATEMENT ACTION_STATEMENT 252 589815 10 N 17 0 33 -def information_schema TRIGGERS TRIGGERS ACTION_ORIENTATION ACTION_ORIENTATION 253 27 3 N 1 0 33 -def information_schema TRIGGERS TRIGGERS ACTION_TIMING ACTION_TIMING 253 18 6 N 1 0 33 -def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_OLD_TABLE 253 192 0 Y 0 0 33 -def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_NEW_TABLE 253 192 0 Y 0 0 33 -def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_OLD_ROW 253 9 3 N 1 0 33 -def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_ROW ACTION_REFERENCE_NEW_ROW 253 9 3 N 1 0 33 -def information_schema TRIGGERS TRIGGERS SQL_MODE SQL_MODE 253 24576 89 N 1 0 33 -def information_schema TRIGGERS TRIGGERS DEFINER DEFINER 253 1152 14 N 1 0 33 +def information_schema TRIGGERS TRIGGERS TRIGGER_CATALOG TRIGGER_CATALOG 253 1536 3 N 4097 0 33 +def information_schema TRIGGERS TRIGGERS TRIGGER_SCHEMA TRIGGER_SCHEMA 253 192 4 N 4097 0 33 +def information_schema TRIGGERS TRIGGERS TRIGGER_NAME TRIGGER_NAME 253 192 5 N 4097 0 33 +def information_schema TRIGGERS TRIGGERS EVENT_MANIPULATION EVENT_MANIPULATION 253 18 6 N 4097 0 33 +def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_CATALOG EVENT_OBJECT_CATALOG 253 1536 3 N 4097 0 33 +def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_SCHEMA EVENT_OBJECT_SCHEMA 253 192 4 N 4097 0 33 +def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_TABLE EVENT_OBJECT_TABLE 253 192 2 N 4097 0 33 +def information_schema TRIGGERS TRIGGERS ACTION_CONDITION ACTION_CONDITION 252 589815 0 Y 4112 0 33 +def information_schema TRIGGERS TRIGGERS ACTION_STATEMENT ACTION_STATEMENT 252 589815 10 N 4113 0 33 +def information_schema TRIGGERS TRIGGERS ACTION_ORIENTATION ACTION_ORIENTATION 253 27 3 N 4097 0 33 +def information_schema TRIGGERS TRIGGERS ACTION_TIMING ACTION_TIMING 253 18 6 N 4097 0 33 +def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_OLD_TABLE 253 192 0 Y 4096 0 33 +def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_NEW_TABLE 253 192 0 Y 4096 0 33 +def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_OLD_ROW 253 9 3 N 4097 0 33 +def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_ROW ACTION_REFERENCE_NEW_ROW 253 9 3 N 4097 0 33 +def information_schema TRIGGERS TRIGGERS SQL_MODE SQL_MODE 253 24576 89 N 4097 0 33 +def information_schema TRIGGERS TRIGGERS DEFINER DEFINER 253 1152 14 N 4097 0 33 TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW SQL_MODE DEFINER def test t1_bi INSERT def test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost SELECT CREATED FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name='t1_bi'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema TRIGGERS TRIGGERS CREATED CREATED 12 22 22 Y 128 2 63 +def information_schema TRIGGERS TRIGGERS CREATED CREATED 12 22 22 Y 4224 2 63 CREATED # ---------------------------------------------------------------- @@ -1089,17 +1089,17 @@ SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema VIEWS VIEWS TABLE_CATALOG TABLE_CATALOG 253 1536 3 N 1 0 33 -def information_schema VIEWS VIEWS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33 -def information_schema VIEWS VIEWS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33 -def information_schema VIEWS VIEWS VIEW_DEFINITION VIEW_DEFINITION 252 589815 15 N 17 0 33 -def information_schema VIEWS VIEWS CHECK_OPTION CHECK_OPTION 253 24 4 N 1 0 33 -def information_schema VIEWS VIEWS IS_UPDATABLE IS_UPDATABLE 253 9 2 N 1 0 33 -def information_schema VIEWS VIEWS DEFINER DEFINER 253 1152 14 N 1 0 33 -def information_schema VIEWS VIEWS SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33 -def information_schema VIEWS VIEWS CHARACTER_SET_CLIENT CHARACTER_SET_CLIENT 253 96 6 N 1 0 33 -def information_schema VIEWS VIEWS COLLATION_CONNECTION COLLATION_CONNECTION 253 96 6 N 1 0 33 -def information_schema VIEWS VIEWS ALGORITHM ALGORITHM 253 30 9 N 1 0 33 +def information_schema VIEWS VIEWS TABLE_CATALOG TABLE_CATALOG 253 1536 3 N 4097 0 33 +def information_schema VIEWS VIEWS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 4097 0 33 +def information_schema VIEWS VIEWS TABLE_NAME TABLE_NAME 253 192 2 N 4097 0 33 +def information_schema VIEWS VIEWS VIEW_DEFINITION VIEW_DEFINITION 252 589815 15 N 4113 0 33 +def information_schema VIEWS VIEWS CHECK_OPTION CHECK_OPTION 253 24 4 N 4097 0 33 +def information_schema VIEWS VIEWS IS_UPDATABLE IS_UPDATABLE 253 9 2 N 4097 0 33 +def information_schema VIEWS VIEWS DEFINER DEFINER 253 1152 14 N 4097 0 33 +def information_schema VIEWS VIEWS SECURITY_TYPE SECURITY_TYPE 253 21 7 N 4097 0 33 +def information_schema VIEWS VIEWS CHARACTER_SET_CLIENT CHARACTER_SET_CLIENT 253 96 6 N 4097 0 33 +def information_schema VIEWS VIEWS COLLATION_CONNECTION COLLATION_CONNECTION 253 96 6 N 4097 0 33 +def information_schema VIEWS VIEWS ALGORITHM ALGORITHM 253 30 9 N 4097 0 33 TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM def test v1 select 1 AS `1` NONE NO root@localhost DEFINER binary binary UNDEFINED ---------------------------------------------------------------- @@ -1137,24 +1137,24 @@ DEFINER FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema ROUTINES ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 1 0 33 -def information_schema ROUTINES ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 3 N 1 0 33 -def information_schema ROUTINES ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 1 0 33 -def information_schema ROUTINES ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 1 0 33 -def information_schema ROUTINES ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 39 9 N 1 0 33 -def information_schema ROUTINES ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 252 589815 0 Y 16 0 33 -def information_schema ROUTINES ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 1 0 33 -def information_schema ROUTINES ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 16 0 33 -def information_schema ROUTINES ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 0 0 33 -def information_schema ROUTINES ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 0 0 33 -def information_schema ROUTINES ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 1 0 33 -def information_schema ROUTINES ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33 -def information_schema ROUTINES ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33 -def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33 -def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33 -def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 89 N 1 0 33 -def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 252 589815 0 N 17 0 33 -def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 1152 14 N 1 0 33 +def information_schema ROUTINES ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 4097 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 3 N 4097 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 4097 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 4097 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 39 9 N 4097 0 33 +def information_schema ROUTINES ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 252 589815 0 Y 4112 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 4097 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 4112 0 33 +def information_schema ROUTINES ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 4096 0 33 +def information_schema ROUTINES ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 4096 0 33 +def information_schema ROUTINES ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 4097 0 33 +def information_schema ROUTINES ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 4097 0 33 +def information_schema ROUTINES ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 4097 0 33 +def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 4096 0 33 +def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 4097 0 33 +def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 89 N 4097 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 252 589815 0 N 4113 0 33 +def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 1152 14 N 4097 0 33 SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER p1 def test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost ---------------------------------------------------------------- @@ -1192,24 +1192,24 @@ DEFINER FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'f1'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def information_schema ROUTINES ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 1 0 33 -def information_schema ROUTINES ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 3 N 1 0 33 -def information_schema ROUTINES ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 1 0 33 -def information_schema ROUTINES ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 1 0 33 -def information_schema ROUTINES ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 39 8 N 1 0 33 -def information_schema ROUTINES ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 252 589815 7 Y 16 0 33 -def information_schema ROUTINES ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 1 0 33 -def information_schema ROUTINES ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 16 0 33 -def information_schema ROUTINES ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 0 0 33 -def information_schema ROUTINES ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 0 0 33 -def information_schema ROUTINES ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 1 0 33 -def information_schema ROUTINES ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33 -def information_schema ROUTINES ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33 -def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33 -def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33 -def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 89 N 1 0 33 -def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 252 589815 0 N 17 0 33 -def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 1152 14 N 1 0 33 +def information_schema ROUTINES ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 4097 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 3 N 4097 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 4097 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 4097 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 39 8 N 4097 0 33 +def information_schema ROUTINES ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 252 589815 7 Y 4112 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 4097 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 4112 0 33 +def information_schema ROUTINES ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 4096 0 33 +def information_schema ROUTINES ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 4096 0 33 +def information_schema ROUTINES ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 4097 0 33 +def information_schema ROUTINES ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 4097 0 33 +def information_schema ROUTINES ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 4097 0 33 +def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 4096 0 33 +def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 4097 0 33 +def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 89 N 4097 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 252 589815 0 N 4113 0 33 +def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 1152 14 N 4097 0 33 SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER f1 def test f1 FUNCTION int(11) SQL RETURN 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost ---------------------------------------------------------------- diff --git a/mysql-test/main/sp.result b/mysql-test/main/sp.result index 21cc7c7b78f..a7faeaf2f0d 100644 --- a/mysql-test/main/sp.result +++ b/mysql-test/main/sp.result @@ -8478,6 +8478,34 @@ b-c 0 drop procedure p1| drop function f1| +# +# MDEV-24827: MariaDB 10.5.5 crash (sig 11) during a SELECT +# +CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT); +CREATE TABLE t2 (c1 INT PRIMARY KEY, c2 INT, KEY idx_c2(c2)); +INSERT INTO t1 (c1, c2) SELECT seq, seq FROM seq_1_to_10000; +INSERT INTO t2 (c1, c2) SELECT seq, seq FROM seq_1_to_20000; +CREATE OR REPLACE PROCEDURE p1() +begin +DECLARE done INT DEFAULT FALSE; +DECLARE a INT; +DECLARE cur1 CURSOR FOR +SELECT t2.c1 AS c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 +WHERE EXISTS (SELECT 1 FROM t1 WHERE c2 = -1) ORDER BY c1; +DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; +OPEN cur1; +read_loop: LOOP +FETCH cur1 INTO a; +IF done THEN +LEAVE read_loop; +END IF; +END LOOP; +CLOSE cur1; +END $ +CALL p1(); +DROP PROCEDURE p1; +DROP TABLE t1; +DROP TABLE t2; #End of 10.2 tests # # MDEV-12007 Allow ROW variables as a cursor FETCH target diff --git a/mysql-test/main/sp.test b/mysql-test/main/sp.test index 9265b97e7c9..058f42d5e92 100644 --- a/mysql-test/main/sp.test +++ b/mysql-test/main/sp.test @@ -1,4 +1,6 @@ --source include/have_partition.inc +--source include/have_sequence.inc + # # Basic stored PROCEDURE tests # @@ -10031,6 +10033,46 @@ drop procedure p1| drop function f1| delimiter ;| +--echo # +--echo # MDEV-24827: MariaDB 10.5.5 crash (sig 11) during a SELECT +--echo # + +CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT); +CREATE TABLE t2 (c1 INT PRIMARY KEY, c2 INT, KEY idx_c2(c2)); + +INSERT INTO t1 (c1, c2) SELECT seq, seq FROM seq_1_to_10000; +INSERT INTO t2 (c1, c2) SELECT seq, seq FROM seq_1_to_20000; + +--delimiter $ + +CREATE OR REPLACE PROCEDURE p1() +begin + DECLARE done INT DEFAULT FALSE; + DECLARE a INT; + + DECLARE cur1 CURSOR FOR + SELECT t2.c1 AS c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 + WHERE EXISTS (SELECT 1 FROM t1 WHERE c2 = -1) ORDER BY c1; + + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + + OPEN cur1; + read_loop: LOOP + FETCH cur1 INTO a; + IF done THEN + LEAVE read_loop; + END IF; + END LOOP; + CLOSE cur1; +END $ + +--delimiter ; + +CALL p1(); + +DROP PROCEDURE p1; +DROP TABLE t1; +DROP TABLE t2; --echo #End of 10.2 tests diff --git a/mysql-test/main/subselect_sj.result b/mysql-test/main/subselect_sj.result index b4ad66458dc..9fd8186b66c 100644 --- a/mysql-test/main/subselect_sj.result +++ b/mysql-test/main/subselect_sj.result @@ -3318,4 +3318,22 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 2 MATERIALIZED t4 ALL NULL NULL NULL NULL 500 drop table t1, t2, t3, t4; +# +# MDEV-20770: Server crashes in JOIN::transform_in_predicates_into_in_subq +# upon 2nd execution of PS/SP comparing GEOMETRY with other types +# +CREATE TABLE t1 (a GEOMETRY); +CREATE TABLE t2 (b INT); +INSERT INTO t1 VALUES (GeomFromText('POINT(0 0)')),(GeomFromText('POINT(1 1)')); +INSERT INTO t2 VALUES (1),(2); +PREPARE stmt FROM "SELECT * from t1 WHERE a IN (SELECT b FROM t2)"; +EXECUTE stmt; +ERROR HY000: Illegal parameter data types geometry and int for operation '=' +EXECUTE stmt; +ERROR HY000: Illegal parameter data types geometry and int for operation '=' +EXECUTE stmt; +ERROR HY000: Illegal parameter data types geometry and int for operation '=' +EXECUTE stmt; +ERROR HY000: Illegal parameter data types geometry and int for operation '=' +DROP TABLE t1, t2; set optimizer_switch=@subselect_sj_tmp; diff --git a/mysql-test/main/subselect_sj.test b/mysql-test/main/subselect_sj.test index c5c3354bc32..324f2828de2 100644 --- a/mysql-test/main/subselect_sj.test +++ b/mysql-test/main/subselect_sj.test @@ -2995,5 +2995,28 @@ explain select * from t3 where a in (select a from t4); drop table t1, t2, t3, t4; +--echo # +--echo # MDEV-20770: Server crashes in JOIN::transform_in_predicates_into_in_subq +--echo # upon 2nd execution of PS/SP comparing GEOMETRY with other types +--echo # + +CREATE TABLE t1 (a GEOMETRY); +CREATE TABLE t2 (b INT); + +INSERT INTO t1 VALUES (GeomFromText('POINT(0 0)')),(GeomFromText('POINT(1 1)')); +INSERT INTO t2 VALUES (1),(2); + +PREPARE stmt FROM "SELECT * from t1 WHERE a IN (SELECT b FROM t2)"; +--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION +EXECUTE stmt; +--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION +EXECUTE stmt; +--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION +EXECUTE stmt; +--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION +EXECUTE stmt; + +DROP TABLE t1, t2; + # The following command must be the last one the file set optimizer_switch=@subselect_sj_tmp; diff --git a/mysql-test/main/subselect_sj_jcl6.result b/mysql-test/main/subselect_sj_jcl6.result index 2301a03f973..e97c1d5e915 100644 --- a/mysql-test/main/subselect_sj_jcl6.result +++ b/mysql-test/main/subselect_sj_jcl6.result @@ -3329,6 +3329,24 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 2 MATERIALIZED t4 ALL NULL NULL NULL NULL 500 drop table t1, t2, t3, t4; +# +# MDEV-20770: Server crashes in JOIN::transform_in_predicates_into_in_subq +# upon 2nd execution of PS/SP comparing GEOMETRY with other types +# +CREATE TABLE t1 (a GEOMETRY); +CREATE TABLE t2 (b INT); +INSERT INTO t1 VALUES (GeomFromText('POINT(0 0)')),(GeomFromText('POINT(1 1)')); +INSERT INTO t2 VALUES (1),(2); +PREPARE stmt FROM "SELECT * from t1 WHERE a IN (SELECT b FROM t2)"; +EXECUTE stmt; +ERROR HY000: Illegal parameter data types geometry and int for operation '=' +EXECUTE stmt; +ERROR HY000: Illegal parameter data types geometry and int for operation '=' +EXECUTE stmt; +ERROR HY000: Illegal parameter data types geometry and int for operation '=' +EXECUTE stmt; +ERROR HY000: Illegal parameter data types geometry and int for operation '=' +DROP TABLE t1, t2; set optimizer_switch=@subselect_sj_tmp; # # BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off diff --git a/mysql-test/main/thread_pool_info.result b/mysql-test/main/thread_pool_info.result index 53fa1d1255d..d79a4f8d50b 100644 --- a/mysql-test/main/thread_pool_info.result +++ b/mysql-test/main/thread_pool_info.result @@ -1,13 +1,13 @@ DESC INFORMATION_SCHEMA.THREAD_POOL_GROUPS; Field Type Null Key Default Extra -GROUP_ID int(6) NO 0 -CONNECTIONS int(6) NO 0 -THREADS int(6) NO 0 -ACTIVE_THREADS int(6) NO 0 -STANDBY_THREADS int(6) NO 0 -QUEUE_LENGTH int(6) NO 0 -HAS_LISTENER tinyint(1) NO 0 -IS_STALLED tinyint(1) NO 0 +GROUP_ID int(6) NO NULL +CONNECTIONS int(6) NO NULL +THREADS int(6) NO NULL +ACTIVE_THREADS int(6) NO NULL +STANDBY_THREADS int(6) NO NULL +QUEUE_LENGTH int(6) NO NULL +HAS_LISTENER tinyint(1) NO NULL +IS_STALLED tinyint(1) NO NULL SELECT COUNT(*)=@@thread_pool_size FROM INFORMATION_SCHEMA.THREAD_POOL_GROUPS; COUNT(*)=@@thread_pool_size 1 @@ -28,17 +28,17 @@ SUM(IS_STALLED) 0 DESC INFORMATION_SCHEMA.THREAD_POOL_STATS; Field Type Null Key Default Extra -GROUP_ID int(6) NO 0 -THREAD_CREATIONS bigint(19) NO 0 -THREAD_CREATIONS_DUE_TO_STALL bigint(19) NO 0 -WAKES bigint(19) NO 0 -WAKES_DUE_TO_STALL bigint(19) NO 0 -THROTTLES bigint(19) NO 0 -STALLS bigint(19) NO 0 -POLLS_BY_LISTENER bigint(19) NO 0 -POLLS_BY_WORKER bigint(19) NO 0 -DEQUEUES_BY_LISTENER bigint(19) NO 0 -DEQUEUES_BY_WORKER bigint(19) NO 0 +GROUP_ID int(6) NO NULL +THREAD_CREATIONS bigint(19) NO NULL +THREAD_CREATIONS_DUE_TO_STALL bigint(19) NO NULL +WAKES bigint(19) NO NULL +WAKES_DUE_TO_STALL bigint(19) NO NULL +THROTTLES bigint(19) NO NULL +STALLS bigint(19) NO NULL +POLLS_BY_LISTENER bigint(19) NO NULL +POLLS_BY_WORKER bigint(19) NO NULL +DEQUEUES_BY_LISTENER bigint(19) NO NULL +DEQUEUES_BY_WORKER bigint(19) NO NULL SELECT SUM(DEQUEUES_BY_LISTENER+DEQUEUES_BY_WORKER) > 0 FROM INFORMATION_SCHEMA.THREAD_POOL_STATS; SUM(DEQUEUES_BY_LISTENER+DEQUEUES_BY_WORKER) > 0 1 @@ -57,8 +57,8 @@ SUM(POLLS_BY_WORKER) 0 DESC INFORMATION_SCHEMA.THREAD_POOL_WAITS; Field Type Null Key Default Extra -REASON varchar(16) NO -COUNT bigint(19) NO 0 +REASON varchar(16) NO NULL +COUNT bigint(19) NO NULL SELECT REASON FROM INFORMATION_SCHEMA.THREAD_POOL_WAITS; REASON UNKNOWN @@ -85,11 +85,11 @@ COUNT FLUSH THREAD_POOL_WAITS; DESC INFORMATION_SCHEMA.THREAD_POOL_QUEUES; Field Type Null Key Default Extra -GROUP_ID int(6) NO 0 -POSITION int(6) NO 0 -PRIORITY int(1) NO 0 +GROUP_ID int(6) NO NULL +POSITION int(6) NO NULL +PRIORITY int(1) NO NULL CONNECTION_ID bigint(19) unsigned YES NULL -QUEUEING_TIME_MICROSECONDS bigint(19) NO 0 +QUEUEING_TIME_MICROSECONDS bigint(19) NO NULL # restart: with restart_parameters connect con1, localhost, root,,test; connection con1; diff --git a/mysql-test/main/trigger-compat.result b/mysql-test/main/trigger-compat.result index 387d4fb1489..cb2970890f1 100644 --- a/mysql-test/main/trigger-compat.result +++ b/mysql-test/main/trigger-compat.result @@ -142,3 +142,298 @@ DROP TRIGGER tr12; DROP TRIGGER tr11; DROP TABLE t1; DROP TABLE t2; +# +# MDEV-25659 trigger name is empty after upgrade to 10.4 +# +# START: Total triggers 1, broken triggers 1, DROP TABLE +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +FLUSH TABLES; +DELETE FROM t1 WHERE a=1; +ERROR 42000: Trigger 'tr1' has an error in its body: 'Undeclared variable: unknown_variable' +INSERT INTO t1 VALUES (2); +ERROR 42000: Trigger 'tr1' has an error in its body: 'Undeclared variable: unknown_variable' +SET time_zone='+00:00'; +SHOW TRIGGERS LIKE 't1'; +Trigger tr1 +Event DELETE +Table t1 +Statement CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW +BEGIN + IF unknown_variable + THEN + INSERT INTO t2 VALUES (OLD.a); + END IF; +END +Timing AFTER +Created 2022-01-13 08:23:06.47 +sql_mode STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION +Definer +character_set_client utf8mb3 +collation_connection utf8mb3_general_ci +Database Collation latin1_swedish_ci +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='tr1'; +TRIGGER_CATALOG def +TRIGGER_SCHEMA test +TRIGGER_NAME tr1 +EVENT_MANIPULATION DELETE +EVENT_OBJECT_CATALOG def +EVENT_OBJECT_SCHEMA test +EVENT_OBJECT_TABLE t1 +ACTION_ORDER 1 +ACTION_CONDITION NULL +ACTION_STATEMENT CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW +BEGIN + IF unknown_variable + THEN + INSERT INTO t2 VALUES (OLD.a); + END IF; +END +ACTION_ORIENTATION ROW +ACTION_TIMING AFTER +ACTION_REFERENCE_OLD_TABLE NULL +ACTION_REFERENCE_NEW_TABLE NULL +ACTION_REFERENCE_OLD_ROW OLD +ACTION_REFERENCE_NEW_ROW NEW +CREATED 2022-01-13 08:23:06.47 +SQL_MODE STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION +DEFINER +CHARACTER_SET_CLIENT utf8mb3 +COLLATION_CONNECTION utf8mb3_general_ci +DATABASE_COLLATION latin1_swedish_ci +SET time_zone=DEFAULT; +# Listing trigger files +t1.TRG +tr1.TRN +# Listing trigger files done +DROP TABLE t1; +# Listing trigger files +# Listing trigger files done +# END: Total triggers 1, broken triggers 1, DROP TABLE +# START: Total triggers 1, broken triggers 1, DROP TRIGGER +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +FLUSH TABLES; +DELETE FROM t1 WHERE a=1; +ERROR 42000: Trigger 'tr1' has an error in its body: 'Undeclared variable: unknown_variable' +INSERT INTO t1 VALUES (2); +ERROR 42000: Trigger 'tr1' has an error in its body: 'Undeclared variable: unknown_variable' +SET time_zone='+00:00'; +SHOW TRIGGERS LIKE 't1'; +Trigger tr1 +Event DELETE +Table t1 +Statement CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW +BEGIN + IF unknown_variable + THEN + INSERT INTO t2 VALUES (OLD.a); + END IF; +END +Timing AFTER +Created 2022-01-13 08:23:06.47 +sql_mode STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION +Definer +character_set_client utf8mb3 +collation_connection utf8mb3_general_ci +Database Collation latin1_swedish_ci +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='tr1'; +TRIGGER_CATALOG def +TRIGGER_SCHEMA test +TRIGGER_NAME tr1 +EVENT_MANIPULATION DELETE +EVENT_OBJECT_CATALOG def +EVENT_OBJECT_SCHEMA test +EVENT_OBJECT_TABLE t1 +ACTION_ORDER 1 +ACTION_CONDITION NULL +ACTION_STATEMENT CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW +BEGIN + IF unknown_variable + THEN + INSERT INTO t2 VALUES (OLD.a); + END IF; +END +ACTION_ORIENTATION ROW +ACTION_TIMING AFTER +ACTION_REFERENCE_OLD_TABLE NULL +ACTION_REFERENCE_NEW_TABLE NULL +ACTION_REFERENCE_OLD_ROW OLD +ACTION_REFERENCE_NEW_ROW NEW +CREATED 2022-01-13 08:23:06.47 +SQL_MODE STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION +DEFINER +CHARACTER_SET_CLIENT utf8mb3 +COLLATION_CONNECTION utf8mb3_general_ci +DATABASE_COLLATION latin1_swedish_ci +SET time_zone=DEFAULT; +# Listing trigger files +t1.TRG +tr1.TRN +# Listing trigger files done +DROP TRIGGER tr1; +# Listing trigger files +# Listing trigger files done +DROP TABLE t1; +# END: Total triggers 1, broken triggers 1, DROP TRIGGER +# START: Total triggers 2, broken triggers 1, DROP TABLE +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +FLUSH TABLES; +DELETE FROM t1 WHERE a=1; +ERROR 42000: Trigger 'tr1' has an error in its body: 'Undeclared variable: unknown_variable' +INSERT INTO t1 VALUES (2); +ERROR 42000: Trigger 'tr1' has an error in its body: 'Undeclared variable: unknown_variable' +SET time_zone='+00:00'; +SHOW TRIGGERS LIKE 't1'; +Trigger tr2 +Event INSERT +Table t1 +Statement INSERT INTO t2 VALUES (NEW.a+100) +Timing AFTER +Created 2022-01-13 10:01:48.74 +sql_mode STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION +Definer root@localhost +character_set_client utf8mb3 +collation_connection utf8mb3_general_ci +Database Collation latin1_swedish_ci +Trigger tr1 +Event DELETE +Table t1 +Statement CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW +BEGIN + IF unknown_variable + THEN + INSERT INTO t2 VALUES (OLD.a); + END IF; +END +Timing AFTER +Created 2022-01-13 10:01:48.73 +sql_mode STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION +Definer +character_set_client utf8mb3 +collation_connection utf8mb3_general_ci +Database Collation latin1_swedish_ci +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='tr1'; +TRIGGER_CATALOG def +TRIGGER_SCHEMA test +TRIGGER_NAME tr1 +EVENT_MANIPULATION DELETE +EVENT_OBJECT_CATALOG def +EVENT_OBJECT_SCHEMA test +EVENT_OBJECT_TABLE t1 +ACTION_ORDER 1 +ACTION_CONDITION NULL +ACTION_STATEMENT CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW +BEGIN + IF unknown_variable + THEN + INSERT INTO t2 VALUES (OLD.a); + END IF; +END +ACTION_ORIENTATION ROW +ACTION_TIMING AFTER +ACTION_REFERENCE_OLD_TABLE NULL +ACTION_REFERENCE_NEW_TABLE NULL +ACTION_REFERENCE_OLD_ROW OLD +ACTION_REFERENCE_NEW_ROW NEW +CREATED 2022-01-13 10:01:48.73 +SQL_MODE STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION +DEFINER +CHARACTER_SET_CLIENT utf8mb3 +COLLATION_CONNECTION utf8mb3_general_ci +DATABASE_COLLATION latin1_swedish_ci +SET time_zone=DEFAULT; +# Listing trigger files +t1.TRG +tr1.TRN +tr2.TRN +# Listing trigger files done +DROP TABLE t1; +# Listing trigger files +# Listing trigger files done +# END: Total triggers 2, broken triggers 1, using DROP TABLE +# START: Total triggers 2, broken triggers 1, DROP TRIGGER +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +FLUSH TABLES; +DELETE FROM t1 WHERE a=1; +ERROR 42000: Trigger 'tr1' has an error in its body: 'Undeclared variable: unknown_variable' +INSERT INTO t1 VALUES (2); +ERROR 42000: Trigger 'tr1' has an error in its body: 'Undeclared variable: unknown_variable' +SET time_zone='+00:00'; +SHOW TRIGGERS LIKE 't1'; +Trigger tr2 +Event INSERT +Table t1 +Statement INSERT INTO t2 VALUES (NEW.a+100) +Timing AFTER +Created 2022-01-13 10:01:48.74 +sql_mode STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION +Definer root@localhost +character_set_client utf8mb3 +collation_connection utf8mb3_general_ci +Database Collation latin1_swedish_ci +Trigger tr1 +Event DELETE +Table t1 +Statement CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW +BEGIN + IF unknown_variable + THEN + INSERT INTO t2 VALUES (OLD.a); + END IF; +END +Timing AFTER +Created 2022-01-13 10:01:48.73 +sql_mode STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION +Definer +character_set_client utf8mb3 +collation_connection utf8mb3_general_ci +Database Collation latin1_swedish_ci +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='tr1'; +TRIGGER_CATALOG def +TRIGGER_SCHEMA test +TRIGGER_NAME tr1 +EVENT_MANIPULATION DELETE +EVENT_OBJECT_CATALOG def +EVENT_OBJECT_SCHEMA test +EVENT_OBJECT_TABLE t1 +ACTION_ORDER 1 +ACTION_CONDITION NULL +ACTION_STATEMENT CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW +BEGIN + IF unknown_variable + THEN + INSERT INTO t2 VALUES (OLD.a); + END IF; +END +ACTION_ORIENTATION ROW +ACTION_TIMING AFTER +ACTION_REFERENCE_OLD_TABLE NULL +ACTION_REFERENCE_NEW_TABLE NULL +ACTION_REFERENCE_OLD_ROW OLD +ACTION_REFERENCE_NEW_ROW NEW +CREATED 2022-01-13 10:01:48.73 +SQL_MODE STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION +DEFINER +CHARACTER_SET_CLIENT utf8mb3 +COLLATION_CONNECTION utf8mb3_general_ci +DATABASE_COLLATION latin1_swedish_ci +SET time_zone=DEFAULT; +# Listing trigger files +t1.TRG +tr1.TRN +tr2.TRN +# Listing trigger files done +DROP TRIGGER tr1; +# Listing trigger files +t1.TRG +tr2.TRN +# Listing trigger files done +INSERT INTO t1 VALUES (100); +ERROR 42S02: Table 'test.t2' doesn't exist +DROP TABLE t1; +# Listing trigger files +# Listing trigger files done +# END: Total triggers 2, broken triggers 1, using DROP TRIGGER diff --git a/mysql-test/main/trigger-compat.test b/mysql-test/main/trigger-compat.test index baf3cad11d6..4d9160c7728 100644 --- a/mysql-test/main/trigger-compat.test +++ b/mysql-test/main/trigger-compat.test @@ -289,3 +289,219 @@ DROP TRIGGER tr11; DROP TABLE t1; DROP TABLE t2; + + +--echo # +--echo # MDEV-25659 trigger name is empty after upgrade to 10.4 +--echo # + +--echo # START: Total triggers 1, broken triggers 1, DROP TABLE + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); + +--write_file $MYSQLD_DATADIR/test/tr1.TRN +TYPE=TRIGGERNAME +trigger_table=t1 +EOF + +--write_file $MYSQLD_DATADIR/test/t1.TRG +TYPE=TRIGGERS +triggers='CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW\nBEGIN\n IF unknown_variable\n THEN\n INSERT INTO t2 VALUES (OLD.a);\n END IF;\nEND' +sql_modes=1411383296 +definers='root@localhost' +client_cs_names='utf8' +connection_cl_names='utf8_general_ci' +db_cl_names='latin1_swedish_ci' +created=164206218647 +EOF + +FLUSH TABLES; +--error ER_PARSE_ERROR +DELETE FROM t1 WHERE a=1; +--error ER_PARSE_ERROR +INSERT INTO t1 VALUES (2); + +SET time_zone='+00:00'; +--vertical_results +SHOW TRIGGERS LIKE 't1'; +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='tr1'; +--horizontal_results +SET time_zone=DEFAULT; + +--echo # Listing trigger files +--list_files $MYSQLD_DATADIR/test *.TR? +--echo # Listing trigger files done + +DROP TABLE t1; + +--echo # Listing trigger files +--list_files $MYSQLD_DATADIR/test *.TR? +--echo # Listing trigger files done + +--echo # END: Total triggers 1, broken triggers 1, DROP TABLE + + +--echo # START: Total triggers 1, broken triggers 1, DROP TRIGGER + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); + +--write_file $MYSQLD_DATADIR/test/tr1.TRN +TYPE=TRIGGERNAME +trigger_table=t1 +EOF + +--write_file $MYSQLD_DATADIR/test/t1.TRG +TYPE=TRIGGERS +triggers='CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW\nBEGIN\n IF unknown_variable\n THEN\n INSERT INTO t2 VALUES (OLD.a);\n END IF;\nEND' +sql_modes=1411383296 +definers='root@localhost' +client_cs_names='utf8' +connection_cl_names='utf8_general_ci' +db_cl_names='latin1_swedish_ci' +created=164206218647 +EOF + +FLUSH TABLES; +--error ER_PARSE_ERROR +DELETE FROM t1 WHERE a=1; +--error ER_PARSE_ERROR +INSERT INTO t1 VALUES (2); + +SET time_zone='+00:00'; +--vertical_results +SHOW TRIGGERS LIKE 't1'; +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='tr1'; +--horizontal_results +SET time_zone=DEFAULT; + +--echo # Listing trigger files +--list_files $MYSQLD_DATADIR/test *.TR? +--echo # Listing trigger files done + +DROP TRIGGER tr1; + +--echo # Listing trigger files +--list_files $MYSQLD_DATADIR/test *.TR? +--echo # Listing trigger files done + +DROP TABLE t1; + +--echo # END: Total triggers 1, broken triggers 1, DROP TRIGGER + + +--echo # START: Total triggers 2, broken triggers 1, DROP TABLE + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); + +--write_file $MYSQLD_DATADIR/test/tr1.TRN +TYPE=TRIGGERNAME +trigger_table=t1 +EOF + +--write_file $MYSQLD_DATADIR/test/tr2.TRN +TYPE=TRIGGERNAME +trigger_table=t1 +EOF + +--write_file $MYSQLD_DATADIR/test/t1.TRG +TYPE=TRIGGERS +triggers='CREATE DEFINER=`root`@`localhost` TRIGGER tr2 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (NEW.a+100)' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW\nBEGIN\n IF unknown_variable\n THEN\n INSERT INTO t2 VALUES (OLD.a);\n END IF;\nEND' +sql_modes=1411383296 1411383296 +definers='root@localhost' 'root@localhost' +client_cs_names='utf8' 'utf8' +connection_cl_names='utf8_general_ci' 'utf8_general_ci' +db_cl_names='latin1_swedish_ci' 'latin1_swedish_ci' +created=164206810874 164206810873 +EOF + +FLUSH TABLES; +--error ER_PARSE_ERROR +DELETE FROM t1 WHERE a=1; +--error ER_PARSE_ERROR +INSERT INTO t1 VALUES (2); + +SET time_zone='+00:00'; +--vertical_results +SHOW TRIGGERS LIKE 't1'; +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='tr1'; +--horizontal_results +SET time_zone=DEFAULT; + +--echo # Listing trigger files +--list_files $MYSQLD_DATADIR/test *.TR? +--echo # Listing trigger files done + +DROP TABLE t1; + +--echo # Listing trigger files +--list_files $MYSQLD_DATADIR/test *.TR? +--echo # Listing trigger files done + +--echo # END: Total triggers 2, broken triggers 1, using DROP TABLE + + +--echo # START: Total triggers 2, broken triggers 1, DROP TRIGGER + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); + +--write_file $MYSQLD_DATADIR/test/tr1.TRN +TYPE=TRIGGERNAME +trigger_table=t1 +EOF + +--write_file $MYSQLD_DATADIR/test/tr2.TRN +TYPE=TRIGGERNAME +trigger_table=t1 +EOF + +--write_file $MYSQLD_DATADIR/test/t1.TRG +TYPE=TRIGGERS +triggers='CREATE DEFINER=`root`@`localhost` TRIGGER tr2 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (NEW.a+100)' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW\nBEGIN\n IF unknown_variable\n THEN\n INSERT INTO t2 VALUES (OLD.a);\n END IF;\nEND' +sql_modes=1411383296 1411383296 +definers='root@localhost' 'root@localhost' +client_cs_names='utf8' 'utf8' +connection_cl_names='utf8_general_ci' 'utf8_general_ci' +db_cl_names='latin1_swedish_ci' 'latin1_swedish_ci' +created=164206810874 164206810873 +EOF + +FLUSH TABLES; +--error ER_PARSE_ERROR +DELETE FROM t1 WHERE a=1; +--error ER_PARSE_ERROR +INSERT INTO t1 VALUES (2); + +SET time_zone='+00:00'; +--vertical_results +SHOW TRIGGERS LIKE 't1'; +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='tr1'; +--horizontal_results +SET time_zone=DEFAULT; + +--echo # Listing trigger files +--list_files $MYSQLD_DATADIR/test *.TR? +--echo # Listing trigger files done + +DROP TRIGGER tr1; + +--echo # Listing trigger files +--list_files $MYSQLD_DATADIR/test *.TR? +--echo # Listing trigger files done + +# Now we dropped the broken trigger. Make sure the good one is fired. +# If everything goes as expected, it will try to insert into t2, +# which does not exists, hence the (expected) error. +--error ER_NO_SUCH_TABLE +INSERT INTO t1 VALUES (100); + +DROP TABLE t1; + +--echo # Listing trigger files +--list_files $MYSQLD_DATADIR/test *.TR? +--echo # Listing trigger files done + +--echo # END: Total triggers 2, broken triggers 1, using DROP TRIGGER diff --git a/mysql-test/main/trigger.result b/mysql-test/main/trigger.result index 8065f7f5ac4..f031dec2e1a 100644 --- a/mysql-test/main/trigger.result +++ b/mysql-test/main/trigger.result @@ -2431,6 +2431,13 @@ CREATE TRIGGER t1_trigger BEFORE INSERT ON t1 FOR EACH ROW BEGIN END; INSERT INTO t1 () VALUES (); DROP TABLE t1; # +# Bug#33141958 - THE FIRST ASAN UAF ISSUE OF MYSQL SERVER +# +create table t1 (a int); +create trigger tr1 after insert on t1 for each row alter table t1 tablespace s2; +ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger +drop table t1; +# # End of 10.2 tests # # diff --git a/mysql-test/main/trigger.test b/mysql-test/main/trigger.test index 42b690a8921..ef89f86590c 100644 --- a/mysql-test/main/trigger.test +++ b/mysql-test/main/trigger.test @@ -2763,6 +2763,14 @@ INSERT INTO t1 () VALUES (); DROP TABLE t1; --echo # +--echo # Bug#33141958 - THE FIRST ASAN UAF ISSUE OF MYSQL SERVER +--echo # +create table t1 (a int); +--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG +create trigger tr1 after insert on t1 for each row alter table t1 tablespace s2; +drop table t1; + +--echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/main/type_enum.result b/mysql-test/main/type_enum.result index d8b558c7ce0..9b251fb414b 100644 --- a/mysql-test/main/type_enum.result +++ b/mysql-test/main/type_enum.result @@ -2219,6 +2219,27 @@ a DROP TABLE t1; # +# MDEV-26129 Bad results with join comparing case insensitive VARCHAR/ENUM/SET expression to a _bin ENUM column +# +CREATE TABLE t1 (a ENUM('a') CHARACTER SET latin1 PRIMARY KEY); +INSERT INTO t1 VALUES ('a'); +CREATE TABLE t2 (a ENUM('a','A','b','B','c','C','d','D','e','E') CHARACTER SET latin1 COLLATE latin1_bin); +INSERT INTO t2 VALUES ('a'),('A'); +INSERT INTO t2 VALUES ('b'),('B'),('c'),('C'),('d'),('D'),('e'),('E'); +ALTER TABLE t2 ADD PRIMARY KEY(a); +SELECT t1.a res FROM t1 JOIN t2 ON t1.a COLLATE latin1_swedish_ci=t2.a; +res +a +a +SELECT t1.a res FROM t1 LEFT JOIN t2 ON t1.a COLLATE latin1_swedish_ci=t2.a; +res +a +a +DROP TABLE IF EXISTS t1,t2; +# +# End of 10.2. tests +# +# # Start of 10.3 tests # # diff --git a/mysql-test/main/type_enum.test b/mysql-test/main/type_enum.test index a36d63f8725..6ff3e257feb 100644 --- a/mysql-test/main/type_enum.test +++ b/mysql-test/main/type_enum.test @@ -458,6 +458,26 @@ SELECT * FROM t1; DROP TABLE t1; --echo # +--echo # MDEV-26129 Bad results with join comparing case insensitive VARCHAR/ENUM/SET expression to a _bin ENUM column +--echo # + +CREATE TABLE t1 (a ENUM('a') CHARACTER SET latin1 PRIMARY KEY); +INSERT INTO t1 VALUES ('a'); +CREATE TABLE t2 (a ENUM('a','A','b','B','c','C','d','D','e','E') CHARACTER SET latin1 COLLATE latin1_bin); +INSERT INTO t2 VALUES ('a'),('A'); +# without the following insert the bug doesn't show, was fixed in MDEV-6978 +INSERT INTO t2 VALUES ('b'),('B'),('c'),('C'),('d'),('D'),('e'),('E'); +ALTER TABLE t2 ADD PRIMARY KEY(a); +SELECT t1.a res FROM t1 JOIN t2 ON t1.a COLLATE latin1_swedish_ci=t2.a; +SELECT t1.a res FROM t1 LEFT JOIN t2 ON t1.a COLLATE latin1_swedish_ci=t2.a; +DROP TABLE IF EXISTS t1,t2; + + +--echo # +--echo # End of 10.2. tests +--echo # + +--echo # --echo # Start of 10.3 tests --echo # diff --git a/mysql-test/main/type_json.result b/mysql-test/main/type_json.result index dfe4699b361..92be74fb2f4 100644 --- a/mysql-test/main/type_json.result +++ b/mysql-test/main/type_json.result @@ -126,5 +126,38 @@ def JSON_COMPACT('{}') 253 (format=json) 6 0 Y 0 0 33 js0 JSON_COMPACT(js0) JSON_COMPACT('{}') DROP TABLE t1; # +# MDEV-27361 Hybrid functions with JSON arguments do not send format metadata +# +CREATE TABLE t1 (a JSON); +INSERT INTO t1 VALUES ('{"a":"b"}'); +SELECT a, JSON_COMPACT(a), COALESCE(a) FROM t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 a a 252 (format=json) 4294967295 9 Y 144 0 33 +def JSON_COMPACT(a) 251 (format=json) 4294967295 9 Y 128 0 33 +def COALESCE(a) 251 (format=json) 4294967295 9 Y 128 39 33 +a JSON_COMPACT(a) COALESCE(a) +{"a":"b"} {"a":"b"} {"a":"b"} +SELECT JSON_ARRAYAGG(1), JSON_ARRAYAGG(a) FROM t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def JSON_ARRAYAGG(1) 252 (format=json) 9437184 3 Y 0 0 33 +def JSON_ARRAYAGG(a) 252 (format=json) 12582912 11 Y 128 0 33 +JSON_ARRAYAGG(1) JSON_ARRAYAGG(a) +[1] [{"a":"b"}] +SELECT JSON_OBJECTAGG('a','b'), JSON_OBJECTAGG('a',a) FROM t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def JSON_OBJECTAGG('a','b') 252 (format=json) 9437184 9 Y 0 0 33 +def JSON_OBJECTAGG('a',a) 252 (format=json) 12582912 15 Y 128 0 33 +JSON_OBJECTAGG('a','b') JSON_OBJECTAGG('a',a) +{"a":"b"} {"a":{"a":"b"}} +DROP TABLE t1; +# +# MDEV-27018 IF and COALESCE lose "json" property +# +SELECT json_object('a', (SELECT json_objectagg(b, c) FROM (SELECT 'b','c') d)) AS j FROM DUAL; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def j 250 (format=json) 9437283 16 Y 0 39 33 +j +{"a": {"b":"c"}} +# # End of 10.5 tests # diff --git a/mysql-test/main/type_json.test b/mysql-test/main/type_json.test index 7ab0af20e03..bc8716161ac 100644 --- a/mysql-test/main/type_json.test +++ b/mysql-test/main/type_json.test @@ -88,6 +88,34 @@ SELECT js0, JSON_COMPACT(js0), JSON_COMPACT('{}') FROM t1; --enable_ps_protocol DROP TABLE t1; + +--echo # +--echo # MDEV-27361 Hybrid functions with JSON arguments do not send format metadata +--echo # + +CREATE TABLE t1 (a JSON); +INSERT INTO t1 VALUES ('{"a":"b"}'); +--disable_ps_protocol +--enable_metadata +SELECT a, JSON_COMPACT(a), COALESCE(a) FROM t1; +SELECT JSON_ARRAYAGG(1), JSON_ARRAYAGG(a) FROM t1; +SELECT JSON_OBJECTAGG('a','b'), JSON_OBJECTAGG('a',a) FROM t1; +--disable_metadata +--disable_ps_protocol +DROP TABLE t1; + + +--echo # +--echo # MDEV-27018 IF and COALESCE lose "json" property +--echo # + +--disable_ps_protocol +--enable_metadata +SELECT json_object('a', (SELECT json_objectagg(b, c) FROM (SELECT 'b','c') d)) AS j FROM DUAL; +--disable_metadata +--disable_ps_protocol + + --echo # --echo # End of 10.5 tests --echo # diff --git a/mysql-test/main/userstat.result b/mysql-test/main/userstat.result index 9152f602304..5315317e33a 100644 --- a/mysql-test/main/userstat.result +++ b/mysql-test/main/userstat.result @@ -3,71 +3,71 @@ Warnings: Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead show columns from information_schema.client_statistics; Field Type Null Key Default Extra -CLIENT varchar(64) NO -TOTAL_CONNECTIONS bigint(21) NO 0 -CONCURRENT_CONNECTIONS bigint(21) NO 0 -CONNECTED_TIME bigint(21) NO 0 -BUSY_TIME double NO 0 -CPU_TIME double NO 0 -BYTES_RECEIVED bigint(21) NO 0 -BYTES_SENT bigint(21) NO 0 -BINLOG_BYTES_WRITTEN bigint(21) NO 0 -ROWS_READ bigint(21) NO 0 -ROWS_SENT bigint(21) NO 0 -ROWS_DELETED bigint(21) NO 0 -ROWS_INSERTED bigint(21) NO 0 -ROWS_UPDATED bigint(21) NO 0 -SELECT_COMMANDS bigint(21) NO 0 -UPDATE_COMMANDS bigint(21) NO 0 -OTHER_COMMANDS bigint(21) NO 0 -COMMIT_TRANSACTIONS bigint(21) NO 0 -ROLLBACK_TRANSACTIONS bigint(21) NO 0 -DENIED_CONNECTIONS bigint(21) NO 0 -LOST_CONNECTIONS bigint(21) NO 0 -ACCESS_DENIED bigint(21) NO 0 -EMPTY_QUERIES bigint(21) NO 0 -TOTAL_SSL_CONNECTIONS bigint(21) unsigned NO 0 -MAX_STATEMENT_TIME_EXCEEDED bigint(21) NO 0 +CLIENT varchar(64) NO NULL +TOTAL_CONNECTIONS bigint(21) NO NULL +CONCURRENT_CONNECTIONS bigint(21) NO NULL +CONNECTED_TIME bigint(21) NO NULL +BUSY_TIME double NO NULL +CPU_TIME double NO NULL +BYTES_RECEIVED bigint(21) NO NULL +BYTES_SENT bigint(21) NO NULL +BINLOG_BYTES_WRITTEN bigint(21) NO NULL +ROWS_READ bigint(21) NO NULL +ROWS_SENT bigint(21) NO NULL +ROWS_DELETED bigint(21) NO NULL +ROWS_INSERTED bigint(21) NO NULL +ROWS_UPDATED bigint(21) NO NULL +SELECT_COMMANDS bigint(21) NO NULL +UPDATE_COMMANDS bigint(21) NO NULL +OTHER_COMMANDS bigint(21) NO NULL +COMMIT_TRANSACTIONS bigint(21) NO NULL +ROLLBACK_TRANSACTIONS bigint(21) NO NULL +DENIED_CONNECTIONS bigint(21) NO NULL +LOST_CONNECTIONS bigint(21) NO NULL +ACCESS_DENIED bigint(21) NO NULL +EMPTY_QUERIES bigint(21) NO NULL +TOTAL_SSL_CONNECTIONS bigint(21) unsigned NO NULL +MAX_STATEMENT_TIME_EXCEEDED bigint(21) NO NULL show columns from information_schema.user_statistics; Field Type Null Key Default Extra -USER varchar(128) NO -TOTAL_CONNECTIONS int(11) NO 0 -CONCURRENT_CONNECTIONS int(11) NO 0 -CONNECTED_TIME int(11) NO 0 -BUSY_TIME double NO 0 -CPU_TIME double NO 0 -BYTES_RECEIVED bigint(21) NO 0 -BYTES_SENT bigint(21) NO 0 -BINLOG_BYTES_WRITTEN bigint(21) NO 0 -ROWS_READ bigint(21) NO 0 -ROWS_SENT bigint(21) NO 0 -ROWS_DELETED bigint(21) NO 0 -ROWS_INSERTED bigint(21) NO 0 -ROWS_UPDATED bigint(21) NO 0 -SELECT_COMMANDS bigint(21) NO 0 -UPDATE_COMMANDS bigint(21) NO 0 -OTHER_COMMANDS bigint(21) NO 0 -COMMIT_TRANSACTIONS bigint(21) NO 0 -ROLLBACK_TRANSACTIONS bigint(21) NO 0 -DENIED_CONNECTIONS bigint(21) NO 0 -LOST_CONNECTIONS bigint(21) NO 0 -ACCESS_DENIED bigint(21) NO 0 -EMPTY_QUERIES bigint(21) NO 0 -TOTAL_SSL_CONNECTIONS bigint(21) unsigned NO 0 -MAX_STATEMENT_TIME_EXCEEDED bigint(21) NO 0 +USER varchar(128) NO NULL +TOTAL_CONNECTIONS int(11) NO NULL +CONCURRENT_CONNECTIONS int(11) NO NULL +CONNECTED_TIME int(11) NO NULL +BUSY_TIME double NO NULL +CPU_TIME double NO NULL +BYTES_RECEIVED bigint(21) NO NULL +BYTES_SENT bigint(21) NO NULL +BINLOG_BYTES_WRITTEN bigint(21) NO NULL +ROWS_READ bigint(21) NO NULL +ROWS_SENT bigint(21) NO NULL +ROWS_DELETED bigint(21) NO NULL +ROWS_INSERTED bigint(21) NO NULL +ROWS_UPDATED bigint(21) NO NULL +SELECT_COMMANDS bigint(21) NO NULL +UPDATE_COMMANDS bigint(21) NO NULL +OTHER_COMMANDS bigint(21) NO NULL +COMMIT_TRANSACTIONS bigint(21) NO NULL +ROLLBACK_TRANSACTIONS bigint(21) NO NULL +DENIED_CONNECTIONS bigint(21) NO NULL +LOST_CONNECTIONS bigint(21) NO NULL +ACCESS_DENIED bigint(21) NO NULL +EMPTY_QUERIES bigint(21) NO NULL +TOTAL_SSL_CONNECTIONS bigint(21) unsigned NO NULL +MAX_STATEMENT_TIME_EXCEEDED bigint(21) NO NULL show columns from information_schema.index_statistics; Field Type Null Key Default Extra -TABLE_SCHEMA varchar(192) NO -TABLE_NAME varchar(192) NO -INDEX_NAME varchar(192) NO -ROWS_READ bigint(21) NO 0 +TABLE_SCHEMA varchar(192) NO NULL +TABLE_NAME varchar(192) NO NULL +INDEX_NAME varchar(192) NO NULL +ROWS_READ bigint(21) NO NULL show columns from information_schema.table_statistics; Field Type Null Key Default Extra -TABLE_SCHEMA varchar(192) NO -TABLE_NAME varchar(192) NO -ROWS_READ bigint(21) NO 0 -ROWS_CHANGED bigint(21) NO 0 -ROWS_CHANGED_X_INDEXES bigint(21) NO 0 +TABLE_SCHEMA varchar(192) NO NULL +TABLE_NAME varchar(192) NO NULL +ROWS_READ bigint(21) NO NULL +ROWS_CHANGED bigint(21) NO NULL +ROWS_CHANGED_X_INDEXES bigint(21) NO NULL set @save_general_log=@@global.general_log; set @@global.general_log=0; set @@global.userstat=1; diff --git a/mysql-test/main/view.result b/mysql-test/main/view.result index 44f475ede84..27c091a71d1 100644 --- a/mysql-test/main/view.result +++ b/mysql-test/main/view.result @@ -6792,49 +6792,6 @@ sum(z) DROP TABLE t1; DROP VIEW v1; # -# MDEV-24454: Crash at change_item_tree -# -CREATE TABLE t1(f0 INT); -CREATE VIEW v1 AS -SELECT -f0 AS f1 -FROM t1; -CREATE VIEW v2 AS -SELECT -(SELECT GROUP_CONCAT(v1.f1 SEPARATOR ', ') -FROM v1 n) AS f2, -GROUP_CONCAT('' SEPARATOR ', ') AS f3 -FROM v1; -CREATE VIEW v3 AS -SELECT 1 as f4 FROM v2; -CREATE PROCEDURE p1() -SELECT * FROM v3; -CALL p1(); -f4 -1 -CALL p1(); -f4 -1 -drop procedure p1; -drop view v1,v2,v3; -drop table t1; -# -# MDEV-25631: Crash in st_select_lex::mark_as_dependent with -# VIEW, aggregate and subquery -# -CREATE TABLE t1 (i1 int); -insert into t1 values (1),(2),(3); -CREATE VIEW v1 AS -SELECT t1.i1 FROM (t1 a JOIN t1 ON (t1.i1 = (SELECT t1.i1 FROM t1 b))); -SELECT 1 FROM (SELECT count(((SELECT i1 FROM v1))) FROM v1) dt ; -ERROR 21000: Subquery returns more than 1 row -delete from t1 where i1 > 1; -SELECT 1 FROM (SELECT count(((SELECT i1 FROM v1))) FROM v1) dt ; -1 -1 -drop view v1; -drop table t1; -# # MDEV-26299: Some views force server (and mysqldump) to generate # invalid SQL for their definitions # @@ -6846,6 +6803,24 @@ drop view v1; CREATE VIEW v1 AS select `t1`.`12345678901234567890123456789012345678901234567890123456789012345` AS `Name_exp_1` from (select '12345678901234567890123456789012345678901234567890123456789012345') `t1`; drop view v1; # +# MDEV-25631: view with outer reference in select used +# as argument of set function +# +create table t1 (c int); +insert into t1 values (1); +create view v1 as select c from t1 where (select t1.c from t1 t) = 1; +select * from (select sum((select * from v1)) as r) dt; +r +1 +with cte as (select c from t1 where (select t1.c from t1 t) = 1) +select * from (select sum((select * from cte)) as r) dt1 +union +select * from (select sum((select * from cte)) as r) dt2; +r +1 +drop view v1; +drop table t1; +# # End of 10.2 tests # # diff --git a/mysql-test/main/view.test b/mysql-test/main/view.test index 4bc688efa3d..1b09bb146f4 100644 --- a/mysql-test/main/view.test +++ b/mysql-test/main/view.test @@ -6512,56 +6512,6 @@ DROP TABLE t1; DROP VIEW v1; --echo # ---echo # MDEV-24454: Crash at change_item_tree ---echo # - -CREATE TABLE t1(f0 INT); - -CREATE VIEW v1 AS -SELECT - f0 AS f1 -FROM t1; - -CREATE VIEW v2 AS -SELECT - (SELECT GROUP_CONCAT(v1.f1 SEPARATOR ', ') - FROM v1 n) AS f2, - GROUP_CONCAT('' SEPARATOR ', ') AS f3 -FROM v1; - -CREATE VIEW v3 AS -SELECT 1 as f4 FROM v2; - -CREATE PROCEDURE p1() - SELECT * FROM v3; - -CALL p1(); -CALL p1(); - -drop procedure p1; -drop view v1,v2,v3; -drop table t1; - ---echo # ---echo # MDEV-25631: Crash in st_select_lex::mark_as_dependent with ---echo # VIEW, aggregate and subquery ---echo # - -CREATE TABLE t1 (i1 int); -insert into t1 values (1),(2),(3); #not important -CREATE VIEW v1 AS - SELECT t1.i1 FROM (t1 a JOIN t1 ON (t1.i1 = (SELECT t1.i1 FROM t1 b))); - ---error ER_SUBQUERY_NO_1_ROW -SELECT 1 FROM (SELECT count(((SELECT i1 FROM v1))) FROM v1) dt ; -delete from t1 where i1 > 1; -SELECT 1 FROM (SELECT count(((SELECT i1 FROM v1))) FROM v1) dt ; - -drop view v1; -drop table t1; - - ---echo # --echo # MDEV-26299: Some views force server (and mysqldump) to generate --echo # invalid SQL for their definitions --echo # @@ -6577,9 +6527,29 @@ drop view v1; eval CREATE VIEW v1 AS $definition; + drop view v1; --echo # +--echo # MDEV-25631: view with outer reference in select used +--echo # as argument of set function +--echo # + +create table t1 (c int); +insert into t1 values (1); +create view v1 as select c from t1 where (select t1.c from t1 t) = 1; + +select * from (select sum((select * from v1)) as r) dt; + +with cte as (select c from t1 where (select t1.c from t1 t) = 1) +select * from (select sum((select * from cte)) as r) dt1 +union +select * from (select sum((select * from cte)) as r) dt2; + +drop view v1; +drop table t1; + +--echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/mariadb-test-run.pl b/mysql-test/mariadb-test-run.pl index bf2d6e9be00..62a70caca40 100755 --- a/mysql-test/mariadb-test-run.pl +++ b/mysql-test/mariadb-test-run.pl @@ -1844,7 +1844,7 @@ sub executable_setup () { $exe_mysql_plugin= mtr_exe_exists("$path_client_bindir/mysql_plugin"); $exe_mariadb_conv= mtr_exe_exists("$path_client_bindir/mariadb-conv"); - $exe_mysql_embedded= mtr_exe_maybe_exists("$basedir/libmysqld/examples/mysql_embedded"); + $exe_mysql_embedded= mtr_exe_maybe_exists("$bindir/libmysqld/examples/mysql_embedded"); # Look for mysqltest executable if ( $opt_embedded_server ) diff --git a/mysql-test/suite/binlog/include/mysqlbinlog_row_engine.inc b/mysql-test/suite/binlog/include/mysqlbinlog_row_engine.inc index 763029c32ff..e0987b97c05 100644 --- a/mysql-test/suite/binlog/include/mysqlbinlog_row_engine.inc +++ b/mysql-test/suite/binlog/include/mysqlbinlog_row_engine.inc @@ -1921,3 +1921,28 @@ let $MYSQLD_DATADIR= `select @@datadir`; DROP TABLE t1; +--echo # +--echo # Beginning of 10.2 test +--echo # +--echo # MDEV-25460: Assertion `!is_set() || (m_status == DA_OK_BULK && +--echo # is_bulk_op())' failed in Diagnostics_area::set_ok_status in my_ok +--echo # from mysql_sql_stmt_prepare +--echo # + +CREATE TEMPORARY TABLE a (c INT) ENGINE=InnoDB; +CREATE TABLE b (c INT) ENGINE=InnoDB; + +--error ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR +PREPARE s FROM 'SET STATEMENT binlog_format=ROW FOR SELECT * FROM b'; + +DROP TABLE b; +DROP TEMPORARY TABLE a; + +CREATE TEMPORARY TABLE t (c INT); +--error ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR +PREPARE s FROM 'SET STATEMENT binlog_format=ROW FOR SELECT 1'; +DROP TEMPORARY TABLE t; + +--echo # +--echo # End of 10.2 test +--echo # diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result index 8cc020311b9..5db32763533 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result @@ -6374,4 +6374,24 @@ ROLLBACK /* added by mysqlbinlog */; # Cleanup. # DROP TABLE t1; +# +# Beginning of 10.2 test +# +# MDEV-25460: Assertion `!is_set() || (m_status == DA_OK_BULK && +# is_bulk_op())' failed in Diagnostics_area::set_ok_status in my_ok +# from mysql_sql_stmt_prepare +# +CREATE TEMPORARY TABLE a (c INT) ENGINE=InnoDB; +CREATE TABLE b (c INT) ENGINE=InnoDB; +PREPARE s FROM 'SET STATEMENT binlog_format=ROW FOR SELECT * FROM b'; +ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables +DROP TABLE b; +DROP TEMPORARY TABLE a; +CREATE TEMPORARY TABLE t (c INT); +PREPARE s FROM 'SET STATEMENT binlog_format=ROW FOR SELECT 1'; +ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables +DROP TEMPORARY TABLE t; +# +# End of 10.2 test +# SET GLOBAL innodb_stats_auto_recalc=@save_stats_auto_recalc; diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result index 854d733bd99..62dcca4d7a2 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result @@ -6413,3 +6413,29 @@ ROLLBACK /* added by mysqlbinlog */; # Cleanup. # DROP TABLE t1; +# +# Beginning of 10.2 test +# +# MDEV-25460: Assertion `!is_set() || (m_status == DA_OK_BULK && +# is_bulk_op())' failed in Diagnostics_area::set_ok_status in my_ok +# from mysql_sql_stmt_prepare +# +CREATE TEMPORARY TABLE a (c INT) ENGINE=InnoDB; +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1266 Using storage engine MyISAM for table 'a' +CREATE TABLE b (c INT) ENGINE=InnoDB; +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1266 Using storage engine MyISAM for table 'b' +PREPARE s FROM 'SET STATEMENT binlog_format=ROW FOR SELECT * FROM b'; +ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables +DROP TABLE b; +DROP TEMPORARY TABLE a; +CREATE TEMPORARY TABLE t (c INT); +PREPARE s FROM 'SET STATEMENT binlog_format=ROW FOR SELECT 1'; +ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables +DROP TEMPORARY TABLE t; +# +# End of 10.2 test +# diff --git a/mysql-test/suite/binlog/r/binlog_parallel_replication_ddl.result b/mysql-test/suite/binlog/r/binlog_parallel_replication_ddl.result new file mode 100644 index 00000000000..34d8bbf5999 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_parallel_replication_ddl.result @@ -0,0 +1,8 @@ +RESET MASTER; +CREATE OR REPLACE SEQUENCE s1; +DROP SEQUENCE s1; +FLUSH LOGS; +FOUND 2 /GTID [0-9]+-[0-9]+-[0-9]+/ in mysqlbinlog.sql +The same as above number of samples must be found: +FOUND 2 /GTID [0-9]+-[0-9]+-[0-9]+ ddl/ in mysqlbinlog.sql +End of the tests diff --git a/mysql-test/suite/binlog/r/binlog_xa_handling.result b/mysql-test/suite/binlog/r/binlog_xa_handling.result new file mode 100644 index 00000000000..7a60fb59b9a --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_xa_handling.result @@ -0,0 +1,11 @@ +connection default; +CREATE TABLE t1(f1 int) ENGINE=Innodb; +XA START 'xa'; +INSERT INTO t1 VALUES(10); +BINLOG ' +SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8='; +XA END 'xa'; +XA PREPARE 'xa'; +XA ROLLBACK 'xa'; +DROP TABLE t1; diff --git a/mysql-test/suite/binlog/t/binlog_parallel_replication_ddl.test b/mysql-test/suite/binlog/t/binlog_parallel_replication_ddl.test new file mode 100644 index 00000000000..d861ecc96df --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_parallel_replication_ddl.test @@ -0,0 +1,30 @@ +# Check binlog properties of various DDL:s. +# Motivated by MDEV-27365. +# +--source include/have_log_bin.inc +--source include/have_binlog_format_mixed.inc + +RESET MASTER; + +# MDEV-27365 CREATE-or-REPLACE SEQUENCE bilogged without DDL flag +# Prove it is logged with the DDL flag. +CREATE OR REPLACE SEQUENCE s1; + +# This one has been always correct. +DROP SEQUENCE s1; +FLUSH LOGS; + +--let $MYSQLD_DATADIR= `select @@datadir` +--exec $MYSQL_BINLOG --base64-output=decode-rows $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql + +--let SEARCH_PATTERN= GTID [0-9]+-[0-9]+-[0-9]+ +--let SEARCH_FILE= $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql +--source include/search_pattern_in_file.inc + +--echo The same as above number of samples must be found: +--let SEARCH_PATTERN= GTID [0-9]+-[0-9]+-[0-9]+ ddl +--let SEARCH_FILE= $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql +--source include/search_pattern_in_file.inc +--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql + +--echo End of the tests diff --git a/mysql-test/suite/binlog/t/binlog_xa_handling.test b/mysql-test/suite/binlog/t/binlog_xa_handling.test new file mode 100644 index 00000000000..c454e83169e --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_xa_handling.test @@ -0,0 +1,28 @@ +############################################################################### +# Bug#19928622: ASSERTION `! IS_SET()' FAILED. | ABORT IN +# DIAGNOSTICS_AREA::SET_OK_STATUS +# +# MDEV-27536 Invalid BINLOG_BASE64_EVENT and assertion Diagnostics_area:: !is_set() +# +# Test: +# ===== +# Begin an XA transaction and execte a DML statement so that XA state becomes +# XA_ACTIVE. Execute the BINLOG command it should not cause any assert. +# Execution should be successful. +############################################################################### +--source include/have_log_bin.inc +--source include/have_innodb.inc + +--connection default +CREATE TABLE t1(f1 int) ENGINE=Innodb; + +XA START 'xa'; +INSERT INTO t1 VALUES(10); +BINLOG ' +SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8='; +XA END 'xa'; +XA PREPARE 'xa'; +XA ROLLBACK 'xa'; + +DROP TABLE t1; diff --git a/mysql-test/suite/federated/optimizer.result b/mysql-test/suite/federated/optimizer.result new file mode 100644 index 00000000000..5d7072e0b35 --- /dev/null +++ b/mysql-test/suite/federated/optimizer.result @@ -0,0 +1,52 @@ +connect master,127.0.0.1,root,,test,$MASTER_MYPORT,; +connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,; +connection master; +CREATE DATABASE federated; +connection slave; +CREATE DATABASE federated; +connection default; +# +# MDEV-14907 FEDERATEDX doesn't respect DISTINCT +# +CREATE TABLE t1 ( +`foo_id` bigint(20) unsigned NOT NULL, +`foo_name` varchar(255) DEFAULT NULL, +`parent_foo_id` bigint(20) unsigned DEFAULT NULL, +PRIMARY KEY (`foo_id`), +KEY `foo_name` (`foo_name`), +KEY `parent_foo_id` (`parent_foo_id`) +) DEFAULT CHARSET=utf8; +CREATE TABLE `fed_t1` ENGINE=FEDERATED DEFAULT CHARSET=utf8 CONNECTION='mysql://root@127.0.0.1:MASTER_PORT/test/t1'; +INSERT INTO t1 VALUES (968903, 'STRING - 0', 822857); +INSERT INTO t1 VALUES (968953, 'STRING - 1', 822857); +INSERT INTO t1 VALUES (971603, 'STRING - 2', 822857); +INSERT INTO t1 VALUES (971803, 'STRING - 3', 822857); +INSERT INTO t1 VALUES (975103, 'STRING - 4', 822857); +INSERT INTO t1 VALUES (822857, 'STRING', NULL); +select foo_id,parent_foo_id,foo_name from t1 where parent_foo_id = 822857 or foo_name like 'STRING%'; +foo_id parent_foo_id foo_name +968903 822857 STRING - 0 +968953 822857 STRING - 1 +971603 822857 STRING - 2 +971803 822857 STRING - 3 +975103 822857 STRING - 4 +822857 NULL STRING +explain +select foo_id,parent_foo_id,foo_name from fed_t1 where parent_foo_id = 822857 or foo_name like 'STRING%'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE fed_t1 ALL foo_name,parent_foo_id NULL NULL NULL 6 Using where +select foo_id,parent_foo_id,foo_name from fed_t1 where parent_foo_id = 822857 or foo_name like 'STRING%'; +foo_id parent_foo_id foo_name +968903 822857 STRING - 0 +968953 822857 STRING - 1 +971603 822857 STRING - 2 +971803 822857 STRING - 3 +975103 822857 STRING - 4 +822857 NULL STRING +DROP TABLE fed_t1, t1; +connection master; +DROP TABLE IF EXISTS federated.t1; +DROP DATABASE IF EXISTS federated; +connection slave; +DROP TABLE IF EXISTS federated.t1; +DROP DATABASE IF EXISTS federated; diff --git a/mysql-test/suite/federated/optimizer.test b/mysql-test/suite/federated/optimizer.test new file mode 100644 index 00000000000..4263060fab5 --- /dev/null +++ b/mysql-test/suite/federated/optimizer.test @@ -0,0 +1,39 @@ +# +#Test optimizer flags related to federated tables +# + +--source have_federatedx.inc +--source include/federated.inc + +connection default; + +--echo # +--echo # MDEV-14907 FEDERATEDX doesn't respect DISTINCT +--echo # + +CREATE TABLE t1 ( + `foo_id` bigint(20) unsigned NOT NULL, + `foo_name` varchar(255) DEFAULT NULL, + `parent_foo_id` bigint(20) unsigned DEFAULT NULL, + PRIMARY KEY (`foo_id`), + KEY `foo_name` (`foo_name`), + KEY `parent_foo_id` (`parent_foo_id`) +) DEFAULT CHARSET=utf8; + +--replace_result $MASTER_MYPORT MASTER_PORT +eval CREATE TABLE `fed_t1` ENGINE=FEDERATED DEFAULT CHARSET=utf8 CONNECTION='mysql://root@127.0.0.1:$MASTER_MYPORT/test/t1'; +INSERT INTO t1 VALUES (968903, 'STRING - 0', 822857); +INSERT INTO t1 VALUES (968953, 'STRING - 1', 822857); +INSERT INTO t1 VALUES (971603, 'STRING - 2', 822857); +INSERT INTO t1 VALUES (971803, 'STRING - 3', 822857); +INSERT INTO t1 VALUES (975103, 'STRING - 4', 822857); +INSERT INTO t1 VALUES (822857, 'STRING', NULL); + +select foo_id,parent_foo_id,foo_name from t1 where parent_foo_id = 822857 or foo_name like 'STRING%'; + +explain +select foo_id,parent_foo_id,foo_name from fed_t1 where parent_foo_id = 822857 or foo_name like 'STRING%'; +select foo_id,parent_foo_id,foo_name from fed_t1 where parent_foo_id = 822857 or foo_name like 'STRING%'; +DROP TABLE fed_t1, t1; + +source include/federated_cleanup.inc; diff --git a/mysql-test/suite/federated/rpl.result b/mysql-test/suite/federated/rpl.result new file mode 100644 index 00000000000..71821411c91 --- /dev/null +++ b/mysql-test/suite/federated/rpl.result @@ -0,0 +1,18 @@ +include/master-slave.inc +[connection master] +create table t1 (a int primary key, b int); +connection slave; +rename table t1 to t2; +create table t1 (a int primary key, b int) engine=federated connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t2'; +connection master; +insert t1 values (1,1),(2,2),(3,1); +delete from t1 where a=2; +connection slave; +select * from t1; +a b +1 1 +3 1 +drop table t2; +connection master; +drop table t1; +include/rpl_end.inc diff --git a/mysql-test/suite/federated/rpl.test b/mysql-test/suite/federated/rpl.test new file mode 100644 index 00000000000..6ec4bec5a1a --- /dev/null +++ b/mysql-test/suite/federated/rpl.test @@ -0,0 +1,19 @@ +source include/have_binlog_format_row.inc; +source include/master-slave.inc; + +create table t1 (a int primary key, b int); + +sync_slave_with_master; +rename table t1 to t2; +evalp create table t1 (a int primary key, b int) engine=federated connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t2'; +connection master; + +insert t1 values (1,1),(2,2),(3,1); +delete from t1 where a=2; +sync_slave_with_master; +select * from t1; +drop table t2; + +connection master; +drop table t1; +source include/rpl_end.inc; diff --git a/mysql-test/suite/funcs_1/datadict/columns.inc b/mysql-test/suite/funcs_1/datadict/columns.inc index 64318492b00..a03fef9c0dd 100644 --- a/mysql-test/suite/funcs_1/datadict/columns.inc +++ b/mysql-test/suite/funcs_1/datadict/columns.inc @@ -25,6 +25,10 @@ # --source suite/funcs_1/datadict/datadict_bug_12777.inc + +# The following is needed as embedded server can be compiled with and without +# privlege tables + eval SELECT * FROM information_schema.columns $my_where diff --git a/mysql-test/suite/funcs_1/r/is_character_sets.result b/mysql-test/suite/funcs_1/r/is_character_sets.result index af4dca9c666..9b5caf7448b 100644 --- a/mysql-test/suite/funcs_1/r/is_character_sets.result +++ b/mysql-test/suite/funcs_1/r/is_character_sets.result @@ -28,24 +28,24 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.CHARACTER_SETS; Field Type Null Key Default Extra -CHARACTER_SET_NAME varchar(32) NO -DEFAULT_COLLATE_NAME varchar(32) NO -DESCRIPTION varchar(60) NO -MAXLEN bigint(3) NO 0 +CHARACTER_SET_NAME varchar(32) NO NULL +DEFAULT_COLLATE_NAME varchar(32) NO NULL +DESCRIPTION varchar(60) NO NULL +MAXLEN bigint(3) NO NULL SHOW CREATE TABLE information_schema.CHARACTER_SETS; Table Create Table CHARACTER_SETS CREATE TEMPORARY TABLE `CHARACTER_SETS` ( - `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '', - `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT '', - `DESCRIPTION` varchar(60) NOT NULL DEFAULT '', - `MAXLEN` bigint(3) NOT NULL DEFAULT 0 + `CHARACTER_SET_NAME` varchar(32) NOT NULL, + `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL, + `DESCRIPTION` varchar(60) NOT NULL, + `MAXLEN` bigint(3) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.CHARACTER_SETS; Field Type Null Key Default Extra -CHARACTER_SET_NAME varchar(32) NO -DEFAULT_COLLATE_NAME varchar(32) NO -DESCRIPTION varchar(60) NO -MAXLEN bigint(3) NO 0 +CHARACTER_SET_NAME varchar(32) NO NULL +DEFAULT_COLLATE_NAME varchar(32) NO NULL +DESCRIPTION varchar(60) NO NULL +MAXLEN bigint(3) NO NULL # Testcases 3.2.2.2 and 3.2.2.3 are checked in suite/funcs_1/t/charset_collation*.test ######################################################################## # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and diff --git a/mysql-test/suite/funcs_1/r/is_coll_char_set_appl.result b/mysql-test/suite/funcs_1/r/is_coll_char_set_appl.result index b72681689e1..6e4c8b14f1f 100644 --- a/mysql-test/suite/funcs_1/r/is_coll_char_set_appl.result +++ b/mysql-test/suite/funcs_1/r/is_coll_char_set_appl.result @@ -28,18 +28,18 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.COLLATION_CHARACTER_SET_APPLICABILITY; Field Type Null Key Default Extra -COLLATION_NAME varchar(32) NO -CHARACTER_SET_NAME varchar(32) NO +COLLATION_NAME varchar(32) NO NULL +CHARACTER_SET_NAME varchar(32) NO NULL SHOW CREATE TABLE information_schema.COLLATION_CHARACTER_SET_APPLICABILITY; Table Create Table COLLATION_CHARACTER_SET_APPLICABILITY CREATE TEMPORARY TABLE `COLLATION_CHARACTER_SET_APPLICABILITY` ( - `COLLATION_NAME` varchar(32) NOT NULL DEFAULT '', - `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '' + `COLLATION_NAME` varchar(32) NOT NULL, + `CHARACTER_SET_NAME` varchar(32) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.COLLATION_CHARACTER_SET_APPLICABILITY; Field Type Null Key Default Extra -COLLATION_NAME varchar(32) NO -CHARACTER_SET_NAME varchar(32) NO +COLLATION_NAME varchar(32) NO NULL +CHARACTER_SET_NAME varchar(32) NO NULL # Testcases 3.2.4.2 and 3.2.4.3 are checked in suite/funcs_1/t/charset_collation*.test ######################################################################## # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and diff --git a/mysql-test/suite/funcs_1/r/is_collations.result b/mysql-test/suite/funcs_1/r/is_collations.result index 465baa64ee9..f4054af8655 100644 --- a/mysql-test/suite/funcs_1/r/is_collations.result +++ b/mysql-test/suite/funcs_1/r/is_collations.result @@ -28,30 +28,30 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.COLLATIONS; Field Type Null Key Default Extra -COLLATION_NAME varchar(32) NO -CHARACTER_SET_NAME varchar(32) NO -ID bigint(11) NO 0 -IS_DEFAULT varchar(3) NO -IS_COMPILED varchar(3) NO -SORTLEN bigint(3) NO 0 +COLLATION_NAME varchar(32) NO NULL +CHARACTER_SET_NAME varchar(32) NO NULL +ID bigint(11) NO NULL +IS_DEFAULT varchar(3) NO NULL +IS_COMPILED varchar(3) NO NULL +SORTLEN bigint(3) NO NULL SHOW CREATE TABLE information_schema.COLLATIONS; Table Create Table COLLATIONS CREATE TEMPORARY TABLE `COLLATIONS` ( - `COLLATION_NAME` varchar(32) NOT NULL DEFAULT '', - `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '', - `ID` bigint(11) NOT NULL DEFAULT 0, - `IS_DEFAULT` varchar(3) NOT NULL DEFAULT '', - `IS_COMPILED` varchar(3) NOT NULL DEFAULT '', - `SORTLEN` bigint(3) NOT NULL DEFAULT 0 + `COLLATION_NAME` varchar(32) NOT NULL, + `CHARACTER_SET_NAME` varchar(32) NOT NULL, + `ID` bigint(11) NOT NULL, + `IS_DEFAULT` varchar(3) NOT NULL, + `IS_COMPILED` varchar(3) NOT NULL, + `SORTLEN` bigint(3) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.COLLATIONS; Field Type Null Key Default Extra -COLLATION_NAME varchar(32) NO -CHARACTER_SET_NAME varchar(32) NO -ID bigint(11) NO 0 -IS_DEFAULT varchar(3) NO -IS_COMPILED varchar(3) NO -SORTLEN bigint(3) NO 0 +COLLATION_NAME varchar(32) NO NULL +CHARACTER_SET_NAME varchar(32) NO NULL +ID bigint(11) NO NULL +IS_DEFAULT varchar(3) NO NULL +IS_COMPILED varchar(3) NO NULL +SORTLEN bigint(3) NO NULL # Testcases 3.2.3.2 and 3.2.3.3 are checked in suite/funcs_1/t/charset_collation*.test ######################################################################## # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and diff --git a/mysql-test/suite/funcs_1/r/is_column_privileges.result b/mysql-test/suite/funcs_1/r/is_column_privileges.result index 4a013956ef7..1d945a31ffc 100644 --- a/mysql-test/suite/funcs_1/r/is_column_privileges.result +++ b/mysql-test/suite/funcs_1/r/is_column_privileges.result @@ -28,33 +28,33 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.COLUMN_PRIVILEGES; Field Type Null Key Default Extra -GRANTEE varchar(385) NO -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -COLUMN_NAME varchar(64) NO -PRIVILEGE_TYPE varchar(64) NO -IS_GRANTABLE varchar(3) NO +GRANTEE varchar(385) NO NULL +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +COLUMN_NAME varchar(64) NO NULL +PRIVILEGE_TYPE varchar(64) NO NULL +IS_GRANTABLE varchar(3) NO NULL SHOW CREATE TABLE information_schema.COLUMN_PRIVILEGES; Table Create Table COLUMN_PRIVILEGES CREATE TEMPORARY TABLE `COLUMN_PRIVILEGES` ( - `GRANTEE` varchar(385) NOT NULL DEFAULT '', - `TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '', - `TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `TABLE_NAME` varchar(64) NOT NULL DEFAULT '', - `COLUMN_NAME` varchar(64) NOT NULL DEFAULT '', - `PRIVILEGE_TYPE` varchar(64) NOT NULL DEFAULT '', - `IS_GRANTABLE` varchar(3) NOT NULL DEFAULT '' + `GRANTEE` varchar(385) NOT NULL, + `TABLE_CATALOG` varchar(512) NOT NULL, + `TABLE_SCHEMA` varchar(64) NOT NULL, + `TABLE_NAME` varchar(64) NOT NULL, + `COLUMN_NAME` varchar(64) NOT NULL, + `PRIVILEGE_TYPE` varchar(64) NOT NULL, + `IS_GRANTABLE` varchar(3) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.COLUMN_PRIVILEGES; Field Type Null Key Default Extra -GRANTEE varchar(385) NO -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -COLUMN_NAME varchar(64) NO -PRIVILEGE_TYPE varchar(64) NO -IS_GRANTABLE varchar(3) NO +GRANTEE varchar(385) NO NULL +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +COLUMN_NAME varchar(64) NO NULL +PRIVILEGE_TYPE varchar(64) NO NULL +IS_GRANTABLE varchar(3) NO NULL SELECT table_catalog, table_schema, table_name, column_name, privilege_type FROM information_schema.column_privileges WHERE table_catalog IS NOT NULL; table_catalog table_schema table_name column_name privilege_type diff --git a/mysql-test/suite/funcs_1/r/is_columns.result b/mysql-test/suite/funcs_1/r/is_columns.result index 76b724f2f40..bff145b7469 100644 --- a/mysql-test/suite/funcs_1/r/is_columns.result +++ b/mysql-test/suite/funcs_1/r/is_columns.result @@ -28,14 +28,14 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.COLUMNS; Field Type Null Key Default Extra -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -COLUMN_NAME varchar(64) NO -ORDINAL_POSITION bigint(21) unsigned NO 0 +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +COLUMN_NAME varchar(64) NO NULL +ORDINAL_POSITION bigint(21) unsigned NO NULL COLUMN_DEFAULT longtext YES NULL -IS_NULLABLE varchar(3) NO -DATA_TYPE varchar(64) NO +IS_NULLABLE varchar(3) NO NULL +DATA_TYPE varchar(64) NO NULL CHARACTER_MAXIMUM_LENGTH bigint(21) unsigned YES NULL CHARACTER_OCTET_LENGTH bigint(21) unsigned YES NULL NUMERIC_PRECISION bigint(21) unsigned YES NULL @@ -43,49 +43,49 @@ NUMERIC_SCALE bigint(21) unsigned YES NULL DATETIME_PRECISION bigint(21) unsigned YES NULL CHARACTER_SET_NAME varchar(32) YES NULL COLLATION_NAME varchar(32) YES NULL -COLUMN_TYPE longtext NO -COLUMN_KEY varchar(3) NO -EXTRA varchar(30) NO -PRIVILEGES varchar(80) NO -COLUMN_COMMENT varchar(1024) NO -IS_GENERATED varchar(6) NO +COLUMN_TYPE longtext NO NULL +COLUMN_KEY varchar(3) NO NULL +EXTRA varchar(30) NO NULL +PRIVILEGES varchar(80) NO NULL +COLUMN_COMMENT varchar(1024) NO NULL +IS_GENERATED varchar(6) NO NULL GENERATION_EXPRESSION longtext YES NULL SHOW CREATE TABLE information_schema.COLUMNS; Table Create Table COLUMNS CREATE TEMPORARY TABLE `COLUMNS` ( - `TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '', - `TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `TABLE_NAME` varchar(64) NOT NULL DEFAULT '', - `COLUMN_NAME` varchar(64) NOT NULL DEFAULT '', - `ORDINAL_POSITION` bigint(21) unsigned NOT NULL DEFAULT 0, - `COLUMN_DEFAULT` longtext DEFAULT NULL, - `IS_NULLABLE` varchar(3) NOT NULL DEFAULT '', - `DATA_TYPE` varchar(64) NOT NULL DEFAULT '', - `CHARACTER_MAXIMUM_LENGTH` bigint(21) unsigned DEFAULT NULL, - `CHARACTER_OCTET_LENGTH` bigint(21) unsigned DEFAULT NULL, - `NUMERIC_PRECISION` bigint(21) unsigned DEFAULT NULL, - `NUMERIC_SCALE` bigint(21) unsigned DEFAULT NULL, - `DATETIME_PRECISION` bigint(21) unsigned DEFAULT NULL, - `CHARACTER_SET_NAME` varchar(32) DEFAULT NULL, - `COLLATION_NAME` varchar(32) DEFAULT NULL, - `COLUMN_TYPE` longtext NOT NULL DEFAULT '', - `COLUMN_KEY` varchar(3) NOT NULL DEFAULT '', - `EXTRA` varchar(30) NOT NULL DEFAULT '', - `PRIVILEGES` varchar(80) NOT NULL DEFAULT '', - `COLUMN_COMMENT` varchar(1024) NOT NULL DEFAULT '', - `IS_GENERATED` varchar(6) NOT NULL DEFAULT '', - `GENERATION_EXPRESSION` longtext DEFAULT NULL + `TABLE_CATALOG` varchar(512) NOT NULL, + `TABLE_SCHEMA` varchar(64) NOT NULL, + `TABLE_NAME` varchar(64) NOT NULL, + `COLUMN_NAME` varchar(64) NOT NULL, + `ORDINAL_POSITION` bigint(21) unsigned NOT NULL, + `COLUMN_DEFAULT` longtext, + `IS_NULLABLE` varchar(3) NOT NULL, + `DATA_TYPE` varchar(64) NOT NULL, + `CHARACTER_MAXIMUM_LENGTH` bigint(21) unsigned, + `CHARACTER_OCTET_LENGTH` bigint(21) unsigned, + `NUMERIC_PRECISION` bigint(21) unsigned, + `NUMERIC_SCALE` bigint(21) unsigned, + `DATETIME_PRECISION` bigint(21) unsigned, + `CHARACTER_SET_NAME` varchar(32), + `COLLATION_NAME` varchar(32), + `COLUMN_TYPE` longtext NOT NULL, + `COLUMN_KEY` varchar(3) NOT NULL, + `EXTRA` varchar(30) NOT NULL, + `PRIVILEGES` varchar(80) NOT NULL, + `COLUMN_COMMENT` varchar(1024) NOT NULL, + `IS_GENERATED` varchar(6) NOT NULL, + `GENERATION_EXPRESSION` longtext ) DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.COLUMNS; Field Type Null Key Default Extra -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -COLUMN_NAME varchar(64) NO -ORDINAL_POSITION bigint(21) unsigned NO 0 +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +COLUMN_NAME varchar(64) NO NULL +ORDINAL_POSITION bigint(21) unsigned NO NULL COLUMN_DEFAULT longtext YES NULL -IS_NULLABLE varchar(3) NO -DATA_TYPE varchar(64) NO +IS_NULLABLE varchar(3) NO NULL +DATA_TYPE varchar(64) NO NULL CHARACTER_MAXIMUM_LENGTH bigint(21) unsigned YES NULL CHARACTER_OCTET_LENGTH bigint(21) unsigned YES NULL NUMERIC_PRECISION bigint(21) unsigned YES NULL @@ -93,12 +93,12 @@ NUMERIC_SCALE bigint(21) unsigned YES NULL DATETIME_PRECISION bigint(21) unsigned YES NULL CHARACTER_SET_NAME varchar(32) YES NULL COLLATION_NAME varchar(32) YES NULL -COLUMN_TYPE longtext NO -COLUMN_KEY varchar(3) NO -EXTRA varchar(30) NO -PRIVILEGES varchar(80) NO -COLUMN_COMMENT varchar(1024) NO -IS_GENERATED varchar(6) NO +COLUMN_TYPE longtext NO NULL +COLUMN_KEY varchar(3) NO NULL +EXTRA varchar(30) NO NULL +PRIVILEGES varchar(80) NO NULL +COLUMN_COMMENT varchar(1024) NO NULL +IS_GENERATED varchar(6) NO NULL GENERATION_EXPRESSION longtext YES NULL SELECT table_catalog, table_schema, table_name, column_name FROM information_schema.columns WHERE table_catalog IS NULL OR table_catalog <> 'def'; diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result index 5d239dd8393..a72fed20bc9 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is.result @@ -3,126 +3,126 @@ WHERE table_schema = 'information_schema' AND table_name <> 'profiling' AND table_name not like 'innodb_%' ORDER BY table_schema, table_name, column_name; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION -def information_schema ALL_PLUGINS LOAD_OPTION 11 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema ALL_PLUGINS LOAD_OPTION 11 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema ALL_PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema ALL_PLUGINS PLUGIN_AUTH_VERSION 13 NULL YES varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL def information_schema ALL_PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL def information_schema ALL_PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema ALL_PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL -def information_schema ALL_PLUGINS PLUGIN_LICENSE 10 '' NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL -def information_schema ALL_PLUGINS PLUGIN_MATURITY 12 '' NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) select NEVER NULL -def information_schema ALL_PLUGINS PLUGIN_NAME 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema ALL_PLUGINS PLUGIN_STATUS 3 '' NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL -def information_schema ALL_PLUGINS PLUGIN_TYPE 4 '' NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL -def information_schema ALL_PLUGINS PLUGIN_TYPE_VERSION 5 '' NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL -def information_schema ALL_PLUGINS PLUGIN_VERSION 2 '' NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL -def information_schema APPLICABLE_ROLES GRANTEE 1 '' NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) select NEVER NULL +def information_schema ALL_PLUGINS PLUGIN_LICENSE 10 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL +def information_schema ALL_PLUGINS PLUGIN_MATURITY 12 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) select NEVER NULL +def information_schema ALL_PLUGINS PLUGIN_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema ALL_PLUGINS PLUGIN_STATUS 3 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL +def information_schema ALL_PLUGINS PLUGIN_TYPE 4 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL +def information_schema ALL_PLUGINS PLUGIN_TYPE_VERSION 5 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL +def information_schema ALL_PLUGINS PLUGIN_VERSION 2 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL +def information_schema APPLICABLE_ROLES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) select NEVER NULL def information_schema APPLICABLE_ROLES IS_DEFAULT 4 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL -def information_schema APPLICABLE_ROLES IS_GRANTABLE 3 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL -def information_schema APPLICABLE_ROLES ROLE_NAME 2 '' NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select NEVER NULL -def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL -def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL -def information_schema CHARACTER_SETS DESCRIPTION 3 '' NO varchar 60 180 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(60) select NEVER NULL -def information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) select NEVER NULL -def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 6 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL -def information_schema CHECK_CONSTRAINTS CONSTRAINT_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema CHECK_CONSTRAINTS LEVEL 5 '' NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) select NEVER NULL -def information_schema CHECK_CONSTRAINTS TABLE_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema CLIENT_STATISTICS ACCESS_DENIED 22 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema CLIENT_STATISTICS BINLOG_BYTES_WRITTEN 9 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema CLIENT_STATISTICS BUSY_TIME 5 0 NO double NULL NULL 21 NULL NULL NULL NULL double select NEVER NULL -def information_schema CLIENT_STATISTICS BYTES_RECEIVED 7 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema CLIENT_STATISTICS BYTES_SENT 8 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema CLIENT_STATISTICS CLIENT 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema CLIENT_STATISTICS COMMIT_TRANSACTIONS 18 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema CLIENT_STATISTICS CONCURRENT_CONNECTIONS 3 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema CLIENT_STATISTICS CONNECTED_TIME 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema CLIENT_STATISTICS CPU_TIME 6 0 NO double NULL NULL 21 NULL NULL NULL NULL double select NEVER NULL -def information_schema CLIENT_STATISTICS DENIED_CONNECTIONS 20 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema CLIENT_STATISTICS EMPTY_QUERIES 23 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema CLIENT_STATISTICS LOST_CONNECTIONS 21 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema CLIENT_STATISTICS MAX_STATEMENT_TIME_EXCEEDED 25 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema CLIENT_STATISTICS OTHER_COMMANDS 17 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema CLIENT_STATISTICS ROLLBACK_TRANSACTIONS 19 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema CLIENT_STATISTICS ROWS_DELETED 12 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema CLIENT_STATISTICS ROWS_INSERTED 13 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema CLIENT_STATISTICS ROWS_READ 10 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema CLIENT_STATISTICS ROWS_SENT 11 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema CLIENT_STATISTICS ROWS_UPDATED 14 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema CLIENT_STATISTICS SELECT_COMMANDS 15 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema CLIENT_STATISTICS TOTAL_CONNECTIONS 2 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema CLIENT_STATISTICS TOTAL_SSL_CONNECTIONS 24 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema CLIENT_STATISTICS UPDATE_COMMANDS 16 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema COLLATIONS CHARACTER_SET_NAME 2 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL -def information_schema COLLATIONS COLLATION_NAME 1 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL -def information_schema COLLATIONS ID 3 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(11) select NEVER NULL -def information_schema COLLATIONS IS_COMPILED 5 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL -def information_schema COLLATIONS IS_DEFAULT 4 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL -def information_schema COLLATIONS SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) select NEVER NULL -def information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL -def information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL +def information_schema APPLICABLE_ROLES IS_GRANTABLE 3 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL +def information_schema APPLICABLE_ROLES ROLE_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select NEVER NULL +def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL +def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL +def information_schema CHARACTER_SETS DESCRIPTION 3 NULL NO varchar 60 180 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(60) select NEVER NULL +def information_schema CHARACTER_SETS MAXLEN 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) select NEVER NULL +def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 6 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL +def information_schema CHECK_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema CHECK_CONSTRAINTS LEVEL 5 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) select NEVER NULL +def information_schema CHECK_CONSTRAINTS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema CLIENT_STATISTICS ACCESS_DENIED 22 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema CLIENT_STATISTICS BINLOG_BYTES_WRITTEN 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema CLIENT_STATISTICS BUSY_TIME 5 NULL NO double NULL NULL 21 NULL NULL NULL NULL double select NEVER NULL +def information_schema CLIENT_STATISTICS BYTES_RECEIVED 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema CLIENT_STATISTICS BYTES_SENT 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema CLIENT_STATISTICS CLIENT 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema CLIENT_STATISTICS COMMIT_TRANSACTIONS 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema CLIENT_STATISTICS CONCURRENT_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema CLIENT_STATISTICS CONNECTED_TIME 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema CLIENT_STATISTICS CPU_TIME 6 NULL NO double NULL NULL 21 NULL NULL NULL NULL double select NEVER NULL +def information_schema CLIENT_STATISTICS DENIED_CONNECTIONS 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema CLIENT_STATISTICS EMPTY_QUERIES 23 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema CLIENT_STATISTICS LOST_CONNECTIONS 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema CLIENT_STATISTICS MAX_STATEMENT_TIME_EXCEEDED 25 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema CLIENT_STATISTICS OTHER_COMMANDS 17 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema CLIENT_STATISTICS ROLLBACK_TRANSACTIONS 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema CLIENT_STATISTICS ROWS_DELETED 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema CLIENT_STATISTICS ROWS_INSERTED 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema CLIENT_STATISTICS ROWS_READ 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema CLIENT_STATISTICS ROWS_SENT 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema CLIENT_STATISTICS ROWS_UPDATED 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema CLIENT_STATISTICS SELECT_COMMANDS 15 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema CLIENT_STATISTICS TOTAL_CONNECTIONS 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema CLIENT_STATISTICS TOTAL_SSL_CONNECTIONS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL +def information_schema CLIENT_STATISTICS UPDATE_COMMANDS 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema COLLATIONS CHARACTER_SET_NAME 2 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL +def information_schema COLLATIONS COLLATION_NAME 1 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL +def information_schema COLLATIONS ID 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(11) select NEVER NULL +def information_schema COLLATIONS IS_COMPILED 5 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL +def information_schema COLLATIONS IS_DEFAULT 4 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL +def information_schema COLLATIONS SORTLEN 6 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) select NEVER NULL +def information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL +def information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL def information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema COLUMNS CHARACTER_SET_NAME 14 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL def information_schema COLUMNS COLLATION_NAME 15 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL -def information_schema COLUMNS COLUMN_COMMENT 20 '' NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select NEVER NULL +def information_schema COLUMNS COLUMN_COMMENT 20 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select NEVER NULL def information_schema COLUMNS COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL -def information_schema COLUMNS COLUMN_KEY 17 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL -def information_schema COLUMNS COLUMN_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema COLUMNS COLUMN_TYPE 16 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL -def information_schema COLUMNS DATA_TYPE 8 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema COLUMNS COLUMN_KEY 17 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL +def information_schema COLUMNS COLUMN_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema COLUMNS COLUMN_TYPE 16 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL +def information_schema COLUMNS DATA_TYPE 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema COLUMNS DATETIME_PRECISION 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema COLUMNS EXTRA 18 '' NO varchar 30 90 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(30) select NEVER NULL +def information_schema COLUMNS EXTRA 18 NULL NO varchar 30 90 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(30) select NEVER NULL def information_schema COLUMNS GENERATION_EXPRESSION 22 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL -def information_schema COLUMNS IS_GENERATED 21 '' NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) select NEVER NULL -def information_schema COLUMNS IS_NULLABLE 7 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL +def information_schema COLUMNS IS_GENERATED 21 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) select NEVER NULL +def information_schema COLUMNS IS_NULLABLE 7 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL def information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema COLUMNS ORDINAL_POSITION 5 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema COLUMNS PRIVILEGES 19 '' NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL -def information_schema COLUMNS TABLE_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema COLUMNS TABLE_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema COLUMNS TABLE_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema COLUMN_PRIVILEGES COLUMN_NAME 5 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema COLUMN_PRIVILEGES GRANTEE 1 '' NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) select NEVER NULL -def information_schema COLUMN_PRIVILEGES IS_GRANTABLE 7 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL -def information_schema COLUMN_PRIVILEGES PRIVILEGE_TYPE 6 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema COLUMN_PRIVILEGES TABLE_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema COLUMNS ORDINAL_POSITION 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL +def information_schema COLUMNS PRIVILEGES 19 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL +def information_schema COLUMNS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema COLUMNS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema COLUMNS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema COLUMN_PRIVILEGES COLUMN_NAME 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema COLUMN_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) select NEVER NULL +def information_schema COLUMN_PRIVILEGES IS_GRANTABLE 7 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL +def information_schema COLUMN_PRIVILEGES PRIVILEGE_TYPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema COLUMN_PRIVILEGES TABLE_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema ENABLED_ROLES ROLE_NAME 1 NULL YES varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select NEVER NULL -def information_schema ENGINES COMMENT 3 '' NO varchar 160 480 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(160) select NEVER NULL -def information_schema ENGINES ENGINE 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema ENGINES COMMENT 3 NULL NO varchar 160 480 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(160) select NEVER NULL +def information_schema ENGINES ENGINE 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema ENGINES SAVEPOINTS 6 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL -def information_schema ENGINES SUPPORT 2 '' NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) select NEVER NULL +def information_schema ENGINES SUPPORT 2 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) select NEVER NULL def information_schema ENGINES TRANSACTIONS 4 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL def information_schema ENGINES XA 5 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL -def information_schema EVENTS CHARACTER_SET_CLIENT 22 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL -def information_schema EVENTS COLLATION_CONNECTION 23 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL -def information_schema EVENTS CREATED 17 '0000-00-00 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL -def information_schema EVENTS DATABASE_COLLATION 24 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL -def information_schema EVENTS DEFINER 4 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) select NEVER NULL +def information_schema EVENTS CHARACTER_SET_CLIENT 22 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL +def information_schema EVENTS COLLATION_CONNECTION 23 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL +def information_schema EVENTS CREATED 17 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL +def information_schema EVENTS DATABASE_COLLATION 24 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL +def information_schema EVENTS DEFINER 4 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) select NEVER NULL def information_schema EVENTS ENDS 14 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL -def information_schema EVENTS EVENT_BODY 6 '' NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) select NEVER NULL -def information_schema EVENTS EVENT_CATALOG 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema EVENTS EVENT_COMMENT 20 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema EVENTS EVENT_DEFINITION 7 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL -def information_schema EVENTS EVENT_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema EVENTS EVENT_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema EVENTS EVENT_TYPE 8 '' NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) select NEVER NULL +def information_schema EVENTS EVENT_BODY 6 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) select NEVER NULL +def information_schema EVENTS EVENT_CATALOG 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema EVENTS EVENT_COMMENT 20 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema EVENTS EVENT_DEFINITION 7 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL +def information_schema EVENTS EVENT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema EVENTS EVENT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema EVENTS EVENT_TYPE 8 NULL NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) select NEVER NULL def information_schema EVENTS EXECUTE_AT 9 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL def information_schema EVENTS INTERVAL_FIELD 11 NULL YES varchar 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(18) select NEVER NULL def information_schema EVENTS INTERVAL_VALUE 10 NULL YES varchar 256 768 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(256) select NEVER NULL -def information_schema EVENTS LAST_ALTERED 18 '0000-00-00 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL +def information_schema EVENTS LAST_ALTERED 18 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL def information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL -def information_schema EVENTS ON_COMPLETION 16 '' NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) select NEVER NULL -def information_schema EVENTS ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) select NEVER NULL -def information_schema EVENTS SQL_MODE 12 '' NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) select NEVER NULL +def information_schema EVENTS ON_COMPLETION 16 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) select NEVER NULL +def information_schema EVENTS ORIGINATOR 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) select NEVER NULL +def information_schema EVENTS SQL_MODE 12 NULL NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) select NEVER NULL def information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL -def information_schema EVENTS STATUS 15 '' NO varchar 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(18) select NEVER NULL -def information_schema EVENTS TIME_ZONE 5 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema EVENTS STATUS 15 NULL NO varchar 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(18) select NEVER NULL +def information_schema EVENTS TIME_ZONE 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema FILES AUTOEXTEND_SIZE 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema FILES AVG_ROW_LENGTH 28 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL @@ -132,12 +132,12 @@ def information_schema FILES CREATION_TIME 20 NULL YES datetime NULL NULL NULL N def information_schema FILES DATA_FREE 32 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema FILES DATA_LENGTH 29 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema FILES DELETED_ROWS 12 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL -def information_schema FILES ENGINE 10 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema FILES EXTENT_SIZE 16 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL +def information_schema FILES ENGINE 10 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema FILES EXTENT_SIZE 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL def information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(255) select NEVER NULL -def information_schema FILES FILE_ID 1 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL +def information_schema FILES FILE_ID 1 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL def information_schema FILES FILE_NAME 2 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema FILES FILE_TYPE 3 '' NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL +def information_schema FILES FILE_TYPE 3 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL def information_schema FILES FREE_EXTENTS 14 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL def information_schema FILES FULLTEXT_KEYS 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema FILES INDEX_LENGTH 31 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL @@ -150,9 +150,9 @@ def information_schema FILES MAXIMUM_SIZE 18 NULL YES bigint NULL NULL 20 0 NULL def information_schema FILES MAX_DATA_LENGTH 30 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema FILES RECOVER_TIME 23 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL def information_schema FILES ROW_FORMAT 26 NULL YES varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) select NEVER NULL -def information_schema FILES STATUS 37 '' NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL +def information_schema FILES STATUS 37 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL def information_schema FILES TABLESPACE_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema FILES TABLE_CATALOG 5 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema FILES TABLE_CATALOG 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema FILES TABLE_NAME 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema FILES TABLE_ROWS 27 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema FILES TABLE_SCHEMA 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL @@ -161,82 +161,82 @@ def information_schema FILES TRANSACTION_COUNTER 24 NULL YES bigint NULL NULL 19 def information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL def information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL def information_schema FILES VERSION 25 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema GEOMETRY_COLUMNS COORD_DIMENSION 11 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL -def information_schema GEOMETRY_COLUMNS F_GEOMETRY_COLUMN 4 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema GEOMETRY_COLUMNS F_TABLE_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema GEOMETRY_COLUMNS F_TABLE_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema GEOMETRY_COLUMNS F_TABLE_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema GEOMETRY_COLUMNS GEOMETRY_TYPE 10 0 NO int NULL NULL 10 0 NULL NULL NULL int(7) select NEVER NULL -def information_schema GEOMETRY_COLUMNS G_GEOMETRY_COLUMN 8 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema GEOMETRY_COLUMNS G_TABLE_CATALOG 5 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema GEOMETRY_COLUMNS G_TABLE_NAME 7 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema GEOMETRY_COLUMNS G_TABLE_SCHEMA 6 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema GEOMETRY_COLUMNS MAX_PPR 12 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL -def information_schema GEOMETRY_COLUMNS SRID 13 0 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) select NEVER NULL -def information_schema GEOMETRY_COLUMNS STORAGE_TYPE 9 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL -def information_schema GLOBAL_STATUS VARIABLE_NAME 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 '' NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL -def information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 '' NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL -def information_schema INDEX_STATISTICS INDEX_NAME 3 '' NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL -def information_schema INDEX_STATISTICS ROWS_READ 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema INDEX_STATISTICS TABLE_NAME 2 '' NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL -def information_schema INDEX_STATISTICS TABLE_SCHEMA 1 '' NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL +def information_schema GEOMETRY_COLUMNS COORD_DIMENSION 11 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL +def information_schema GEOMETRY_COLUMNS F_GEOMETRY_COLUMN 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema GEOMETRY_COLUMNS F_TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema GEOMETRY_COLUMNS F_TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema GEOMETRY_COLUMNS F_TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema GEOMETRY_COLUMNS GEOMETRY_TYPE 10 NULL NO int NULL NULL 10 0 NULL NULL NULL int(7) select NEVER NULL +def information_schema GEOMETRY_COLUMNS G_GEOMETRY_COLUMN 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema GEOMETRY_COLUMNS G_TABLE_CATALOG 5 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema GEOMETRY_COLUMNS G_TABLE_NAME 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema GEOMETRY_COLUMNS G_TABLE_SCHEMA 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema GEOMETRY_COLUMNS MAX_PPR 12 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL +def information_schema GEOMETRY_COLUMNS SRID 13 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) select NEVER NULL +def information_schema GEOMETRY_COLUMNS STORAGE_TYPE 9 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL +def information_schema GLOBAL_STATUS VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL +def information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL +def information_schema INDEX_STATISTICS INDEX_NAME 3 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL +def information_schema INDEX_STATISTICS ROWS_READ 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema INDEX_STATISTICS TABLE_NAME 2 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL +def information_schema INDEX_STATISTICS TABLE_SCHEMA 1 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL def information_schema KEYWORDS WORD 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema KEY_CACHES BLOCK_SIZE 5 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema KEY_CACHES DIRTY_BLOCKS 8 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema KEY_CACHES FULL_SIZE 4 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema KEY_CACHES KEY_CACHE_NAME 1 '' NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL -def information_schema KEY_CACHES READS 10 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema KEY_CACHES READ_REQUESTS 9 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL +def information_schema KEY_CACHES BLOCK_SIZE 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL +def information_schema KEY_CACHES DIRTY_BLOCKS 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL +def information_schema KEY_CACHES FULL_SIZE 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL +def information_schema KEY_CACHES KEY_CACHE_NAME 1 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL +def information_schema KEY_CACHES READS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL +def information_schema KEY_CACHES READ_REQUESTS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema KEY_CACHES SEGMENTS 2 NULL YES int NULL NULL 10 0 NULL NULL NULL int(3) unsigned select NEVER NULL def information_schema KEY_CACHES SEGMENT_NUMBER 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(3) unsigned select NEVER NULL -def information_schema KEY_CACHES UNUSED_BLOCKS 7 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema KEY_CACHES USED_BLOCKS 6 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema KEY_CACHES WRITES 12 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema KEY_CACHES WRITE_REQUESTS 11 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema KEY_COLUMN_USAGE COLUMN_NAME 7 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema KEY_COLUMN_USAGE ORDINAL_POSITION 8 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) select NEVER NULL +def information_schema KEY_CACHES UNUSED_BLOCKS 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL +def information_schema KEY_CACHES USED_BLOCKS 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL +def information_schema KEY_CACHES WRITES 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL +def information_schema KEY_CACHES WRITE_REQUESTS 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL +def information_schema KEY_COLUMN_USAGE COLUMN_NAME 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema KEY_COLUMN_USAGE ORDINAL_POSITION 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) select NEVER NULL def information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT 9 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(10) select NEVER NULL def information_schema KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_NAME 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema KEY_COLUMN_USAGE TABLE_NAME 6 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema OPTIMIZER_TRACE INSUFFICIENT_PRIVILEGES 4 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) select NEVER NULL -def information_schema OPTIMIZER_TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE 3 0 NO int NULL NULL 10 0 NULL NULL NULL int(20) select NEVER NULL -def information_schema OPTIMIZER_TRACE QUERY 1 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL -def information_schema OPTIMIZER_TRACE TRACE 2 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL +def information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema KEY_COLUMN_USAGE TABLE_NAME 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema OPTIMIZER_TRACE INSUFFICIENT_PRIVILEGES 4 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) select NEVER NULL +def information_schema OPTIMIZER_TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(20) select NEVER NULL +def information_schema OPTIMIZER_TRACE QUERY 1 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL +def information_schema OPTIMIZER_TRACE TRACE 2 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL def information_schema PARAMETERS CHARACTER_MAXIMUM_LENGTH 8 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL def information_schema PARAMETERS CHARACTER_OCTET_LENGTH 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL def information_schema PARAMETERS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema PARAMETERS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema PARAMETERS DATA_TYPE 7 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema PARAMETERS DATA_TYPE 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema PARAMETERS DATETIME_PRECISION 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema PARAMETERS DTD_IDENTIFIER 15 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL +def information_schema PARAMETERS DTD_IDENTIFIER 15 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL def information_schema PARAMETERS NUMERIC_PRECISION 10 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL def information_schema PARAMETERS NUMERIC_SCALE 11 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL -def information_schema PARAMETERS ORDINAL_POSITION 4 0 NO int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL +def information_schema PARAMETERS ORDINAL_POSITION 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL def information_schema PARAMETERS PARAMETER_MODE 5 NULL YES varchar 5 15 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(5) select NEVER NULL def information_schema PARAMETERS PARAMETER_NAME 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema PARAMETERS ROUTINE_TYPE 16 '' NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) select NEVER NULL -def information_schema PARAMETERS SPECIFIC_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema PARAMETERS SPECIFIC_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema PARAMETERS SPECIFIC_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema PARTITIONS AVG_ROW_LENGTH 14 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL +def information_schema PARAMETERS ROUTINE_TYPE 16 NULL NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) select NEVER NULL +def information_schema PARAMETERS SPECIFIC_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema PARAMETERS SPECIFIC_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema PARAMETERS SPECIFIC_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema PARTITIONS AVG_ROW_LENGTH 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema PARTITIONS CHECKSUM 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema PARTITIONS CHECK_TIME 21 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL def information_schema PARTITIONS CREATE_TIME 19 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL -def information_schema PARTITIONS DATA_FREE 18 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema PARTITIONS DATA_LENGTH 15 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema PARTITIONS INDEX_LENGTH 17 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL +def information_schema PARTITIONS DATA_FREE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL +def information_schema PARTITIONS DATA_LENGTH 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL +def information_schema PARTITIONS INDEX_LENGTH 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema PARTITIONS MAX_DATA_LENGTH 16 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema PARTITIONS NODEGROUP 24 '' NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) select NEVER NULL -def information_schema PARTITIONS PARTITION_COMMENT 23 '' NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL +def information_schema PARTITIONS NODEGROUP 24 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) select NEVER NULL +def information_schema PARTITIONS PARTITION_COMMENT 23 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL def information_schema PARTITIONS PARTITION_DESCRIPTION 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL def information_schema PARTITIONS PARTITION_EXPRESSION 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL def information_schema PARTITIONS PARTITION_METHOD 8 NULL YES varchar 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(18) select NEVER NULL @@ -247,136 +247,136 @@ def information_schema PARTITIONS SUBPARTITION_METHOD 9 NULL YES varchar 12 36 N def information_schema PARTITIONS SUBPARTITION_NAME 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema PARTITIONS TABLESPACE_NAME 25 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema PARTITIONS TABLE_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema PARTITIONS TABLE_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema PARTITIONS TABLE_ROWS 13 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema PARTITIONS TABLE_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema PARTITIONS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema PARTITIONS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema PARTITIONS TABLE_ROWS 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL +def information_schema PARTITIONS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema PARTITIONS UPDATE_TIME 20 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL -def information_schema PLUGINS LOAD_OPTION 11 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema PLUGINS LOAD_OPTION 11 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema PLUGINS PLUGIN_AUTH_VERSION 13 NULL YES varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL def information_schema PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL def information_schema PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL -def information_schema PLUGINS PLUGIN_LICENSE 10 '' NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL -def information_schema PLUGINS PLUGIN_MATURITY 12 '' NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) select NEVER NULL -def information_schema PLUGINS PLUGIN_NAME 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema PLUGINS PLUGIN_STATUS 3 '' NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL -def information_schema PLUGINS PLUGIN_TYPE 4 '' NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL -def information_schema PLUGINS PLUGIN_TYPE_VERSION 5 '' NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL -def information_schema PLUGINS PLUGIN_VERSION 2 '' NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL -def information_schema PROCESSLIST COMMAND 5 '' NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL +def information_schema PLUGINS PLUGIN_LICENSE 10 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL +def information_schema PLUGINS PLUGIN_MATURITY 12 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) select NEVER NULL +def information_schema PLUGINS PLUGIN_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema PLUGINS PLUGIN_STATUS 3 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL +def information_schema PLUGINS PLUGIN_TYPE 4 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL +def information_schema PLUGINS PLUGIN_TYPE_VERSION 5 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL +def information_schema PLUGINS PLUGIN_VERSION 2 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL +def information_schema PROCESSLIST COMMAND 5 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL def information_schema PROCESSLIST DB 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema PROCESSLIST EXAMINED_ROWS 15 0 NO int NULL NULL 10 0 NULL NULL NULL int(7) select NEVER NULL -def information_schema PROCESSLIST HOST 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema PROCESSLIST ID 1 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL +def information_schema PROCESSLIST EXAMINED_ROWS 15 NULL NO int NULL NULL 10 0 NULL NULL NULL int(7) select NEVER NULL +def information_schema PROCESSLIST HOST 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema PROCESSLIST ID 1 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL def information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL def information_schema PROCESSLIST INFO_BINARY 17 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob select NEVER NULL -def information_schema PROCESSLIST MAX_MEMORY_USED 14 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(7) select NEVER NULL -def information_schema PROCESSLIST MAX_STAGE 11 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL -def information_schema PROCESSLIST MEMORY_USED 13 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(7) select NEVER NULL -def information_schema PROCESSLIST PROGRESS 12 0.000 NO decimal NULL NULL 7 3 NULL NULL NULL decimal(7,3) select NEVER NULL -def information_schema PROCESSLIST QUERY_ID 16 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL -def information_schema PROCESSLIST STAGE 10 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL +def information_schema PROCESSLIST MAX_MEMORY_USED 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(7) select NEVER NULL +def information_schema PROCESSLIST MAX_STAGE 11 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL +def information_schema PROCESSLIST MEMORY_USED 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(7) select NEVER NULL +def information_schema PROCESSLIST PROGRESS 12 NULL NO decimal NULL NULL 7 3 NULL NULL NULL decimal(7,3) select NEVER NULL +def information_schema PROCESSLIST QUERY_ID 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL +def information_schema PROCESSLIST STAGE 10 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL def information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema PROCESSLIST TID 18 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL -def information_schema PROCESSLIST TIME 6 0 NO int NULL NULL 10 0 NULL NULL NULL int(7) select NEVER NULL -def information_schema PROCESSLIST TIME_MS 9 0.000 NO decimal NULL NULL 22 3 NULL NULL NULL decimal(22,3) select NEVER NULL -def information_schema PROCESSLIST USER 2 '' NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select NEVER NULL -def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema REFERENTIAL_CONSTRAINTS DELETE_RULE 9 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema REFERENTIAL_CONSTRAINTS MATCH_OPTION 7 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema REFERENTIAL_CONSTRAINTS REFERENCED_TABLE_NAME 11 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema REFERENTIAL_CONSTRAINTS TABLE_NAME 10 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_CATALOG 4 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema PROCESSLIST TID 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL +def information_schema PROCESSLIST TIME 6 NULL NO int NULL NULL 10 0 NULL NULL NULL int(7) select NEVER NULL +def information_schema PROCESSLIST TIME_MS 9 NULL NO decimal NULL NULL 22 3 NULL NULL NULL decimal(22,3) select NEVER NULL +def information_schema PROCESSLIST USER 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select NEVER NULL +def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema REFERENTIAL_CONSTRAINTS DELETE_RULE 9 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema REFERENTIAL_CONSTRAINTS MATCH_OPTION 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema REFERENTIAL_CONSTRAINTS REFERENCED_TABLE_NAME 11 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema REFERENTIAL_CONSTRAINTS TABLE_NAME 10 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_CATALOG 4 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_NAME 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_SCHEMA 5 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema REFERENTIAL_CONSTRAINTS UPDATE_RULE 8 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_SCHEMA 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema REFERENTIAL_CONSTRAINTS UPDATE_RULE 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema ROUTINES CHARACTER_MAXIMUM_LENGTH 7 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL def information_schema ROUTINES CHARACTER_OCTET_LENGTH 8 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL -def information_schema ROUTINES CHARACTER_SET_CLIENT 29 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL +def information_schema ROUTINES CHARACTER_SET_CLIENT 29 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL def information_schema ROUTINES CHARACTER_SET_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema ROUTINES COLLATION_CONNECTION 30 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL +def information_schema ROUTINES COLLATION_CONNECTION 30 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL def information_schema ROUTINES COLLATION_NAME 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema ROUTINES CREATED 24 '0000-00-00 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL -def information_schema ROUTINES DATABASE_COLLATION 31 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL -def information_schema ROUTINES DATA_TYPE 6 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema ROUTINES CREATED 24 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL +def information_schema ROUTINES DATABASE_COLLATION 31 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL +def information_schema ROUTINES DATA_TYPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema ROUTINES DATETIME_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema ROUTINES DEFINER 28 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) select NEVER NULL +def information_schema ROUTINES DEFINER 28 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) select NEVER NULL def information_schema ROUTINES DTD_IDENTIFIER 14 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL def information_schema ROUTINES EXTERNAL_LANGUAGE 18 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema ROUTINES EXTERNAL_NAME 17 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema ROUTINES IS_DETERMINISTIC 20 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL -def information_schema ROUTINES LAST_ALTERED 25 '0000-00-00 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL +def information_schema ROUTINES IS_DETERMINISTIC 20 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL +def information_schema ROUTINES LAST_ALTERED 25 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL def information_schema ROUTINES NUMERIC_PRECISION 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL def information_schema ROUTINES NUMERIC_SCALE 10 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL -def information_schema ROUTINES PARAMETER_STYLE 19 '' NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) select NEVER NULL -def information_schema ROUTINES ROUTINE_BODY 15 '' NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) select NEVER NULL -def information_schema ROUTINES ROUTINE_CATALOG 2 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema ROUTINES ROUTINE_COMMENT 27 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL +def information_schema ROUTINES PARAMETER_STYLE 19 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) select NEVER NULL +def information_schema ROUTINES ROUTINE_BODY 15 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) select NEVER NULL +def information_schema ROUTINES ROUTINE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema ROUTINES ROUTINE_COMMENT 27 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL def information_schema ROUTINES ROUTINE_DEFINITION 16 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL -def information_schema ROUTINES ROUTINE_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema ROUTINES ROUTINE_SCHEMA 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema ROUTINES ROUTINE_TYPE 5 '' NO varchar 13 39 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(13) select NEVER NULL -def information_schema ROUTINES SECURITY_TYPE 23 '' NO varchar 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(7) select NEVER NULL -def information_schema ROUTINES SPECIFIC_NAME 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema ROUTINES SQL_DATA_ACCESS 21 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema ROUTINES SQL_MODE 26 '' NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) select NEVER NULL +def information_schema ROUTINES ROUTINE_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema ROUTINES ROUTINE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema ROUTINES ROUTINE_TYPE 5 NULL NO varchar 13 39 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(13) select NEVER NULL +def information_schema ROUTINES SECURITY_TYPE 23 NULL NO varchar 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(7) select NEVER NULL +def information_schema ROUTINES SPECIFIC_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema ROUTINES SQL_DATA_ACCESS 21 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema ROUTINES SQL_MODE 26 NULL NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) select NEVER NULL def information_schema ROUTINES SQL_PATH 22 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema SCHEMATA CATALOG_NAME 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL -def information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL -def information_schema SCHEMATA SCHEMA_COMMENT 6 '' NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select NEVER NULL -def information_schema SCHEMATA SCHEMA_NAME 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema SCHEMATA CATALOG_NAME 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL +def information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL +def information_schema SCHEMATA SCHEMA_COMMENT 6 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select NEVER NULL +def information_schema SCHEMATA SCHEMA_NAME 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema SCHEMA_PRIVILEGES GRANTEE 1 '' NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) select NEVER NULL -def information_schema SCHEMA_PRIVILEGES IS_GRANTABLE 5 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL -def information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema SESSION_STATUS VARIABLE_NAME 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema SESSION_STATUS VARIABLE_VALUE 2 '' NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL -def information_schema SESSION_VARIABLES VARIABLE_NAME 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 '' NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL -def information_schema SPATIAL_REF_SYS AUTH_NAME 2 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema SPATIAL_REF_SYS AUTH_SRID 3 0 NO int NULL NULL 10 0 NULL NULL NULL int(5) select NEVER NULL -def information_schema SPATIAL_REF_SYS SRID 1 0 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) select NEVER NULL -def information_schema SPATIAL_REF_SYS SRTEXT 4 '' NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL +def information_schema SCHEMA_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) select NEVER NULL +def information_schema SCHEMA_PRIVILEGES IS_GRANTABLE 5 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL +def information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema SESSION_STATUS VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL +def information_schema SESSION_VARIABLES VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL +def information_schema SPATIAL_REF_SYS AUTH_NAME 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema SPATIAL_REF_SYS AUTH_SRID 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(5) select NEVER NULL +def information_schema SPATIAL_REF_SYS SRID 1 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) select NEVER NULL +def information_schema SPATIAL_REF_SYS SRTEXT 4 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL def information_schema SQL_FUNCTIONS FUNCTION 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1) select NEVER NULL -def information_schema STATISTICS COLUMN_NAME 8 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema STATISTICS COLUMN_NAME 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema STATISTICS COMMENT 15 NULL YES varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL -def information_schema STATISTICS IGNORED 17 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL -def information_schema STATISTICS INDEX_COMMENT 16 '' NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select NEVER NULL -def information_schema STATISTICS INDEX_NAME 6 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema STATISTICS INDEX_SCHEMA 5 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema STATISTICS INDEX_TYPE 14 '' NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL -def information_schema STATISTICS NON_UNIQUE 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(1) select NEVER NULL -def information_schema STATISTICS NULLABLE 13 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL +def information_schema STATISTICS IGNORED 17 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL +def information_schema STATISTICS INDEX_COMMENT 16 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select NEVER NULL +def information_schema STATISTICS INDEX_NAME 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema STATISTICS INDEX_SCHEMA 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema STATISTICS INDEX_TYPE 14 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL +def information_schema STATISTICS NON_UNIQUE 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(1) select NEVER NULL +def information_schema STATISTICS NULLABLE 13 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL def information_schema STATISTICS PACKED 12 NULL YES varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) select NEVER NULL -def information_schema STATISTICS SEQ_IN_INDEX 7 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(2) select NEVER NULL +def information_schema STATISTICS SEQ_IN_INDEX 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(2) select NEVER NULL def information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(3) select NEVER NULL -def information_schema STATISTICS TABLE_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema STATISTICS TABLE_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema STATISTICS TABLE_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema STATISTICS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema STATISTICS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema STATISTICS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema SYSTEM_VARIABLES COMMAND_LINE_ARGUMENT 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema SYSTEM_VARIABLES DEFAULT_VALUE 5 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL def information_schema SYSTEM_VARIABLES ENUM_VALUE_LIST 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL def information_schema SYSTEM_VARIABLES GLOBAL_VALUE 3 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL -def information_schema SYSTEM_VARIABLES GLOBAL_VALUE_ORIGIN 4 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema SYSTEM_VARIABLES GLOBAL_VALUE_ORIGIN 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema SYSTEM_VARIABLES GLOBAL_VALUE_PATH 15 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL def information_schema SYSTEM_VARIABLES NUMERIC_BLOCK_SIZE 11 NULL YES varchar 21 63 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21) select NEVER NULL def information_schema SYSTEM_VARIABLES NUMERIC_MAX_VALUE 10 NULL YES varchar 21 63 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21) select NEVER NULL def information_schema SYSTEM_VARIABLES NUMERIC_MIN_VALUE 9 NULL YES varchar 21 63 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21) select NEVER NULL -def information_schema SYSTEM_VARIABLES READ_ONLY 13 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL +def information_schema SYSTEM_VARIABLES READ_ONLY 13 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL def information_schema SYSTEM_VARIABLES SESSION_VALUE 2 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL -def information_schema SYSTEM_VARIABLES VARIABLE_COMMENT 8 '' NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL -def information_schema SYSTEM_VARIABLES VARIABLE_NAME 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema SYSTEM_VARIABLES VARIABLE_SCOPE 6 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema SYSTEM_VARIABLES VARIABLE_TYPE 7 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema SYSTEM_VARIABLES VARIABLE_COMMENT 8 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL +def information_schema SYSTEM_VARIABLES VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema SYSTEM_VARIABLES VARIABLE_SCOPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema SYSTEM_VARIABLES VARIABLE_TYPE 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL @@ -390,104 +390,104 @@ def information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 20 0 NUL def information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema TABLES MAX_INDEX_LENGTH 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) select NEVER NULL -def information_schema TABLES TABLE_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema TABLES TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL def information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL -def information_schema TABLES TABLE_COMMENT 21 '' NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL -def information_schema TABLES TABLE_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema TABLES TABLE_COMMENT 21 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL +def information_schema TABLES TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema TABLES TABLE_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema TABLES TABLE_TYPE 4 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema TABLES TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema TABLES TABLE_TYPE 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema TABLES TEMPORARY 23 NULL YES varchar 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1) select NEVER NULL def information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL def information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema TABLESPACES AUTOEXTEND_SIZE 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema TABLESPACES ENGINE 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema TABLESPACES ENGINE 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema TABLESPACES EXTENT_SIZE 5 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema TABLESPACES LOGFILE_GROUP_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema TABLESPACES MAXIMUM_SIZE 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema TABLESPACES NODEGROUP_ID 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL def information_schema TABLESPACES TABLESPACE_COMMENT 9 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL -def information_schema TABLESPACES TABLESPACE_NAME 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema TABLESPACES TABLESPACE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL def information_schema TABLESPACES TABLESPACE_TYPE 3 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema TABLE_CONSTRAINTS CONSTRAINT_TYPE 6 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema TABLE_CONSTRAINTS TABLE_NAME 5 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema TABLE_CONSTRAINTS TABLE_SCHEMA 4 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema TABLE_PRIVILEGES GRANTEE 1 '' NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) select NEVER NULL -def information_schema TABLE_PRIVILEGES IS_GRANTABLE 6 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL -def information_schema TABLE_PRIVILEGES PRIVILEGE_TYPE 5 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema TABLE_PRIVILEGES TABLE_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema TABLE_PRIVILEGES TABLE_SCHEMA 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema TABLE_STATISTICS ROWS_CHANGED 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema TABLE_STATISTICS ROWS_CHANGED_X_INDEXES 5 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema TABLE_STATISTICS ROWS_READ 3 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema TABLE_STATISTICS TABLE_NAME 2 '' NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL -def information_schema TABLE_STATISTICS TABLE_SCHEMA 1 '' NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL +def information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema TABLE_CONSTRAINTS CONSTRAINT_TYPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema TABLE_CONSTRAINTS TABLE_NAME 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema TABLE_CONSTRAINTS TABLE_SCHEMA 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema TABLE_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) select NEVER NULL +def information_schema TABLE_PRIVILEGES IS_GRANTABLE 6 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL +def information_schema TABLE_PRIVILEGES PRIVILEGE_TYPE 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema TABLE_PRIVILEGES TABLE_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema TABLE_PRIVILEGES TABLE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema TABLE_STATISTICS ROWS_CHANGED 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema TABLE_STATISTICS ROWS_CHANGED_X_INDEXES 5 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema TABLE_STATISTICS ROWS_READ 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema TABLE_STATISTICS TABLE_NAME 2 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL +def information_schema TABLE_STATISTICS TABLE_SCHEMA 1 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL def information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL -def information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL -def information_schema TRIGGERS ACTION_ORIENTATION 11 '' NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) select NEVER NULL -def information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL +def information_schema TRIGGERS ACTION_ORDER 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL +def information_schema TRIGGERS ACTION_ORIENTATION 11 NULL NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) select NEVER NULL +def information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL def information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL +def information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL def information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema TRIGGERS ACTION_STATEMENT 10 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL -def information_schema TRIGGERS ACTION_TIMING 12 '' NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) select NEVER NULL -def information_schema TRIGGERS CHARACTER_SET_CLIENT 20 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL -def information_schema TRIGGERS COLLATION_CONNECTION 21 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL +def information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL +def information_schema TRIGGERS ACTION_TIMING 12 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) select NEVER NULL +def information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL +def information_schema TRIGGERS COLLATION_CONNECTION 21 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL def information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL 2 NULL NULL datetime(2) select NEVER NULL -def information_schema TRIGGERS DATABASE_COLLATION 22 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL -def information_schema TRIGGERS DEFINER 19 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) select NEVER NULL -def information_schema TRIGGERS EVENT_MANIPULATION 4 '' NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) select NEVER NULL -def information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema TRIGGERS EVENT_OBJECT_TABLE 7 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema TRIGGERS SQL_MODE 18 '' NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) select NEVER NULL -def information_schema TRIGGERS TRIGGER_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema TRIGGERS TRIGGER_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema TRIGGERS TRIGGER_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema USER_PRIVILEGES GRANTEE 1 '' NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) select NEVER NULL -def information_schema USER_PRIVILEGES IS_GRANTABLE 4 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL -def information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema USER_PRIVILEGES TABLE_CATALOG 2 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema USER_STATISTICS ACCESS_DENIED 22 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema USER_STATISTICS BINLOG_BYTES_WRITTEN 9 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema USER_STATISTICS BUSY_TIME 5 0 NO double NULL NULL 21 NULL NULL NULL NULL double select NEVER NULL -def information_schema USER_STATISTICS BYTES_RECEIVED 7 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema USER_STATISTICS BYTES_SENT 8 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema USER_STATISTICS COMMIT_TRANSACTIONS 18 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema USER_STATISTICS CONCURRENT_CONNECTIONS 3 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) select NEVER NULL -def information_schema USER_STATISTICS CONNECTED_TIME 4 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) select NEVER NULL -def information_schema USER_STATISTICS CPU_TIME 6 0 NO double NULL NULL 21 NULL NULL NULL NULL double select NEVER NULL -def information_schema USER_STATISTICS DENIED_CONNECTIONS 20 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema USER_STATISTICS EMPTY_QUERIES 23 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema USER_STATISTICS LOST_CONNECTIONS 21 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema USER_STATISTICS MAX_STATEMENT_TIME_EXCEEDED 25 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema USER_STATISTICS OTHER_COMMANDS 17 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema USER_STATISTICS ROLLBACK_TRANSACTIONS 19 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema USER_STATISTICS ROWS_DELETED 12 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema USER_STATISTICS ROWS_INSERTED 13 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema USER_STATISTICS ROWS_READ 10 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema USER_STATISTICS ROWS_SENT 11 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema USER_STATISTICS ROWS_UPDATED 14 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema USER_STATISTICS SELECT_COMMANDS 15 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema USER_STATISTICS TOTAL_CONNECTIONS 2 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) select NEVER NULL -def information_schema USER_STATISTICS TOTAL_SSL_CONNECTIONS 24 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL -def information_schema USER_STATISTICS UPDATE_COMMANDS 16 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL -def information_schema USER_STATISTICS USER 1 '' NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select NEVER NULL -def information_schema VIEWS ALGORITHM 11 '' NO varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) select NEVER NULL -def information_schema VIEWS CHARACTER_SET_CLIENT 9 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL -def information_schema VIEWS CHECK_OPTION 5 '' NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) select NEVER NULL -def information_schema VIEWS COLLATION_CONNECTION 10 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL -def information_schema VIEWS DEFINER 7 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) select NEVER NULL -def information_schema VIEWS IS_UPDATABLE 6 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL -def information_schema VIEWS SECURITY_TYPE 8 '' NO varchar 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(7) select NEVER NULL -def information_schema VIEWS TABLE_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL -def information_schema VIEWS TABLE_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema VIEWS TABLE_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL -def information_schema VIEWS VIEW_DEFINITION 4 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL +def information_schema TRIGGERS DATABASE_COLLATION 22 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL +def information_schema TRIGGERS DEFINER 19 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) select NEVER NULL +def information_schema TRIGGERS EVENT_MANIPULATION 4 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) select NEVER NULL +def information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema TRIGGERS SQL_MODE 18 NULL NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) select NEVER NULL +def information_schema TRIGGERS TRIGGER_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema TRIGGERS TRIGGER_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema TRIGGERS TRIGGER_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema USER_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) select NEVER NULL +def information_schema USER_PRIVILEGES IS_GRANTABLE 4 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL +def information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema USER_STATISTICS ACCESS_DENIED 22 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema USER_STATISTICS BINLOG_BYTES_WRITTEN 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema USER_STATISTICS BUSY_TIME 5 NULL NO double NULL NULL 21 NULL NULL NULL NULL double select NEVER NULL +def information_schema USER_STATISTICS BYTES_RECEIVED 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema USER_STATISTICS BYTES_SENT 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema USER_STATISTICS COMMIT_TRANSACTIONS 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema USER_STATISTICS CONCURRENT_CONNECTIONS 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select NEVER NULL +def information_schema USER_STATISTICS CONNECTED_TIME 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select NEVER NULL +def information_schema USER_STATISTICS CPU_TIME 6 NULL NO double NULL NULL 21 NULL NULL NULL NULL double select NEVER NULL +def information_schema USER_STATISTICS DENIED_CONNECTIONS 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema USER_STATISTICS EMPTY_QUERIES 23 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema USER_STATISTICS LOST_CONNECTIONS 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema USER_STATISTICS MAX_STATEMENT_TIME_EXCEEDED 25 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema USER_STATISTICS OTHER_COMMANDS 17 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema USER_STATISTICS ROLLBACK_TRANSACTIONS 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema USER_STATISTICS ROWS_DELETED 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema USER_STATISTICS ROWS_INSERTED 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema USER_STATISTICS ROWS_READ 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema USER_STATISTICS ROWS_SENT 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema USER_STATISTICS ROWS_UPDATED 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema USER_STATISTICS SELECT_COMMANDS 15 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema USER_STATISTICS TOTAL_CONNECTIONS 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select NEVER NULL +def information_schema USER_STATISTICS TOTAL_SSL_CONNECTIONS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL +def information_schema USER_STATISTICS UPDATE_COMMANDS 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL +def information_schema USER_STATISTICS USER 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select NEVER NULL +def information_schema VIEWS ALGORITHM 11 NULL NO varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) select NEVER NULL +def information_schema VIEWS CHARACTER_SET_CLIENT 9 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL +def information_schema VIEWS CHECK_OPTION 5 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) select NEVER NULL +def information_schema VIEWS COLLATION_CONNECTION 10 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL +def information_schema VIEWS DEFINER 7 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) select NEVER NULL +def information_schema VIEWS IS_UPDATABLE 6 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL +def information_schema VIEWS SECURITY_TYPE 8 NULL NO varchar 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(7) select NEVER NULL +def information_schema VIEWS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL +def information_schema VIEWS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema VIEWS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL +def information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL ########################################################################## # Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH ########################################################################## diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result index d021272b8c2..e3b2a7d58ed 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result @@ -3,126 +3,126 @@ WHERE table_schema = 'information_schema' AND table_name <> 'profiling' AND table_name not like 'innodb_%' ORDER BY table_schema, table_name, column_name; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION -def information_schema ALL_PLUGINS LOAD_OPTION 11 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema ALL_PLUGINS LOAD_OPTION 11 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema ALL_PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema ALL_PLUGINS PLUGIN_AUTH_VERSION 13 NULL YES varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL def information_schema ALL_PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL def information_schema ALL_PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema ALL_PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL -def information_schema ALL_PLUGINS PLUGIN_LICENSE 10 '' NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL -def information_schema ALL_PLUGINS PLUGIN_MATURITY 12 '' NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) NEVER NULL -def information_schema ALL_PLUGINS PLUGIN_NAME 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema ALL_PLUGINS PLUGIN_STATUS 3 '' NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL -def information_schema ALL_PLUGINS PLUGIN_TYPE 4 '' NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL -def information_schema ALL_PLUGINS PLUGIN_TYPE_VERSION 5 '' NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL -def information_schema ALL_PLUGINS PLUGIN_VERSION 2 '' NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL -def information_schema APPLICABLE_ROLES GRANTEE 1 '' NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) NEVER NULL +def information_schema ALL_PLUGINS PLUGIN_LICENSE 10 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL +def information_schema ALL_PLUGINS PLUGIN_MATURITY 12 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) NEVER NULL +def information_schema ALL_PLUGINS PLUGIN_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema ALL_PLUGINS PLUGIN_STATUS 3 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL +def information_schema ALL_PLUGINS PLUGIN_TYPE 4 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL +def information_schema ALL_PLUGINS PLUGIN_TYPE_VERSION 5 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL +def information_schema ALL_PLUGINS PLUGIN_VERSION 2 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL +def information_schema APPLICABLE_ROLES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) NEVER NULL def information_schema APPLICABLE_ROLES IS_DEFAULT 4 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL -def information_schema APPLICABLE_ROLES IS_GRANTABLE 3 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL -def information_schema APPLICABLE_ROLES ROLE_NAME 2 '' NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) NEVER NULL -def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL -def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL -def information_schema CHARACTER_SETS DESCRIPTION 3 '' NO varchar 60 180 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(60) NEVER NULL -def information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) NEVER NULL -def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 6 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL -def information_schema CHECK_CONSTRAINTS CONSTRAINT_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema CHECK_CONSTRAINTS LEVEL 5 '' NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) NEVER NULL -def information_schema CHECK_CONSTRAINTS TABLE_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema CLIENT_STATISTICS ACCESS_DENIED 22 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema CLIENT_STATISTICS BINLOG_BYTES_WRITTEN 9 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema CLIENT_STATISTICS BUSY_TIME 5 0 NO double NULL NULL 21 NULL NULL NULL NULL double NEVER NULL -def information_schema CLIENT_STATISTICS BYTES_RECEIVED 7 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema CLIENT_STATISTICS BYTES_SENT 8 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema CLIENT_STATISTICS CLIENT 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema CLIENT_STATISTICS COMMIT_TRANSACTIONS 18 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema CLIENT_STATISTICS CONCURRENT_CONNECTIONS 3 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema CLIENT_STATISTICS CONNECTED_TIME 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema CLIENT_STATISTICS CPU_TIME 6 0 NO double NULL NULL 21 NULL NULL NULL NULL double NEVER NULL -def information_schema CLIENT_STATISTICS DENIED_CONNECTIONS 20 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema CLIENT_STATISTICS EMPTY_QUERIES 23 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema CLIENT_STATISTICS LOST_CONNECTIONS 21 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema CLIENT_STATISTICS MAX_STATEMENT_TIME_EXCEEDED 25 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema CLIENT_STATISTICS OTHER_COMMANDS 17 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema CLIENT_STATISTICS ROLLBACK_TRANSACTIONS 19 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema CLIENT_STATISTICS ROWS_DELETED 12 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema CLIENT_STATISTICS ROWS_INSERTED 13 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema CLIENT_STATISTICS ROWS_READ 10 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema CLIENT_STATISTICS ROWS_SENT 11 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema CLIENT_STATISTICS ROWS_UPDATED 14 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema CLIENT_STATISTICS SELECT_COMMANDS 15 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema CLIENT_STATISTICS TOTAL_CONNECTIONS 2 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema CLIENT_STATISTICS TOTAL_SSL_CONNECTIONS 24 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema CLIENT_STATISTICS UPDATE_COMMANDS 16 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema COLLATIONS CHARACTER_SET_NAME 2 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL -def information_schema COLLATIONS COLLATION_NAME 1 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL -def information_schema COLLATIONS ID 3 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(11) NEVER NULL -def information_schema COLLATIONS IS_COMPILED 5 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL -def information_schema COLLATIONS IS_DEFAULT 4 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL -def information_schema COLLATIONS SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) NEVER NULL -def information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL -def information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL +def information_schema APPLICABLE_ROLES IS_GRANTABLE 3 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL +def information_schema APPLICABLE_ROLES ROLE_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) NEVER NULL +def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL +def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL +def information_schema CHARACTER_SETS DESCRIPTION 3 NULL NO varchar 60 180 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(60) NEVER NULL +def information_schema CHARACTER_SETS MAXLEN 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) NEVER NULL +def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 6 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL +def information_schema CHECK_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema CHECK_CONSTRAINTS LEVEL 5 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) NEVER NULL +def information_schema CHECK_CONSTRAINTS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema CLIENT_STATISTICS ACCESS_DENIED 22 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema CLIENT_STATISTICS BINLOG_BYTES_WRITTEN 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema CLIENT_STATISTICS BUSY_TIME 5 NULL NO double NULL NULL 21 NULL NULL NULL NULL double NEVER NULL +def information_schema CLIENT_STATISTICS BYTES_RECEIVED 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema CLIENT_STATISTICS BYTES_SENT 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema CLIENT_STATISTICS CLIENT 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema CLIENT_STATISTICS COMMIT_TRANSACTIONS 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema CLIENT_STATISTICS CONCURRENT_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema CLIENT_STATISTICS CONNECTED_TIME 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema CLIENT_STATISTICS CPU_TIME 6 NULL NO double NULL NULL 21 NULL NULL NULL NULL double NEVER NULL +def information_schema CLIENT_STATISTICS DENIED_CONNECTIONS 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema CLIENT_STATISTICS EMPTY_QUERIES 23 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema CLIENT_STATISTICS LOST_CONNECTIONS 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema CLIENT_STATISTICS MAX_STATEMENT_TIME_EXCEEDED 25 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema CLIENT_STATISTICS OTHER_COMMANDS 17 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema CLIENT_STATISTICS ROLLBACK_TRANSACTIONS 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema CLIENT_STATISTICS ROWS_DELETED 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema CLIENT_STATISTICS ROWS_INSERTED 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema CLIENT_STATISTICS ROWS_READ 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema CLIENT_STATISTICS ROWS_SENT 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema CLIENT_STATISTICS ROWS_UPDATED 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema CLIENT_STATISTICS SELECT_COMMANDS 15 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema CLIENT_STATISTICS TOTAL_CONNECTIONS 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema CLIENT_STATISTICS TOTAL_SSL_CONNECTIONS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL +def information_schema CLIENT_STATISTICS UPDATE_COMMANDS 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema COLLATIONS CHARACTER_SET_NAME 2 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL +def information_schema COLLATIONS COLLATION_NAME 1 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL +def information_schema COLLATIONS ID 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(11) NEVER NULL +def information_schema COLLATIONS IS_COMPILED 5 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL +def information_schema COLLATIONS IS_DEFAULT 4 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL +def information_schema COLLATIONS SORTLEN 6 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) NEVER NULL +def information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL +def information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL def information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema COLUMNS CHARACTER_SET_NAME 14 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL def information_schema COLUMNS COLLATION_NAME 15 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL -def information_schema COLUMNS COLUMN_COMMENT 20 '' NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) NEVER NULL +def information_schema COLUMNS COLUMN_COMMENT 20 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) NEVER NULL def information_schema COLUMNS COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL -def information_schema COLUMNS COLUMN_KEY 17 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL -def information_schema COLUMNS COLUMN_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema COLUMNS COLUMN_TYPE 16 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL -def information_schema COLUMNS DATA_TYPE 8 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema COLUMNS COLUMN_KEY 17 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL +def information_schema COLUMNS COLUMN_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema COLUMNS COLUMN_TYPE 16 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL +def information_schema COLUMNS DATA_TYPE 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema COLUMNS DATETIME_PRECISION 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema COLUMNS EXTRA 18 '' NO varchar 30 90 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(30) NEVER NULL +def information_schema COLUMNS EXTRA 18 NULL NO varchar 30 90 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(30) NEVER NULL def information_schema COLUMNS GENERATION_EXPRESSION 22 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL -def information_schema COLUMNS IS_GENERATED 21 '' NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) NEVER NULL -def information_schema COLUMNS IS_NULLABLE 7 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL +def information_schema COLUMNS IS_GENERATED 21 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) NEVER NULL +def information_schema COLUMNS IS_NULLABLE 7 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL def information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema COLUMNS ORDINAL_POSITION 5 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema COLUMNS PRIVILEGES 19 '' NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL -def information_schema COLUMNS TABLE_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema COLUMNS TABLE_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema COLUMNS TABLE_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema COLUMN_PRIVILEGES COLUMN_NAME 5 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema COLUMN_PRIVILEGES GRANTEE 1 '' NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) NEVER NULL -def information_schema COLUMN_PRIVILEGES IS_GRANTABLE 7 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL -def information_schema COLUMN_PRIVILEGES PRIVILEGE_TYPE 6 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema COLUMN_PRIVILEGES TABLE_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema COLUMNS ORDINAL_POSITION 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL +def information_schema COLUMNS PRIVILEGES 19 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL +def information_schema COLUMNS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema COLUMNS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema COLUMNS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema COLUMN_PRIVILEGES COLUMN_NAME 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema COLUMN_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) NEVER NULL +def information_schema COLUMN_PRIVILEGES IS_GRANTABLE 7 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL +def information_schema COLUMN_PRIVILEGES PRIVILEGE_TYPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema COLUMN_PRIVILEGES TABLE_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema ENABLED_ROLES ROLE_NAME 1 NULL YES varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) NEVER NULL -def information_schema ENGINES COMMENT 3 '' NO varchar 160 480 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(160) NEVER NULL -def information_schema ENGINES ENGINE 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema ENGINES COMMENT 3 NULL NO varchar 160 480 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(160) NEVER NULL +def information_schema ENGINES ENGINE 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema ENGINES SAVEPOINTS 6 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL -def information_schema ENGINES SUPPORT 2 '' NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) NEVER NULL +def information_schema ENGINES SUPPORT 2 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) NEVER NULL def information_schema ENGINES TRANSACTIONS 4 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL def information_schema ENGINES XA 5 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL -def information_schema EVENTS CHARACTER_SET_CLIENT 22 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL -def information_schema EVENTS COLLATION_CONNECTION 23 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL -def information_schema EVENTS CREATED 17 '0000-00-00 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL -def information_schema EVENTS DATABASE_COLLATION 24 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL -def information_schema EVENTS DEFINER 4 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) NEVER NULL +def information_schema EVENTS CHARACTER_SET_CLIENT 22 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL +def information_schema EVENTS COLLATION_CONNECTION 23 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL +def information_schema EVENTS CREATED 17 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL +def information_schema EVENTS DATABASE_COLLATION 24 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL +def information_schema EVENTS DEFINER 4 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) NEVER NULL def information_schema EVENTS ENDS 14 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL -def information_schema EVENTS EVENT_BODY 6 '' NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) NEVER NULL -def information_schema EVENTS EVENT_CATALOG 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema EVENTS EVENT_COMMENT 20 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema EVENTS EVENT_DEFINITION 7 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL -def information_schema EVENTS EVENT_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema EVENTS EVENT_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema EVENTS EVENT_TYPE 8 '' NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) NEVER NULL +def information_schema EVENTS EVENT_BODY 6 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) NEVER NULL +def information_schema EVENTS EVENT_CATALOG 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema EVENTS EVENT_COMMENT 20 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema EVENTS EVENT_DEFINITION 7 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL +def information_schema EVENTS EVENT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema EVENTS EVENT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema EVENTS EVENT_TYPE 8 NULL NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) NEVER NULL def information_schema EVENTS EXECUTE_AT 9 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL def information_schema EVENTS INTERVAL_FIELD 11 NULL YES varchar 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(18) NEVER NULL def information_schema EVENTS INTERVAL_VALUE 10 NULL YES varchar 256 768 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(256) NEVER NULL -def information_schema EVENTS LAST_ALTERED 18 '0000-00-00 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL +def information_schema EVENTS LAST_ALTERED 18 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL def information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL -def information_schema EVENTS ON_COMPLETION 16 '' NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) NEVER NULL -def information_schema EVENTS ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) NEVER NULL -def information_schema EVENTS SQL_MODE 12 '' NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) NEVER NULL +def information_schema EVENTS ON_COMPLETION 16 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) NEVER NULL +def information_schema EVENTS ORIGINATOR 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) NEVER NULL +def information_schema EVENTS SQL_MODE 12 NULL NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) NEVER NULL def information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL -def information_schema EVENTS STATUS 15 '' NO varchar 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(18) NEVER NULL -def information_schema EVENTS TIME_ZONE 5 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema EVENTS STATUS 15 NULL NO varchar 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(18) NEVER NULL +def information_schema EVENTS TIME_ZONE 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema FILES AUTOEXTEND_SIZE 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema FILES AVG_ROW_LENGTH 28 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL @@ -132,12 +132,12 @@ def information_schema FILES CREATION_TIME 20 NULL YES datetime NULL NULL NULL N def information_schema FILES DATA_FREE 32 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema FILES DATA_LENGTH 29 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema FILES DELETED_ROWS 12 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL -def information_schema FILES ENGINE 10 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema FILES EXTENT_SIZE 16 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL +def information_schema FILES ENGINE 10 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema FILES EXTENT_SIZE 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL def information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(255) NEVER NULL -def information_schema FILES FILE_ID 1 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL +def information_schema FILES FILE_ID 1 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL def information_schema FILES FILE_NAME 2 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema FILES FILE_TYPE 3 '' NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL +def information_schema FILES FILE_TYPE 3 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL def information_schema FILES FREE_EXTENTS 14 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL def information_schema FILES FULLTEXT_KEYS 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema FILES INDEX_LENGTH 31 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL @@ -150,9 +150,9 @@ def information_schema FILES MAXIMUM_SIZE 18 NULL YES bigint NULL NULL 20 0 NULL def information_schema FILES MAX_DATA_LENGTH 30 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema FILES RECOVER_TIME 23 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL def information_schema FILES ROW_FORMAT 26 NULL YES varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) NEVER NULL -def information_schema FILES STATUS 37 '' NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL +def information_schema FILES STATUS 37 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL def information_schema FILES TABLESPACE_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema FILES TABLE_CATALOG 5 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema FILES TABLE_CATALOG 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema FILES TABLE_NAME 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema FILES TABLE_ROWS 27 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema FILES TABLE_SCHEMA 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL @@ -161,82 +161,82 @@ def information_schema FILES TRANSACTION_COUNTER 24 NULL YES bigint NULL NULL 19 def information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL def information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL def information_schema FILES VERSION 25 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema GEOMETRY_COLUMNS COORD_DIMENSION 11 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL -def information_schema GEOMETRY_COLUMNS F_GEOMETRY_COLUMN 4 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema GEOMETRY_COLUMNS F_TABLE_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema GEOMETRY_COLUMNS F_TABLE_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema GEOMETRY_COLUMNS F_TABLE_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema GEOMETRY_COLUMNS GEOMETRY_TYPE 10 0 NO int NULL NULL 10 0 NULL NULL NULL int(7) NEVER NULL -def information_schema GEOMETRY_COLUMNS G_GEOMETRY_COLUMN 8 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema GEOMETRY_COLUMNS G_TABLE_CATALOG 5 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema GEOMETRY_COLUMNS G_TABLE_NAME 7 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema GEOMETRY_COLUMNS G_TABLE_SCHEMA 6 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema GEOMETRY_COLUMNS MAX_PPR 12 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL -def information_schema GEOMETRY_COLUMNS SRID 13 0 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) NEVER NULL -def information_schema GEOMETRY_COLUMNS STORAGE_TYPE 9 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL -def information_schema GLOBAL_STATUS VARIABLE_NAME 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 '' NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL -def information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 '' NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL -def information_schema INDEX_STATISTICS INDEX_NAME 3 '' NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL -def information_schema INDEX_STATISTICS ROWS_READ 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema INDEX_STATISTICS TABLE_NAME 2 '' NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL -def information_schema INDEX_STATISTICS TABLE_SCHEMA 1 '' NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL +def information_schema GEOMETRY_COLUMNS COORD_DIMENSION 11 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL +def information_schema GEOMETRY_COLUMNS F_GEOMETRY_COLUMN 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema GEOMETRY_COLUMNS F_TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema GEOMETRY_COLUMNS F_TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema GEOMETRY_COLUMNS F_TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema GEOMETRY_COLUMNS GEOMETRY_TYPE 10 NULL NO int NULL NULL 10 0 NULL NULL NULL int(7) NEVER NULL +def information_schema GEOMETRY_COLUMNS G_GEOMETRY_COLUMN 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema GEOMETRY_COLUMNS G_TABLE_CATALOG 5 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema GEOMETRY_COLUMNS G_TABLE_NAME 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema GEOMETRY_COLUMNS G_TABLE_SCHEMA 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema GEOMETRY_COLUMNS MAX_PPR 12 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL +def information_schema GEOMETRY_COLUMNS SRID 13 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) NEVER NULL +def information_schema GEOMETRY_COLUMNS STORAGE_TYPE 9 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL +def information_schema GLOBAL_STATUS VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL +def information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL +def information_schema INDEX_STATISTICS INDEX_NAME 3 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL +def information_schema INDEX_STATISTICS ROWS_READ 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema INDEX_STATISTICS TABLE_NAME 2 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL +def information_schema INDEX_STATISTICS TABLE_SCHEMA 1 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL def information_schema KEYWORDS WORD 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema KEY_CACHES BLOCK_SIZE 5 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema KEY_CACHES DIRTY_BLOCKS 8 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema KEY_CACHES FULL_SIZE 4 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema KEY_CACHES KEY_CACHE_NAME 1 '' NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL -def information_schema KEY_CACHES READS 10 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema KEY_CACHES READ_REQUESTS 9 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL +def information_schema KEY_CACHES BLOCK_SIZE 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL +def information_schema KEY_CACHES DIRTY_BLOCKS 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL +def information_schema KEY_CACHES FULL_SIZE 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL +def information_schema KEY_CACHES KEY_CACHE_NAME 1 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL +def information_schema KEY_CACHES READS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL +def information_schema KEY_CACHES READ_REQUESTS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema KEY_CACHES SEGMENTS 2 NULL YES int NULL NULL 10 0 NULL NULL NULL int(3) unsigned NEVER NULL def information_schema KEY_CACHES SEGMENT_NUMBER 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(3) unsigned NEVER NULL -def information_schema KEY_CACHES UNUSED_BLOCKS 7 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema KEY_CACHES USED_BLOCKS 6 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema KEY_CACHES WRITES 12 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema KEY_CACHES WRITE_REQUESTS 11 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema KEY_COLUMN_USAGE COLUMN_NAME 7 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema KEY_COLUMN_USAGE ORDINAL_POSITION 8 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) NEVER NULL +def information_schema KEY_CACHES UNUSED_BLOCKS 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL +def information_schema KEY_CACHES USED_BLOCKS 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL +def information_schema KEY_CACHES WRITES 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL +def information_schema KEY_CACHES WRITE_REQUESTS 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL +def information_schema KEY_COLUMN_USAGE COLUMN_NAME 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema KEY_COLUMN_USAGE ORDINAL_POSITION 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) NEVER NULL def information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT 9 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(10) NEVER NULL def information_schema KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_NAME 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema KEY_COLUMN_USAGE TABLE_NAME 6 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema OPTIMIZER_TRACE INSUFFICIENT_PRIVILEGES 4 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) NEVER NULL -def information_schema OPTIMIZER_TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE 3 0 NO int NULL NULL 10 0 NULL NULL NULL int(20) NEVER NULL -def information_schema OPTIMIZER_TRACE QUERY 1 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL -def information_schema OPTIMIZER_TRACE TRACE 2 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL +def information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema KEY_COLUMN_USAGE TABLE_NAME 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema OPTIMIZER_TRACE INSUFFICIENT_PRIVILEGES 4 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) NEVER NULL +def information_schema OPTIMIZER_TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(20) NEVER NULL +def information_schema OPTIMIZER_TRACE QUERY 1 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL +def information_schema OPTIMIZER_TRACE TRACE 2 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL def information_schema PARAMETERS CHARACTER_MAXIMUM_LENGTH 8 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL def information_schema PARAMETERS CHARACTER_OCTET_LENGTH 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL def information_schema PARAMETERS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema PARAMETERS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema PARAMETERS DATA_TYPE 7 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema PARAMETERS DATA_TYPE 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema PARAMETERS DATETIME_PRECISION 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema PARAMETERS DTD_IDENTIFIER 15 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL +def information_schema PARAMETERS DTD_IDENTIFIER 15 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL def information_schema PARAMETERS NUMERIC_PRECISION 10 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL def information_schema PARAMETERS NUMERIC_SCALE 11 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL -def information_schema PARAMETERS ORDINAL_POSITION 4 0 NO int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL +def information_schema PARAMETERS ORDINAL_POSITION 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL def information_schema PARAMETERS PARAMETER_MODE 5 NULL YES varchar 5 15 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(5) NEVER NULL def information_schema PARAMETERS PARAMETER_NAME 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema PARAMETERS ROUTINE_TYPE 16 '' NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) NEVER NULL -def information_schema PARAMETERS SPECIFIC_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema PARAMETERS SPECIFIC_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema PARAMETERS SPECIFIC_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema PARTITIONS AVG_ROW_LENGTH 14 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL +def information_schema PARAMETERS ROUTINE_TYPE 16 NULL NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) NEVER NULL +def information_schema PARAMETERS SPECIFIC_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema PARAMETERS SPECIFIC_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema PARAMETERS SPECIFIC_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema PARTITIONS AVG_ROW_LENGTH 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema PARTITIONS CHECKSUM 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema PARTITIONS CHECK_TIME 21 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL def information_schema PARTITIONS CREATE_TIME 19 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL -def information_schema PARTITIONS DATA_FREE 18 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema PARTITIONS DATA_LENGTH 15 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema PARTITIONS INDEX_LENGTH 17 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL +def information_schema PARTITIONS DATA_FREE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL +def information_schema PARTITIONS DATA_LENGTH 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL +def information_schema PARTITIONS INDEX_LENGTH 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema PARTITIONS MAX_DATA_LENGTH 16 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema PARTITIONS NODEGROUP 24 '' NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) NEVER NULL -def information_schema PARTITIONS PARTITION_COMMENT 23 '' NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL +def information_schema PARTITIONS NODEGROUP 24 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) NEVER NULL +def information_schema PARTITIONS PARTITION_COMMENT 23 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL def information_schema PARTITIONS PARTITION_DESCRIPTION 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL def information_schema PARTITIONS PARTITION_EXPRESSION 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL def information_schema PARTITIONS PARTITION_METHOD 8 NULL YES varchar 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(18) NEVER NULL @@ -247,136 +247,136 @@ def information_schema PARTITIONS SUBPARTITION_METHOD 9 NULL YES varchar 12 36 N def information_schema PARTITIONS SUBPARTITION_NAME 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema PARTITIONS TABLESPACE_NAME 25 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema PARTITIONS TABLE_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema PARTITIONS TABLE_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema PARTITIONS TABLE_ROWS 13 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema PARTITIONS TABLE_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema PARTITIONS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema PARTITIONS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema PARTITIONS TABLE_ROWS 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL +def information_schema PARTITIONS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema PARTITIONS UPDATE_TIME 20 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL -def information_schema PLUGINS LOAD_OPTION 11 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema PLUGINS LOAD_OPTION 11 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema PLUGINS PLUGIN_AUTH_VERSION 13 NULL YES varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL def information_schema PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL def information_schema PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL -def information_schema PLUGINS PLUGIN_LICENSE 10 '' NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL -def information_schema PLUGINS PLUGIN_MATURITY 12 '' NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) NEVER NULL -def information_schema PLUGINS PLUGIN_NAME 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema PLUGINS PLUGIN_STATUS 3 '' NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL -def information_schema PLUGINS PLUGIN_TYPE 4 '' NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL -def information_schema PLUGINS PLUGIN_TYPE_VERSION 5 '' NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL -def information_schema PLUGINS PLUGIN_VERSION 2 '' NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL -def information_schema PROCESSLIST COMMAND 5 '' NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL +def information_schema PLUGINS PLUGIN_LICENSE 10 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL +def information_schema PLUGINS PLUGIN_MATURITY 12 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) NEVER NULL +def information_schema PLUGINS PLUGIN_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema PLUGINS PLUGIN_STATUS 3 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL +def information_schema PLUGINS PLUGIN_TYPE 4 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL +def information_schema PLUGINS PLUGIN_TYPE_VERSION 5 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL +def information_schema PLUGINS PLUGIN_VERSION 2 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL +def information_schema PROCESSLIST COMMAND 5 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL def information_schema PROCESSLIST DB 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema PROCESSLIST EXAMINED_ROWS 15 0 NO int NULL NULL 10 0 NULL NULL NULL int(7) NEVER NULL -def information_schema PROCESSLIST HOST 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema PROCESSLIST ID 1 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL +def information_schema PROCESSLIST EXAMINED_ROWS 15 NULL NO int NULL NULL 10 0 NULL NULL NULL int(7) NEVER NULL +def information_schema PROCESSLIST HOST 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema PROCESSLIST ID 1 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL def information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL def information_schema PROCESSLIST INFO_BINARY 17 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob NEVER NULL -def information_schema PROCESSLIST MAX_MEMORY_USED 14 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(7) NEVER NULL -def information_schema PROCESSLIST MAX_STAGE 11 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL -def information_schema PROCESSLIST MEMORY_USED 13 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(7) NEVER NULL -def information_schema PROCESSLIST PROGRESS 12 0.000 NO decimal NULL NULL 7 3 NULL NULL NULL decimal(7,3) NEVER NULL -def information_schema PROCESSLIST QUERY_ID 16 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL -def information_schema PROCESSLIST STAGE 10 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL +def information_schema PROCESSLIST MAX_MEMORY_USED 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(7) NEVER NULL +def information_schema PROCESSLIST MAX_STAGE 11 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL +def information_schema PROCESSLIST MEMORY_USED 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(7) NEVER NULL +def information_schema PROCESSLIST PROGRESS 12 NULL NO decimal NULL NULL 7 3 NULL NULL NULL decimal(7,3) NEVER NULL +def information_schema PROCESSLIST QUERY_ID 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL +def information_schema PROCESSLIST STAGE 10 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL def information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema PROCESSLIST TID 18 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL -def information_schema PROCESSLIST TIME 6 0 NO int NULL NULL 10 0 NULL NULL NULL int(7) NEVER NULL -def information_schema PROCESSLIST TIME_MS 9 0.000 NO decimal NULL NULL 22 3 NULL NULL NULL decimal(22,3) NEVER NULL -def information_schema PROCESSLIST USER 2 '' NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) NEVER NULL -def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema REFERENTIAL_CONSTRAINTS DELETE_RULE 9 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema REFERENTIAL_CONSTRAINTS MATCH_OPTION 7 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema REFERENTIAL_CONSTRAINTS REFERENCED_TABLE_NAME 11 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema REFERENTIAL_CONSTRAINTS TABLE_NAME 10 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_CATALOG 4 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema PROCESSLIST TID 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL +def information_schema PROCESSLIST TIME 6 NULL NO int NULL NULL 10 0 NULL NULL NULL int(7) NEVER NULL +def information_schema PROCESSLIST TIME_MS 9 NULL NO decimal NULL NULL 22 3 NULL NULL NULL decimal(22,3) NEVER NULL +def information_schema PROCESSLIST USER 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) NEVER NULL +def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema REFERENTIAL_CONSTRAINTS DELETE_RULE 9 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema REFERENTIAL_CONSTRAINTS MATCH_OPTION 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema REFERENTIAL_CONSTRAINTS REFERENCED_TABLE_NAME 11 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema REFERENTIAL_CONSTRAINTS TABLE_NAME 10 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_CATALOG 4 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_NAME 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_SCHEMA 5 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema REFERENTIAL_CONSTRAINTS UPDATE_RULE 8 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_SCHEMA 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema REFERENTIAL_CONSTRAINTS UPDATE_RULE 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema ROUTINES CHARACTER_MAXIMUM_LENGTH 7 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL def information_schema ROUTINES CHARACTER_OCTET_LENGTH 8 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL -def information_schema ROUTINES CHARACTER_SET_CLIENT 29 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL +def information_schema ROUTINES CHARACTER_SET_CLIENT 29 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL def information_schema ROUTINES CHARACTER_SET_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema ROUTINES COLLATION_CONNECTION 30 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL +def information_schema ROUTINES COLLATION_CONNECTION 30 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL def information_schema ROUTINES COLLATION_NAME 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema ROUTINES CREATED 24 '0000-00-00 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL -def information_schema ROUTINES DATABASE_COLLATION 31 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL -def information_schema ROUTINES DATA_TYPE 6 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema ROUTINES CREATED 24 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL +def information_schema ROUTINES DATABASE_COLLATION 31 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL +def information_schema ROUTINES DATA_TYPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema ROUTINES DATETIME_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema ROUTINES DEFINER 28 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) NEVER NULL +def information_schema ROUTINES DEFINER 28 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) NEVER NULL def information_schema ROUTINES DTD_IDENTIFIER 14 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL def information_schema ROUTINES EXTERNAL_LANGUAGE 18 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema ROUTINES EXTERNAL_NAME 17 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema ROUTINES IS_DETERMINISTIC 20 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL -def information_schema ROUTINES LAST_ALTERED 25 '0000-00-00 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL +def information_schema ROUTINES IS_DETERMINISTIC 20 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL +def information_schema ROUTINES LAST_ALTERED 25 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL def information_schema ROUTINES NUMERIC_PRECISION 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL def information_schema ROUTINES NUMERIC_SCALE 10 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL -def information_schema ROUTINES PARAMETER_STYLE 19 '' NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) NEVER NULL -def information_schema ROUTINES ROUTINE_BODY 15 '' NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) NEVER NULL -def information_schema ROUTINES ROUTINE_CATALOG 2 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema ROUTINES ROUTINE_COMMENT 27 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL +def information_schema ROUTINES PARAMETER_STYLE 19 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) NEVER NULL +def information_schema ROUTINES ROUTINE_BODY 15 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) NEVER NULL +def information_schema ROUTINES ROUTINE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema ROUTINES ROUTINE_COMMENT 27 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL def information_schema ROUTINES ROUTINE_DEFINITION 16 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL -def information_schema ROUTINES ROUTINE_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema ROUTINES ROUTINE_SCHEMA 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema ROUTINES ROUTINE_TYPE 5 '' NO varchar 13 39 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(13) NEVER NULL -def information_schema ROUTINES SECURITY_TYPE 23 '' NO varchar 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(7) NEVER NULL -def information_schema ROUTINES SPECIFIC_NAME 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema ROUTINES SQL_DATA_ACCESS 21 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema ROUTINES SQL_MODE 26 '' NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) NEVER NULL +def information_schema ROUTINES ROUTINE_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema ROUTINES ROUTINE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema ROUTINES ROUTINE_TYPE 5 NULL NO varchar 13 39 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(13) NEVER NULL +def information_schema ROUTINES SECURITY_TYPE 23 NULL NO varchar 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(7) NEVER NULL +def information_schema ROUTINES SPECIFIC_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema ROUTINES SQL_DATA_ACCESS 21 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema ROUTINES SQL_MODE 26 NULL NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) NEVER NULL def information_schema ROUTINES SQL_PATH 22 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema SCHEMATA CATALOG_NAME 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL -def information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL -def information_schema SCHEMATA SCHEMA_COMMENT 6 '' NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) NEVER NULL -def information_schema SCHEMATA SCHEMA_NAME 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema SCHEMATA CATALOG_NAME 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL +def information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL +def information_schema SCHEMATA SCHEMA_COMMENT 6 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) NEVER NULL +def information_schema SCHEMATA SCHEMA_NAME 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema SCHEMA_PRIVILEGES GRANTEE 1 '' NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) NEVER NULL -def information_schema SCHEMA_PRIVILEGES IS_GRANTABLE 5 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL -def information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema SESSION_STATUS VARIABLE_NAME 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema SESSION_STATUS VARIABLE_VALUE 2 '' NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL -def information_schema SESSION_VARIABLES VARIABLE_NAME 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 '' NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL -def information_schema SPATIAL_REF_SYS AUTH_NAME 2 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema SPATIAL_REF_SYS AUTH_SRID 3 0 NO int NULL NULL 10 0 NULL NULL NULL int(5) NEVER NULL -def information_schema SPATIAL_REF_SYS SRID 1 0 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) NEVER NULL -def information_schema SPATIAL_REF_SYS SRTEXT 4 '' NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL +def information_schema SCHEMA_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) NEVER NULL +def information_schema SCHEMA_PRIVILEGES IS_GRANTABLE 5 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL +def information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema SESSION_STATUS VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL +def information_schema SESSION_VARIABLES VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL +def information_schema SPATIAL_REF_SYS AUTH_NAME 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema SPATIAL_REF_SYS AUTH_SRID 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(5) NEVER NULL +def information_schema SPATIAL_REF_SYS SRID 1 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) NEVER NULL +def information_schema SPATIAL_REF_SYS SRTEXT 4 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL def information_schema SQL_FUNCTIONS FUNCTION 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1) NEVER NULL -def information_schema STATISTICS COLUMN_NAME 8 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema STATISTICS COLUMN_NAME 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema STATISTICS COMMENT 15 NULL YES varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL -def information_schema STATISTICS IGNORED 17 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL -def information_schema STATISTICS INDEX_COMMENT 16 '' NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) NEVER NULL -def information_schema STATISTICS INDEX_NAME 6 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema STATISTICS INDEX_SCHEMA 5 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema STATISTICS INDEX_TYPE 14 '' NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL -def information_schema STATISTICS NON_UNIQUE 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(1) NEVER NULL -def information_schema STATISTICS NULLABLE 13 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL +def information_schema STATISTICS IGNORED 17 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL +def information_schema STATISTICS INDEX_COMMENT 16 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) NEVER NULL +def information_schema STATISTICS INDEX_NAME 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema STATISTICS INDEX_SCHEMA 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema STATISTICS INDEX_TYPE 14 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL +def information_schema STATISTICS NON_UNIQUE 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(1) NEVER NULL +def information_schema STATISTICS NULLABLE 13 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL def information_schema STATISTICS PACKED 12 NULL YES varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) NEVER NULL -def information_schema STATISTICS SEQ_IN_INDEX 7 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(2) NEVER NULL +def information_schema STATISTICS SEQ_IN_INDEX 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(2) NEVER NULL def information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(3) NEVER NULL -def information_schema STATISTICS TABLE_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema STATISTICS TABLE_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema STATISTICS TABLE_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema STATISTICS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema STATISTICS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema STATISTICS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema SYSTEM_VARIABLES COMMAND_LINE_ARGUMENT 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema SYSTEM_VARIABLES DEFAULT_VALUE 5 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL def information_schema SYSTEM_VARIABLES ENUM_VALUE_LIST 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL def information_schema SYSTEM_VARIABLES GLOBAL_VALUE 3 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL -def information_schema SYSTEM_VARIABLES GLOBAL_VALUE_ORIGIN 4 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema SYSTEM_VARIABLES GLOBAL_VALUE_ORIGIN 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema SYSTEM_VARIABLES GLOBAL_VALUE_PATH 15 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL def information_schema SYSTEM_VARIABLES NUMERIC_BLOCK_SIZE 11 NULL YES varchar 21 63 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21) NEVER NULL def information_schema SYSTEM_VARIABLES NUMERIC_MAX_VALUE 10 NULL YES varchar 21 63 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21) NEVER NULL def information_schema SYSTEM_VARIABLES NUMERIC_MIN_VALUE 9 NULL YES varchar 21 63 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21) NEVER NULL -def information_schema SYSTEM_VARIABLES READ_ONLY 13 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL +def information_schema SYSTEM_VARIABLES READ_ONLY 13 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL def information_schema SYSTEM_VARIABLES SESSION_VALUE 2 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL -def information_schema SYSTEM_VARIABLES VARIABLE_COMMENT 8 '' NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL -def information_schema SYSTEM_VARIABLES VARIABLE_NAME 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema SYSTEM_VARIABLES VARIABLE_SCOPE 6 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema SYSTEM_VARIABLES VARIABLE_TYPE 7 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema SYSTEM_VARIABLES VARIABLE_COMMENT 8 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL +def information_schema SYSTEM_VARIABLES VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema SYSTEM_VARIABLES VARIABLE_SCOPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema SYSTEM_VARIABLES VARIABLE_TYPE 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL @@ -390,104 +390,104 @@ def information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 20 0 NUL def information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema TABLES MAX_INDEX_LENGTH 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) NEVER NULL -def information_schema TABLES TABLE_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema TABLES TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL def information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL -def information_schema TABLES TABLE_COMMENT 21 '' NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL -def information_schema TABLES TABLE_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema TABLES TABLE_COMMENT 21 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL +def information_schema TABLES TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema TABLES TABLE_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema TABLES TABLE_TYPE 4 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema TABLES TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema TABLES TABLE_TYPE 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema TABLES TEMPORARY 23 NULL YES varchar 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1) NEVER NULL def information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL def information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema TABLESPACES AUTOEXTEND_SIZE 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema TABLESPACES ENGINE 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema TABLESPACES ENGINE 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema TABLESPACES EXTENT_SIZE 5 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema TABLESPACES LOGFILE_GROUP_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema TABLESPACES MAXIMUM_SIZE 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema TABLESPACES NODEGROUP_ID 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL def information_schema TABLESPACES TABLESPACE_COMMENT 9 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL -def information_schema TABLESPACES TABLESPACE_NAME 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema TABLESPACES TABLESPACE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL def information_schema TABLESPACES TABLESPACE_TYPE 3 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema TABLE_CONSTRAINTS CONSTRAINT_TYPE 6 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema TABLE_CONSTRAINTS TABLE_NAME 5 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema TABLE_CONSTRAINTS TABLE_SCHEMA 4 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema TABLE_PRIVILEGES GRANTEE 1 '' NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) NEVER NULL -def information_schema TABLE_PRIVILEGES IS_GRANTABLE 6 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL -def information_schema TABLE_PRIVILEGES PRIVILEGE_TYPE 5 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema TABLE_PRIVILEGES TABLE_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema TABLE_PRIVILEGES TABLE_SCHEMA 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema TABLE_STATISTICS ROWS_CHANGED 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema TABLE_STATISTICS ROWS_CHANGED_X_INDEXES 5 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema TABLE_STATISTICS ROWS_READ 3 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema TABLE_STATISTICS TABLE_NAME 2 '' NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL -def information_schema TABLE_STATISTICS TABLE_SCHEMA 1 '' NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL +def information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema TABLE_CONSTRAINTS CONSTRAINT_TYPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema TABLE_CONSTRAINTS TABLE_NAME 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema TABLE_CONSTRAINTS TABLE_SCHEMA 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema TABLE_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) NEVER NULL +def information_schema TABLE_PRIVILEGES IS_GRANTABLE 6 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL +def information_schema TABLE_PRIVILEGES PRIVILEGE_TYPE 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema TABLE_PRIVILEGES TABLE_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema TABLE_PRIVILEGES TABLE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema TABLE_STATISTICS ROWS_CHANGED 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema TABLE_STATISTICS ROWS_CHANGED_X_INDEXES 5 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema TABLE_STATISTICS ROWS_READ 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema TABLE_STATISTICS TABLE_NAME 2 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL +def information_schema TABLE_STATISTICS TABLE_SCHEMA 1 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL def information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL -def information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL -def information_schema TRIGGERS ACTION_ORIENTATION 11 '' NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) NEVER NULL -def information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL +def information_schema TRIGGERS ACTION_ORDER 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL +def information_schema TRIGGERS ACTION_ORIENTATION 11 NULL NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) NEVER NULL +def information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL def information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL +def information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL def information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema TRIGGERS ACTION_STATEMENT 10 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL -def information_schema TRIGGERS ACTION_TIMING 12 '' NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) NEVER NULL -def information_schema TRIGGERS CHARACTER_SET_CLIENT 20 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL -def information_schema TRIGGERS COLLATION_CONNECTION 21 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL +def information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL +def information_schema TRIGGERS ACTION_TIMING 12 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) NEVER NULL +def information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL +def information_schema TRIGGERS COLLATION_CONNECTION 21 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL def information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL 2 NULL NULL datetime(2) NEVER NULL -def information_schema TRIGGERS DATABASE_COLLATION 22 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL -def information_schema TRIGGERS DEFINER 19 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) NEVER NULL -def information_schema TRIGGERS EVENT_MANIPULATION 4 '' NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) NEVER NULL -def information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema TRIGGERS EVENT_OBJECT_TABLE 7 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema TRIGGERS SQL_MODE 18 '' NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) NEVER NULL -def information_schema TRIGGERS TRIGGER_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema TRIGGERS TRIGGER_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema TRIGGERS TRIGGER_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema USER_PRIVILEGES GRANTEE 1 '' NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) NEVER NULL -def information_schema USER_PRIVILEGES IS_GRANTABLE 4 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL -def information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema USER_PRIVILEGES TABLE_CATALOG 2 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema USER_STATISTICS ACCESS_DENIED 22 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema USER_STATISTICS BINLOG_BYTES_WRITTEN 9 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema USER_STATISTICS BUSY_TIME 5 0 NO double NULL NULL 21 NULL NULL NULL NULL double NEVER NULL -def information_schema USER_STATISTICS BYTES_RECEIVED 7 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema USER_STATISTICS BYTES_SENT 8 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema USER_STATISTICS COMMIT_TRANSACTIONS 18 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema USER_STATISTICS CONCURRENT_CONNECTIONS 3 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL -def information_schema USER_STATISTICS CONNECTED_TIME 4 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL -def information_schema USER_STATISTICS CPU_TIME 6 0 NO double NULL NULL 21 NULL NULL NULL NULL double NEVER NULL -def information_schema USER_STATISTICS DENIED_CONNECTIONS 20 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema USER_STATISTICS EMPTY_QUERIES 23 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema USER_STATISTICS LOST_CONNECTIONS 21 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema USER_STATISTICS MAX_STATEMENT_TIME_EXCEEDED 25 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema USER_STATISTICS OTHER_COMMANDS 17 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema USER_STATISTICS ROLLBACK_TRANSACTIONS 19 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema USER_STATISTICS ROWS_DELETED 12 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema USER_STATISTICS ROWS_INSERTED 13 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema USER_STATISTICS ROWS_READ 10 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema USER_STATISTICS ROWS_SENT 11 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema USER_STATISTICS ROWS_UPDATED 14 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema USER_STATISTICS SELECT_COMMANDS 15 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema USER_STATISTICS TOTAL_CONNECTIONS 2 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL -def information_schema USER_STATISTICS TOTAL_SSL_CONNECTIONS 24 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL -def information_schema USER_STATISTICS UPDATE_COMMANDS 16 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL -def information_schema USER_STATISTICS USER 1 '' NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) NEVER NULL -def information_schema VIEWS ALGORITHM 11 '' NO varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) NEVER NULL -def information_schema VIEWS CHARACTER_SET_CLIENT 9 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL -def information_schema VIEWS CHECK_OPTION 5 '' NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) NEVER NULL -def information_schema VIEWS COLLATION_CONNECTION 10 '' NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL -def information_schema VIEWS DEFINER 7 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) NEVER NULL -def information_schema VIEWS IS_UPDATABLE 6 '' NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL -def information_schema VIEWS SECURITY_TYPE 8 '' NO varchar 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(7) NEVER NULL -def information_schema VIEWS TABLE_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL -def information_schema VIEWS TABLE_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema VIEWS TABLE_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL -def information_schema VIEWS VIEW_DEFINITION 4 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL +def information_schema TRIGGERS DATABASE_COLLATION 22 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL +def information_schema TRIGGERS DEFINER 19 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) NEVER NULL +def information_schema TRIGGERS EVENT_MANIPULATION 4 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) NEVER NULL +def information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema TRIGGERS SQL_MODE 18 NULL NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) NEVER NULL +def information_schema TRIGGERS TRIGGER_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema TRIGGERS TRIGGER_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema TRIGGERS TRIGGER_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema USER_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) NEVER NULL +def information_schema USER_PRIVILEGES IS_GRANTABLE 4 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL +def information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema USER_STATISTICS ACCESS_DENIED 22 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema USER_STATISTICS BINLOG_BYTES_WRITTEN 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema USER_STATISTICS BUSY_TIME 5 NULL NO double NULL NULL 21 NULL NULL NULL NULL double NEVER NULL +def information_schema USER_STATISTICS BYTES_RECEIVED 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema USER_STATISTICS BYTES_SENT 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema USER_STATISTICS COMMIT_TRANSACTIONS 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema USER_STATISTICS CONCURRENT_CONNECTIONS 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL +def information_schema USER_STATISTICS CONNECTED_TIME 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL +def information_schema USER_STATISTICS CPU_TIME 6 NULL NO double NULL NULL 21 NULL NULL NULL NULL double NEVER NULL +def information_schema USER_STATISTICS DENIED_CONNECTIONS 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema USER_STATISTICS EMPTY_QUERIES 23 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema USER_STATISTICS LOST_CONNECTIONS 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema USER_STATISTICS MAX_STATEMENT_TIME_EXCEEDED 25 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema USER_STATISTICS OTHER_COMMANDS 17 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema USER_STATISTICS ROLLBACK_TRANSACTIONS 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema USER_STATISTICS ROWS_DELETED 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema USER_STATISTICS ROWS_INSERTED 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema USER_STATISTICS ROWS_READ 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema USER_STATISTICS ROWS_SENT 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema USER_STATISTICS ROWS_UPDATED 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema USER_STATISTICS SELECT_COMMANDS 15 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema USER_STATISTICS TOTAL_CONNECTIONS 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL +def information_schema USER_STATISTICS TOTAL_SSL_CONNECTIONS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL +def information_schema USER_STATISTICS UPDATE_COMMANDS 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL +def information_schema USER_STATISTICS USER 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) NEVER NULL +def information_schema VIEWS ALGORITHM 11 NULL NO varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) NEVER NULL +def information_schema VIEWS CHARACTER_SET_CLIENT 9 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL +def information_schema VIEWS CHECK_OPTION 5 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) NEVER NULL +def information_schema VIEWS COLLATION_CONNECTION 10 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL +def information_schema VIEWS DEFINER 7 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) NEVER NULL +def information_schema VIEWS IS_UPDATABLE 6 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL +def information_schema VIEWS SECURITY_TYPE 8 NULL NO varchar 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(7) NEVER NULL +def information_schema VIEWS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL +def information_schema VIEWS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema VIEWS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL +def information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL ########################################################################## # Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH ########################################################################## diff --git a/mysql-test/suite/funcs_1/r/is_engines.result b/mysql-test/suite/funcs_1/r/is_engines.result index 96db819c429..09f163a3491 100644 --- a/mysql-test/suite/funcs_1/r/is_engines.result +++ b/mysql-test/suite/funcs_1/r/is_engines.result @@ -28,27 +28,27 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.ENGINES; Field Type Null Key Default Extra -ENGINE varchar(64) NO -SUPPORT varchar(8) NO -COMMENT varchar(160) NO +ENGINE varchar(64) NO NULL +SUPPORT varchar(8) NO NULL +COMMENT varchar(160) NO NULL TRANSACTIONS varchar(3) YES NULL XA varchar(3) YES NULL SAVEPOINTS varchar(3) YES NULL SHOW CREATE TABLE information_schema.ENGINES; Table Create Table ENGINES CREATE TEMPORARY TABLE `ENGINES` ( - `ENGINE` varchar(64) NOT NULL DEFAULT '', - `SUPPORT` varchar(8) NOT NULL DEFAULT '', - `COMMENT` varchar(160) NOT NULL DEFAULT '', - `TRANSACTIONS` varchar(3) DEFAULT NULL, - `XA` varchar(3) DEFAULT NULL, - `SAVEPOINTS` varchar(3) DEFAULT NULL + `ENGINE` varchar(64) NOT NULL, + `SUPPORT` varchar(8) NOT NULL, + `COMMENT` varchar(160) NOT NULL, + `TRANSACTIONS` varchar(3), + `XA` varchar(3), + `SAVEPOINTS` varchar(3) ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.ENGINES; Field Type Null Key Default Extra -ENGINE varchar(64) NO -SUPPORT varchar(8) NO -COMMENT varchar(160) NO +ENGINE varchar(64) NO NULL +SUPPORT varchar(8) NO NULL +COMMENT varchar(160) NO NULL TRANSACTIONS varchar(3) YES NULL XA varchar(3) YES NULL SAVEPOINTS varchar(3) YES NULL diff --git a/mysql-test/suite/funcs_1/r/is_events.result b/mysql-test/suite/funcs_1/r/is_events.result index 57b1943b6c2..adaa0dc6679 100644 --- a/mysql-test/suite/funcs_1/r/is_events.result +++ b/mysql-test/suite/funcs_1/r/is_events.result @@ -28,84 +28,84 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.EVENTS; Field Type Null Key Default Extra -EVENT_CATALOG varchar(64) NO -EVENT_SCHEMA varchar(64) NO -EVENT_NAME varchar(64) NO -DEFINER varchar(384) NO -TIME_ZONE varchar(64) NO -EVENT_BODY varchar(8) NO -EVENT_DEFINITION longtext NO -EVENT_TYPE varchar(9) NO +EVENT_CATALOG varchar(64) NO NULL +EVENT_SCHEMA varchar(64) NO NULL +EVENT_NAME varchar(64) NO NULL +DEFINER varchar(384) NO NULL +TIME_ZONE varchar(64) NO NULL +EVENT_BODY varchar(8) NO NULL +EVENT_DEFINITION longtext NO NULL +EVENT_TYPE varchar(9) NO NULL EXECUTE_AT datetime YES NULL INTERVAL_VALUE varchar(256) YES NULL INTERVAL_FIELD varchar(18) YES NULL -SQL_MODE varchar(8192) NO +SQL_MODE varchar(8192) NO NULL STARTS datetime YES NULL ENDS datetime YES NULL -STATUS varchar(18) NO -ON_COMPLETION varchar(12) NO -CREATED datetime NO 0000-00-00 00:00:00 -LAST_ALTERED datetime NO 0000-00-00 00:00:00 +STATUS varchar(18) NO NULL +ON_COMPLETION varchar(12) NO NULL +CREATED datetime NO NULL +LAST_ALTERED datetime NO NULL LAST_EXECUTED datetime YES NULL -EVENT_COMMENT varchar(64) NO -ORIGINATOR bigint(10) NO 0 -CHARACTER_SET_CLIENT varchar(32) NO -COLLATION_CONNECTION varchar(32) NO -DATABASE_COLLATION varchar(32) NO +EVENT_COMMENT varchar(64) NO NULL +ORIGINATOR bigint(10) NO NULL +CHARACTER_SET_CLIENT varchar(32) NO NULL +COLLATION_CONNECTION varchar(32) NO NULL +DATABASE_COLLATION varchar(32) NO NULL SHOW CREATE TABLE information_schema.EVENTS; Table Create Table EVENTS CREATE TEMPORARY TABLE `EVENTS` ( - `EVENT_CATALOG` varchar(64) NOT NULL DEFAULT '', - `EVENT_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `EVENT_NAME` varchar(64) NOT NULL DEFAULT '', - `DEFINER` varchar(384) NOT NULL DEFAULT '', - `TIME_ZONE` varchar(64) NOT NULL DEFAULT '', - `EVENT_BODY` varchar(8) NOT NULL DEFAULT '', - `EVENT_DEFINITION` longtext NOT NULL DEFAULT '', - `EVENT_TYPE` varchar(9) NOT NULL DEFAULT '', - `EXECUTE_AT` datetime DEFAULT NULL, - `INTERVAL_VALUE` varchar(256) DEFAULT NULL, - `INTERVAL_FIELD` varchar(18) DEFAULT NULL, - `SQL_MODE` varchar(8192) NOT NULL DEFAULT '', - `STARTS` datetime DEFAULT NULL, - `ENDS` datetime DEFAULT NULL, - `STATUS` varchar(18) NOT NULL DEFAULT '', - `ON_COMPLETION` varchar(12) NOT NULL DEFAULT '', - `CREATED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `LAST_EXECUTED` datetime DEFAULT NULL, - `EVENT_COMMENT` varchar(64) NOT NULL DEFAULT '', - `ORIGINATOR` bigint(10) NOT NULL DEFAULT 0, - `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', - `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', - `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT '' + `EVENT_CATALOG` varchar(64) NOT NULL, + `EVENT_SCHEMA` varchar(64) NOT NULL, + `EVENT_NAME` varchar(64) NOT NULL, + `DEFINER` varchar(384) NOT NULL, + `TIME_ZONE` varchar(64) NOT NULL, + `EVENT_BODY` varchar(8) NOT NULL, + `EVENT_DEFINITION` longtext NOT NULL, + `EVENT_TYPE` varchar(9) NOT NULL, + `EXECUTE_AT` datetime, + `INTERVAL_VALUE` varchar(256), + `INTERVAL_FIELD` varchar(18), + `SQL_MODE` varchar(8192) NOT NULL, + `STARTS` datetime, + `ENDS` datetime, + `STATUS` varchar(18) NOT NULL, + `ON_COMPLETION` varchar(12) NOT NULL, + `CREATED` datetime NOT NULL, + `LAST_ALTERED` datetime NOT NULL, + `LAST_EXECUTED` datetime, + `EVENT_COMMENT` varchar(64) NOT NULL, + `ORIGINATOR` bigint(10) NOT NULL, + `CHARACTER_SET_CLIENT` varchar(32) NOT NULL, + `COLLATION_CONNECTION` varchar(32) NOT NULL, + `DATABASE_COLLATION` varchar(32) NOT NULL ) DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.EVENTS; Field Type Null Key Default Extra -EVENT_CATALOG varchar(64) NO -EVENT_SCHEMA varchar(64) NO -EVENT_NAME varchar(64) NO -DEFINER varchar(384) NO -TIME_ZONE varchar(64) NO -EVENT_BODY varchar(8) NO -EVENT_DEFINITION longtext NO -EVENT_TYPE varchar(9) NO +EVENT_CATALOG varchar(64) NO NULL +EVENT_SCHEMA varchar(64) NO NULL +EVENT_NAME varchar(64) NO NULL +DEFINER varchar(384) NO NULL +TIME_ZONE varchar(64) NO NULL +EVENT_BODY varchar(8) NO NULL +EVENT_DEFINITION longtext NO NULL +EVENT_TYPE varchar(9) NO NULL EXECUTE_AT datetime YES NULL INTERVAL_VALUE varchar(256) YES NULL INTERVAL_FIELD varchar(18) YES NULL -SQL_MODE varchar(8192) NO +SQL_MODE varchar(8192) NO NULL STARTS datetime YES NULL ENDS datetime YES NULL -STATUS varchar(18) NO -ON_COMPLETION varchar(12) NO -CREATED datetime NO 0000-00-00 00:00:00 -LAST_ALTERED datetime NO 0000-00-00 00:00:00 +STATUS varchar(18) NO NULL +ON_COMPLETION varchar(12) NO NULL +CREATED datetime NO NULL +LAST_ALTERED datetime NO NULL LAST_EXECUTED datetime YES NULL -EVENT_COMMENT varchar(64) NO -ORIGINATOR bigint(10) NO 0 -CHARACTER_SET_CLIENT varchar(32) NO -COLLATION_CONNECTION varchar(32) NO -DATABASE_COLLATION varchar(32) NO +EVENT_COMMENT varchar(64) NO NULL +ORIGINATOR bigint(10) NO NULL +CHARACTER_SET_CLIENT varchar(32) NO NULL +COLLATION_CONNECTION varchar(32) NO NULL +DATABASE_COLLATION varchar(32) NO NULL SELECT event_catalog, event_name, event_body, event_type, event_type, status, on_completion FROM information_schema.events diff --git a/mysql-test/suite/funcs_1/r/is_key_column_usage.result b/mysql-test/suite/funcs_1/r/is_key_column_usage.result index 3add9ee9c63..7edebe8a8cb 100644 --- a/mysql-test/suite/funcs_1/r/is_key_column_usage.result +++ b/mysql-test/suite/funcs_1/r/is_key_column_usage.result @@ -28,14 +28,14 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.KEY_COLUMN_USAGE; Field Type Null Key Default Extra -CONSTRAINT_CATALOG varchar(512) NO -CONSTRAINT_SCHEMA varchar(64) NO -CONSTRAINT_NAME varchar(64) NO -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -COLUMN_NAME varchar(64) NO -ORDINAL_POSITION bigint(10) NO 0 +CONSTRAINT_CATALOG varchar(512) NO NULL +CONSTRAINT_SCHEMA varchar(64) NO NULL +CONSTRAINT_NAME varchar(64) NO NULL +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +COLUMN_NAME varchar(64) NO NULL +ORDINAL_POSITION bigint(10) NO NULL POSITION_IN_UNIQUE_CONSTRAINT bigint(10) YES NULL REFERENCED_TABLE_SCHEMA varchar(64) YES NULL REFERENCED_TABLE_NAME varchar(64) YES NULL @@ -43,29 +43,29 @@ REFERENCED_COLUMN_NAME varchar(64) YES NULL SHOW CREATE TABLE information_schema.KEY_COLUMN_USAGE; Table Create Table KEY_COLUMN_USAGE CREATE TEMPORARY TABLE `KEY_COLUMN_USAGE` ( - `CONSTRAINT_CATALOG` varchar(512) NOT NULL DEFAULT '', - `CONSTRAINT_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `CONSTRAINT_NAME` varchar(64) NOT NULL DEFAULT '', - `TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '', - `TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `TABLE_NAME` varchar(64) NOT NULL DEFAULT '', - `COLUMN_NAME` varchar(64) NOT NULL DEFAULT '', - `ORDINAL_POSITION` bigint(10) NOT NULL DEFAULT 0, - `POSITION_IN_UNIQUE_CONSTRAINT` bigint(10) DEFAULT NULL, - `REFERENCED_TABLE_SCHEMA` varchar(64) DEFAULT NULL, - `REFERENCED_TABLE_NAME` varchar(64) DEFAULT NULL, - `REFERENCED_COLUMN_NAME` varchar(64) DEFAULT NULL + `CONSTRAINT_CATALOG` varchar(512) NOT NULL, + `CONSTRAINT_SCHEMA` varchar(64) NOT NULL, + `CONSTRAINT_NAME` varchar(64) NOT NULL, + `TABLE_CATALOG` varchar(512) NOT NULL, + `TABLE_SCHEMA` varchar(64) NOT NULL, + `TABLE_NAME` varchar(64) NOT NULL, + `COLUMN_NAME` varchar(64) NOT NULL, + `ORDINAL_POSITION` bigint(10) NOT NULL, + `POSITION_IN_UNIQUE_CONSTRAINT` bigint(10), + `REFERENCED_TABLE_SCHEMA` varchar(64), + `REFERENCED_TABLE_NAME` varchar(64), + `REFERENCED_COLUMN_NAME` varchar(64) ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.KEY_COLUMN_USAGE; Field Type Null Key Default Extra -CONSTRAINT_CATALOG varchar(512) NO -CONSTRAINT_SCHEMA varchar(64) NO -CONSTRAINT_NAME varchar(64) NO -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -COLUMN_NAME varchar(64) NO -ORDINAL_POSITION bigint(10) NO 0 +CONSTRAINT_CATALOG varchar(512) NO NULL +CONSTRAINT_SCHEMA varchar(64) NO NULL +CONSTRAINT_NAME varchar(64) NO NULL +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +COLUMN_NAME varchar(64) NO NULL +ORDINAL_POSITION bigint(10) NO NULL POSITION_IN_UNIQUE_CONSTRAINT bigint(10) YES NULL REFERENCED_TABLE_SCHEMA varchar(64) YES NULL REFERENCED_TABLE_NAME varchar(64) YES NULL diff --git a/mysql-test/suite/funcs_1/r/is_key_column_usage_embedded.result b/mysql-test/suite/funcs_1/r/is_key_column_usage_embedded.result index e52eac4c45b..59b1212407f 100644 --- a/mysql-test/suite/funcs_1/r/is_key_column_usage_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_key_column_usage_embedded.result @@ -28,14 +28,14 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.KEY_COLUMN_USAGE; Field Type Null Key Default Extra -CONSTRAINT_CATALOG varchar(512) NO -CONSTRAINT_SCHEMA varchar(64) NO -CONSTRAINT_NAME varchar(64) NO -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -COLUMN_NAME varchar(64) NO -ORDINAL_POSITION bigint(10) NO 0 +CONSTRAINT_CATALOG varchar(512) NO NULL +CONSTRAINT_SCHEMA varchar(64) NO NULL +CONSTRAINT_NAME varchar(64) NO NULL +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +COLUMN_NAME varchar(64) NO NULL +ORDINAL_POSITION bigint(10) NO NULL POSITION_IN_UNIQUE_CONSTRAINT bigint(10) YES NULL REFERENCED_TABLE_SCHEMA varchar(64) YES NULL REFERENCED_TABLE_NAME varchar(64) YES NULL @@ -43,29 +43,29 @@ REFERENCED_COLUMN_NAME varchar(64) YES NULL SHOW CREATE TABLE information_schema.KEY_COLUMN_USAGE; Table Create Table KEY_COLUMN_USAGE CREATE TEMPORARY TABLE `KEY_COLUMN_USAGE` ( - `CONSTRAINT_CATALOG` varchar(512) NOT NULL DEFAULT '', - `CONSTRAINT_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `CONSTRAINT_NAME` varchar(64) NOT NULL DEFAULT '', - `TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '', - `TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `TABLE_NAME` varchar(64) NOT NULL DEFAULT '', - `COLUMN_NAME` varchar(64) NOT NULL DEFAULT '', - `ORDINAL_POSITION` bigint(10) NOT NULL DEFAULT 0, - `POSITION_IN_UNIQUE_CONSTRAINT` bigint(10) DEFAULT NULL, - `REFERENCED_TABLE_SCHEMA` varchar(64) DEFAULT NULL, - `REFERENCED_TABLE_NAME` varchar(64) DEFAULT NULL, - `REFERENCED_COLUMN_NAME` varchar(64) DEFAULT NULL + `CONSTRAINT_CATALOG` varchar(512) NOT NULL, + `CONSTRAINT_SCHEMA` varchar(64) NOT NULL, + `CONSTRAINT_NAME` varchar(64) NOT NULL, + `TABLE_CATALOG` varchar(512) NOT NULL, + `TABLE_SCHEMA` varchar(64) NOT NULL, + `TABLE_NAME` varchar(64) NOT NULL, + `COLUMN_NAME` varchar(64) NOT NULL, + `ORDINAL_POSITION` bigint(10) NOT NULL, + `POSITION_IN_UNIQUE_CONSTRAINT` bigint(10), + `REFERENCED_TABLE_SCHEMA` varchar(64), + `REFERENCED_TABLE_NAME` varchar(64), + `REFERENCED_COLUMN_NAME` varchar(64) ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.KEY_COLUMN_USAGE; Field Type Null Key Default Extra -CONSTRAINT_CATALOG varchar(512) NO -CONSTRAINT_SCHEMA varchar(64) NO -CONSTRAINT_NAME varchar(64) NO -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -COLUMN_NAME varchar(64) NO -ORDINAL_POSITION bigint(10) NO 0 +CONSTRAINT_CATALOG varchar(512) NO NULL +CONSTRAINT_SCHEMA varchar(64) NO NULL +CONSTRAINT_NAME varchar(64) NO NULL +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +COLUMN_NAME varchar(64) NO NULL +ORDINAL_POSITION bigint(10) NO NULL POSITION_IN_UNIQUE_CONSTRAINT bigint(10) YES NULL REFERENCED_TABLE_SCHEMA varchar(64) YES NULL REFERENCED_TABLE_NAME varchar(64) YES NULL diff --git a/mysql-test/suite/funcs_1/r/is_routines.result b/mysql-test/suite/funcs_1/r/is_routines.result index dab8c783b31..ba43686ac7e 100644 --- a/mysql-test/suite/funcs_1/r/is_routines.result +++ b/mysql-test/suite/funcs_1/r/is_routines.result @@ -29,12 +29,12 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.ROUTINES; Field Type Null Key Default Extra -SPECIFIC_NAME varchar(64) NO -ROUTINE_CATALOG varchar(512) NO -ROUTINE_SCHEMA varchar(64) NO -ROUTINE_NAME varchar(64) NO -ROUTINE_TYPE varchar(13) NO -DATA_TYPE varchar(64) NO +SPECIFIC_NAME varchar(64) NO NULL +ROUTINE_CATALOG varchar(512) NO NULL +ROUTINE_SCHEMA varchar(64) NO NULL +ROUTINE_NAME varchar(64) NO NULL +ROUTINE_TYPE varchar(13) NO NULL +DATA_TYPE varchar(64) NO NULL CHARACTER_MAXIMUM_LENGTH int(21) YES NULL CHARACTER_OCTET_LENGTH int(21) YES NULL NUMERIC_PRECISION int(21) YES NULL @@ -43,66 +43,66 @@ DATETIME_PRECISION bigint(21) unsigned YES NULL CHARACTER_SET_NAME varchar(64) YES NULL COLLATION_NAME varchar(64) YES NULL DTD_IDENTIFIER longtext YES NULL -ROUTINE_BODY varchar(8) NO +ROUTINE_BODY varchar(8) NO NULL ROUTINE_DEFINITION longtext YES NULL EXTERNAL_NAME varchar(64) YES NULL EXTERNAL_LANGUAGE varchar(64) YES NULL -PARAMETER_STYLE varchar(8) NO -IS_DETERMINISTIC varchar(3) NO -SQL_DATA_ACCESS varchar(64) NO +PARAMETER_STYLE varchar(8) NO NULL +IS_DETERMINISTIC varchar(3) NO NULL +SQL_DATA_ACCESS varchar(64) NO NULL SQL_PATH varchar(64) YES NULL -SECURITY_TYPE varchar(7) NO -CREATED datetime NO 0000-00-00 00:00:00 -LAST_ALTERED datetime NO 0000-00-00 00:00:00 -SQL_MODE varchar(8192) NO -ROUTINE_COMMENT longtext NO -DEFINER varchar(384) NO -CHARACTER_SET_CLIENT varchar(32) NO -COLLATION_CONNECTION varchar(32) NO -DATABASE_COLLATION varchar(32) NO +SECURITY_TYPE varchar(7) NO NULL +CREATED datetime NO NULL +LAST_ALTERED datetime NO NULL +SQL_MODE varchar(8192) NO NULL +ROUTINE_COMMENT longtext NO NULL +DEFINER varchar(384) NO NULL +CHARACTER_SET_CLIENT varchar(32) NO NULL +COLLATION_CONNECTION varchar(32) NO NULL +DATABASE_COLLATION varchar(32) NO NULL SHOW CREATE TABLE information_schema.ROUTINES; Table Create Table ROUTINES CREATE TEMPORARY TABLE `ROUTINES` ( - `SPECIFIC_NAME` varchar(64) NOT NULL DEFAULT '', - `ROUTINE_CATALOG` varchar(512) NOT NULL DEFAULT '', - `ROUTINE_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `ROUTINE_NAME` varchar(64) NOT NULL DEFAULT '', - `ROUTINE_TYPE` varchar(13) NOT NULL DEFAULT '', - `DATA_TYPE` varchar(64) NOT NULL DEFAULT '', - `CHARACTER_MAXIMUM_LENGTH` int(21) DEFAULT NULL, - `CHARACTER_OCTET_LENGTH` int(21) DEFAULT NULL, - `NUMERIC_PRECISION` int(21) DEFAULT NULL, - `NUMERIC_SCALE` int(21) DEFAULT NULL, - `DATETIME_PRECISION` bigint(21) unsigned DEFAULT NULL, - `CHARACTER_SET_NAME` varchar(64) DEFAULT NULL, - `COLLATION_NAME` varchar(64) DEFAULT NULL, - `DTD_IDENTIFIER` longtext DEFAULT NULL, - `ROUTINE_BODY` varchar(8) NOT NULL DEFAULT '', - `ROUTINE_DEFINITION` longtext DEFAULT NULL, - `EXTERNAL_NAME` varchar(64) DEFAULT NULL, - `EXTERNAL_LANGUAGE` varchar(64) DEFAULT NULL, - `PARAMETER_STYLE` varchar(8) NOT NULL DEFAULT '', - `IS_DETERMINISTIC` varchar(3) NOT NULL DEFAULT '', - `SQL_DATA_ACCESS` varchar(64) NOT NULL DEFAULT '', - `SQL_PATH` varchar(64) DEFAULT NULL, - `SECURITY_TYPE` varchar(7) NOT NULL DEFAULT '', - `CREATED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `SQL_MODE` varchar(8192) NOT NULL DEFAULT '', - `ROUTINE_COMMENT` longtext NOT NULL DEFAULT '', - `DEFINER` varchar(384) NOT NULL DEFAULT '', - `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', - `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', - `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT '' + `SPECIFIC_NAME` varchar(64) NOT NULL, + `ROUTINE_CATALOG` varchar(512) NOT NULL, + `ROUTINE_SCHEMA` varchar(64) NOT NULL, + `ROUTINE_NAME` varchar(64) NOT NULL, + `ROUTINE_TYPE` varchar(13) NOT NULL, + `DATA_TYPE` varchar(64) NOT NULL, + `CHARACTER_MAXIMUM_LENGTH` int(21), + `CHARACTER_OCTET_LENGTH` int(21), + `NUMERIC_PRECISION` int(21), + `NUMERIC_SCALE` int(21), + `DATETIME_PRECISION` bigint(21) unsigned, + `CHARACTER_SET_NAME` varchar(64), + `COLLATION_NAME` varchar(64), + `DTD_IDENTIFIER` longtext, + `ROUTINE_BODY` varchar(8) NOT NULL, + `ROUTINE_DEFINITION` longtext, + `EXTERNAL_NAME` varchar(64), + `EXTERNAL_LANGUAGE` varchar(64), + `PARAMETER_STYLE` varchar(8) NOT NULL, + `IS_DETERMINISTIC` varchar(3) NOT NULL, + `SQL_DATA_ACCESS` varchar(64) NOT NULL, + `SQL_PATH` varchar(64), + `SECURITY_TYPE` varchar(7) NOT NULL, + `CREATED` datetime NOT NULL, + `LAST_ALTERED` datetime NOT NULL, + `SQL_MODE` varchar(8192) NOT NULL, + `ROUTINE_COMMENT` longtext NOT NULL, + `DEFINER` varchar(384) NOT NULL, + `CHARACTER_SET_CLIENT` varchar(32) NOT NULL, + `COLLATION_CONNECTION` varchar(32) NOT NULL, + `DATABASE_COLLATION` varchar(32) NOT NULL ) DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.ROUTINES; Field Type Null Key Default Extra -SPECIFIC_NAME varchar(64) NO -ROUTINE_CATALOG varchar(512) NO -ROUTINE_SCHEMA varchar(64) NO -ROUTINE_NAME varchar(64) NO -ROUTINE_TYPE varchar(13) NO -DATA_TYPE varchar(64) NO +SPECIFIC_NAME varchar(64) NO NULL +ROUTINE_CATALOG varchar(512) NO NULL +ROUTINE_SCHEMA varchar(64) NO NULL +ROUTINE_NAME varchar(64) NO NULL +ROUTINE_TYPE varchar(13) NO NULL +DATA_TYPE varchar(64) NO NULL CHARACTER_MAXIMUM_LENGTH int(21) YES NULL CHARACTER_OCTET_LENGTH int(21) YES NULL NUMERIC_PRECISION int(21) YES NULL @@ -111,23 +111,23 @@ DATETIME_PRECISION bigint(21) unsigned YES NULL CHARACTER_SET_NAME varchar(64) YES NULL COLLATION_NAME varchar(64) YES NULL DTD_IDENTIFIER longtext YES NULL -ROUTINE_BODY varchar(8) NO +ROUTINE_BODY varchar(8) NO NULL ROUTINE_DEFINITION longtext YES NULL EXTERNAL_NAME varchar(64) YES NULL EXTERNAL_LANGUAGE varchar(64) YES NULL -PARAMETER_STYLE varchar(8) NO -IS_DETERMINISTIC varchar(3) NO -SQL_DATA_ACCESS varchar(64) NO +PARAMETER_STYLE varchar(8) NO NULL +IS_DETERMINISTIC varchar(3) NO NULL +SQL_DATA_ACCESS varchar(64) NO NULL SQL_PATH varchar(64) YES NULL -SECURITY_TYPE varchar(7) NO -CREATED datetime NO 0000-00-00 00:00:00 -LAST_ALTERED datetime NO 0000-00-00 00:00:00 -SQL_MODE varchar(8192) NO -ROUTINE_COMMENT longtext NO -DEFINER varchar(384) NO -CHARACTER_SET_CLIENT varchar(32) NO -COLLATION_CONNECTION varchar(32) NO -DATABASE_COLLATION varchar(32) NO +SECURITY_TYPE varchar(7) NO NULL +CREATED datetime NO NULL +LAST_ALTERED datetime NO NULL +SQL_MODE varchar(8192) NO NULL +ROUTINE_COMMENT longtext NO NULL +DEFINER varchar(384) NO NULL +CHARACTER_SET_CLIENT varchar(32) NO NULL +COLLATION_CONNECTION varchar(32) NO NULL +DATABASE_COLLATION varchar(32) NO NULL USE test; DROP PROCEDURE IF EXISTS sp_for_routines; DROP FUNCTION IF EXISTS function_for_routines; diff --git a/mysql-test/suite/funcs_1/r/is_routines_embedded.result b/mysql-test/suite/funcs_1/r/is_routines_embedded.result index f4cae574975..62f306f6d6a 100644 --- a/mysql-test/suite/funcs_1/r/is_routines_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_routines_embedded.result @@ -29,12 +29,12 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.ROUTINES; Field Type Null Key Default Extra -SPECIFIC_NAME varchar(64) NO -ROUTINE_CATALOG varchar(512) NO -ROUTINE_SCHEMA varchar(64) NO -ROUTINE_NAME varchar(64) NO -ROUTINE_TYPE varchar(13) NO -DATA_TYPE varchar(64) NO +SPECIFIC_NAME varchar(64) NO NULL +ROUTINE_CATALOG varchar(512) NO NULL +ROUTINE_SCHEMA varchar(64) NO NULL +ROUTINE_NAME varchar(64) NO NULL +ROUTINE_TYPE varchar(13) NO NULL +DATA_TYPE varchar(64) NO NULL CHARACTER_MAXIMUM_LENGTH int(21) YES NULL CHARACTER_OCTET_LENGTH int(21) YES NULL NUMERIC_PRECISION int(21) YES NULL @@ -43,66 +43,66 @@ DATETIME_PRECISION bigint(21) unsigned YES NULL CHARACTER_SET_NAME varchar(64) YES NULL COLLATION_NAME varchar(64) YES NULL DTD_IDENTIFIER longtext YES NULL -ROUTINE_BODY varchar(8) NO +ROUTINE_BODY varchar(8) NO NULL ROUTINE_DEFINITION longtext YES NULL EXTERNAL_NAME varchar(64) YES NULL EXTERNAL_LANGUAGE varchar(64) YES NULL -PARAMETER_STYLE varchar(8) NO -IS_DETERMINISTIC varchar(3) NO -SQL_DATA_ACCESS varchar(64) NO +PARAMETER_STYLE varchar(8) NO NULL +IS_DETERMINISTIC varchar(3) NO NULL +SQL_DATA_ACCESS varchar(64) NO NULL SQL_PATH varchar(64) YES NULL -SECURITY_TYPE varchar(7) NO -CREATED datetime NO 0000-00-00 00:00:00 -LAST_ALTERED datetime NO 0000-00-00 00:00:00 -SQL_MODE varchar(8192) NO -ROUTINE_COMMENT longtext NO -DEFINER varchar(384) NO -CHARACTER_SET_CLIENT varchar(32) NO -COLLATION_CONNECTION varchar(32) NO -DATABASE_COLLATION varchar(32) NO +SECURITY_TYPE varchar(7) NO NULL +CREATED datetime NO NULL +LAST_ALTERED datetime NO NULL +SQL_MODE varchar(8192) NO NULL +ROUTINE_COMMENT longtext NO NULL +DEFINER varchar(384) NO NULL +CHARACTER_SET_CLIENT varchar(32) NO NULL +COLLATION_CONNECTION varchar(32) NO NULL +DATABASE_COLLATION varchar(32) NO NULL SHOW CREATE TABLE information_schema.ROUTINES; Table Create Table ROUTINES CREATE TEMPORARY TABLE `ROUTINES` ( - `SPECIFIC_NAME` varchar(64) NOT NULL DEFAULT '', - `ROUTINE_CATALOG` varchar(512) NOT NULL DEFAULT '', - `ROUTINE_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `ROUTINE_NAME` varchar(64) NOT NULL DEFAULT '', - `ROUTINE_TYPE` varchar(13) NOT NULL DEFAULT '', - `DATA_TYPE` varchar(64) NOT NULL DEFAULT '', - `CHARACTER_MAXIMUM_LENGTH` int(21) DEFAULT NULL, - `CHARACTER_OCTET_LENGTH` int(21) DEFAULT NULL, - `NUMERIC_PRECISION` int(21) DEFAULT NULL, - `NUMERIC_SCALE` int(21) DEFAULT NULL, - `DATETIME_PRECISION` bigint(21) unsigned DEFAULT NULL, - `CHARACTER_SET_NAME` varchar(64) DEFAULT NULL, - `COLLATION_NAME` varchar(64) DEFAULT NULL, - `DTD_IDENTIFIER` longtext DEFAULT NULL, - `ROUTINE_BODY` varchar(8) NOT NULL DEFAULT '', - `ROUTINE_DEFINITION` longtext DEFAULT NULL, - `EXTERNAL_NAME` varchar(64) DEFAULT NULL, - `EXTERNAL_LANGUAGE` varchar(64) DEFAULT NULL, - `PARAMETER_STYLE` varchar(8) NOT NULL DEFAULT '', - `IS_DETERMINISTIC` varchar(3) NOT NULL DEFAULT '', - `SQL_DATA_ACCESS` varchar(64) NOT NULL DEFAULT '', - `SQL_PATH` varchar(64) DEFAULT NULL, - `SECURITY_TYPE` varchar(7) NOT NULL DEFAULT '', - `CREATED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `SQL_MODE` varchar(8192) NOT NULL DEFAULT '', - `ROUTINE_COMMENT` longtext NOT NULL DEFAULT '', - `DEFINER` varchar(384) NOT NULL DEFAULT '', - `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', - `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', - `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT '' + `SPECIFIC_NAME` varchar(64) NOT NULL, + `ROUTINE_CATALOG` varchar(512) NOT NULL, + `ROUTINE_SCHEMA` varchar(64) NOT NULL, + `ROUTINE_NAME` varchar(64) NOT NULL, + `ROUTINE_TYPE` varchar(13) NOT NULL, + `DATA_TYPE` varchar(64) NOT NULL, + `CHARACTER_MAXIMUM_LENGTH` int(21), + `CHARACTER_OCTET_LENGTH` int(21), + `NUMERIC_PRECISION` int(21), + `NUMERIC_SCALE` int(21), + `DATETIME_PRECISION` bigint(21) unsigned, + `CHARACTER_SET_NAME` varchar(64), + `COLLATION_NAME` varchar(64), + `DTD_IDENTIFIER` longtext, + `ROUTINE_BODY` varchar(8) NOT NULL, + `ROUTINE_DEFINITION` longtext, + `EXTERNAL_NAME` varchar(64), + `EXTERNAL_LANGUAGE` varchar(64), + `PARAMETER_STYLE` varchar(8) NOT NULL, + `IS_DETERMINISTIC` varchar(3) NOT NULL, + `SQL_DATA_ACCESS` varchar(64) NOT NULL, + `SQL_PATH` varchar(64), + `SECURITY_TYPE` varchar(7) NOT NULL, + `CREATED` datetime NOT NULL, + `LAST_ALTERED` datetime NOT NULL, + `SQL_MODE` varchar(8192) NOT NULL, + `ROUTINE_COMMENT` longtext NOT NULL, + `DEFINER` varchar(384) NOT NULL, + `CHARACTER_SET_CLIENT` varchar(32) NOT NULL, + `COLLATION_CONNECTION` varchar(32) NOT NULL, + `DATABASE_COLLATION` varchar(32) NOT NULL ) DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.ROUTINES; Field Type Null Key Default Extra -SPECIFIC_NAME varchar(64) NO -ROUTINE_CATALOG varchar(512) NO -ROUTINE_SCHEMA varchar(64) NO -ROUTINE_NAME varchar(64) NO -ROUTINE_TYPE varchar(13) NO -DATA_TYPE varchar(64) NO +SPECIFIC_NAME varchar(64) NO NULL +ROUTINE_CATALOG varchar(512) NO NULL +ROUTINE_SCHEMA varchar(64) NO NULL +ROUTINE_NAME varchar(64) NO NULL +ROUTINE_TYPE varchar(13) NO NULL +DATA_TYPE varchar(64) NO NULL CHARACTER_MAXIMUM_LENGTH int(21) YES NULL CHARACTER_OCTET_LENGTH int(21) YES NULL NUMERIC_PRECISION int(21) YES NULL @@ -111,23 +111,23 @@ DATETIME_PRECISION bigint(21) unsigned YES NULL CHARACTER_SET_NAME varchar(64) YES NULL COLLATION_NAME varchar(64) YES NULL DTD_IDENTIFIER longtext YES NULL -ROUTINE_BODY varchar(8) NO +ROUTINE_BODY varchar(8) NO NULL ROUTINE_DEFINITION longtext YES NULL EXTERNAL_NAME varchar(64) YES NULL EXTERNAL_LANGUAGE varchar(64) YES NULL -PARAMETER_STYLE varchar(8) NO -IS_DETERMINISTIC varchar(3) NO -SQL_DATA_ACCESS varchar(64) NO +PARAMETER_STYLE varchar(8) NO NULL +IS_DETERMINISTIC varchar(3) NO NULL +SQL_DATA_ACCESS varchar(64) NO NULL SQL_PATH varchar(64) YES NULL -SECURITY_TYPE varchar(7) NO -CREATED datetime NO 0000-00-00 00:00:00 -LAST_ALTERED datetime NO 0000-00-00 00:00:00 -SQL_MODE varchar(8192) NO -ROUTINE_COMMENT longtext NO -DEFINER varchar(384) NO -CHARACTER_SET_CLIENT varchar(32) NO -COLLATION_CONNECTION varchar(32) NO -DATABASE_COLLATION varchar(32) NO +SECURITY_TYPE varchar(7) NO NULL +CREATED datetime NO NULL +LAST_ALTERED datetime NO NULL +SQL_MODE varchar(8192) NO NULL +ROUTINE_COMMENT longtext NO NULL +DEFINER varchar(384) NO NULL +CHARACTER_SET_CLIENT varchar(32) NO NULL +COLLATION_CONNECTION varchar(32) NO NULL +DATABASE_COLLATION varchar(32) NO NULL USE test; DROP PROCEDURE IF EXISTS sp_for_routines; DROP FUNCTION IF EXISTS function_for_routines; diff --git a/mysql-test/suite/funcs_1/r/is_schema_privileges.result b/mysql-test/suite/funcs_1/r/is_schema_privileges.result index 0b4268cf92a..16f36ff7227 100644 --- a/mysql-test/suite/funcs_1/r/is_schema_privileges.result +++ b/mysql-test/suite/funcs_1/r/is_schema_privileges.result @@ -28,27 +28,27 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.SCHEMA_PRIVILEGES; Field Type Null Key Default Extra -GRANTEE varchar(385) NO -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -PRIVILEGE_TYPE varchar(64) NO -IS_GRANTABLE varchar(3) NO +GRANTEE varchar(385) NO NULL +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +PRIVILEGE_TYPE varchar(64) NO NULL +IS_GRANTABLE varchar(3) NO NULL SHOW CREATE TABLE information_schema.SCHEMA_PRIVILEGES; Table Create Table SCHEMA_PRIVILEGES CREATE TEMPORARY TABLE `SCHEMA_PRIVILEGES` ( - `GRANTEE` varchar(385) NOT NULL DEFAULT '', - `TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '', - `TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `PRIVILEGE_TYPE` varchar(64) NOT NULL DEFAULT '', - `IS_GRANTABLE` varchar(3) NOT NULL DEFAULT '' + `GRANTEE` varchar(385) NOT NULL, + `TABLE_CATALOG` varchar(512) NOT NULL, + `TABLE_SCHEMA` varchar(64) NOT NULL, + `PRIVILEGE_TYPE` varchar(64) NOT NULL, + `IS_GRANTABLE` varchar(3) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.SCHEMA_PRIVILEGES; Field Type Null Key Default Extra -GRANTEE varchar(385) NO -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -PRIVILEGE_TYPE varchar(64) NO -IS_GRANTABLE varchar(3) NO +GRANTEE varchar(385) NO NULL +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +PRIVILEGE_TYPE varchar(64) NO NULL +IS_GRANTABLE varchar(3) NO NULL SELECT GRANTEE, TABLE_CATALOG, TABLE_SCHEMA, PRIVILEGE_TYPE FROM information_schema.schema_privileges WHERE table_catalog IS NOT NULL; GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE diff --git a/mysql-test/suite/funcs_1/r/is_schemata.result b/mysql-test/suite/funcs_1/r/is_schemata.result index 3949ab16755..9c797149d4a 100644 --- a/mysql-test/suite/funcs_1/r/is_schemata.result +++ b/mysql-test/suite/funcs_1/r/is_schemata.result @@ -28,30 +28,30 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.SCHEMATA; Field Type Null Key Default Extra -CATALOG_NAME varchar(512) NO -SCHEMA_NAME varchar(64) NO -DEFAULT_CHARACTER_SET_NAME varchar(32) NO -DEFAULT_COLLATION_NAME varchar(32) NO +CATALOG_NAME varchar(512) NO NULL +SCHEMA_NAME varchar(64) NO NULL +DEFAULT_CHARACTER_SET_NAME varchar(32) NO NULL +DEFAULT_COLLATION_NAME varchar(32) NO NULL SQL_PATH varchar(512) YES NULL -SCHEMA_COMMENT varchar(1024) NO +SCHEMA_COMMENT varchar(1024) NO NULL SHOW CREATE TABLE information_schema.SCHEMATA; Table Create Table SCHEMATA CREATE TEMPORARY TABLE `SCHEMATA` ( - `CATALOG_NAME` varchar(512) NOT NULL DEFAULT '', - `SCHEMA_NAME` varchar(64) NOT NULL DEFAULT '', - `DEFAULT_CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '', - `DEFAULT_COLLATION_NAME` varchar(32) NOT NULL DEFAULT '', - `SQL_PATH` varchar(512) DEFAULT NULL, - `SCHEMA_COMMENT` varchar(1024) NOT NULL DEFAULT '' + `CATALOG_NAME` varchar(512) NOT NULL, + `SCHEMA_NAME` varchar(64) NOT NULL, + `DEFAULT_CHARACTER_SET_NAME` varchar(32) NOT NULL, + `DEFAULT_COLLATION_NAME` varchar(32) NOT NULL, + `SQL_PATH` varchar(512), + `SCHEMA_COMMENT` varchar(1024) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.SCHEMATA; Field Type Null Key Default Extra -CATALOG_NAME varchar(512) NO -SCHEMA_NAME varchar(64) NO -DEFAULT_CHARACTER_SET_NAME varchar(32) NO -DEFAULT_COLLATION_NAME varchar(32) NO +CATALOG_NAME varchar(512) NO NULL +SCHEMA_NAME varchar(64) NO NULL +DEFAULT_CHARACTER_SET_NAME varchar(32) NO NULL +DEFAULT_COLLATION_NAME varchar(32) NO NULL SQL_PATH varchar(512) YES NULL -SCHEMA_COMMENT varchar(1024) NO +SCHEMA_COMMENT varchar(1024) NO NULL SELECT catalog_name, schema_name, sql_path FROM information_schema.schemata WHERE catalog_name IS NOT NULL or sql_path IS NOT NULL diff --git a/mysql-test/suite/funcs_1/r/is_schemata_embedded.result b/mysql-test/suite/funcs_1/r/is_schemata_embedded.result index 5652e916cb1..18b84d7ebff 100644 --- a/mysql-test/suite/funcs_1/r/is_schemata_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_schemata_embedded.result @@ -28,30 +28,30 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.SCHEMATA; Field Type Null Key Default Extra -CATALOG_NAME varchar(512) NO -SCHEMA_NAME varchar(64) NO -DEFAULT_CHARACTER_SET_NAME varchar(32) NO -DEFAULT_COLLATION_NAME varchar(32) NO +CATALOG_NAME varchar(512) NO NULL +SCHEMA_NAME varchar(64) NO NULL +DEFAULT_CHARACTER_SET_NAME varchar(32) NO NULL +DEFAULT_COLLATION_NAME varchar(32) NO NULL SQL_PATH varchar(512) YES NULL -SCHEMA_COMMENT varchar(1024) NO +SCHEMA_COMMENT varchar(1024) NO NULL SHOW CREATE TABLE information_schema.SCHEMATA; Table Create Table SCHEMATA CREATE TEMPORARY TABLE `SCHEMATA` ( - `CATALOG_NAME` varchar(512) NOT NULL DEFAULT '', - `SCHEMA_NAME` varchar(64) NOT NULL DEFAULT '', - `DEFAULT_CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '', - `DEFAULT_COLLATION_NAME` varchar(32) NOT NULL DEFAULT '', - `SQL_PATH` varchar(512) DEFAULT NULL, - `SCHEMA_COMMENT` varchar(1024) NOT NULL DEFAULT '' + `CATALOG_NAME` varchar(512) NOT NULL, + `SCHEMA_NAME` varchar(64) NOT NULL, + `DEFAULT_CHARACTER_SET_NAME` varchar(32) NOT NULL, + `DEFAULT_COLLATION_NAME` varchar(32) NOT NULL, + `SQL_PATH` varchar(512), + `SCHEMA_COMMENT` varchar(1024) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.SCHEMATA; Field Type Null Key Default Extra -CATALOG_NAME varchar(512) NO -SCHEMA_NAME varchar(64) NO -DEFAULT_CHARACTER_SET_NAME varchar(32) NO -DEFAULT_COLLATION_NAME varchar(32) NO +CATALOG_NAME varchar(512) NO NULL +SCHEMA_NAME varchar(64) NO NULL +DEFAULT_CHARACTER_SET_NAME varchar(32) NO NULL +DEFAULT_COLLATION_NAME varchar(32) NO NULL SQL_PATH varchar(512) YES NULL -SCHEMA_COMMENT varchar(1024) NO +SCHEMA_COMMENT varchar(1024) NO NULL SELECT catalog_name, schema_name, sql_path FROM information_schema.schemata WHERE catalog_name IS NOT NULL or sql_path IS NOT NULL diff --git a/mysql-test/suite/funcs_1/r/is_statistics.result b/mysql-test/suite/funcs_1/r/is_statistics.result index 229183c036b..64c679dce3d 100644 --- a/mysql-test/suite/funcs_1/r/is_statistics.result +++ b/mysql-test/suite/funcs_1/r/is_statistics.result @@ -28,63 +28,63 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.STATISTICS; Field Type Null Key Default Extra -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -NON_UNIQUE bigint(1) NO 0 -INDEX_SCHEMA varchar(64) NO -INDEX_NAME varchar(64) NO -SEQ_IN_INDEX bigint(2) NO 0 -COLUMN_NAME varchar(64) NO +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +NON_UNIQUE bigint(1) NO NULL +INDEX_SCHEMA varchar(64) NO NULL +INDEX_NAME varchar(64) NO NULL +SEQ_IN_INDEX bigint(2) NO NULL +COLUMN_NAME varchar(64) NO NULL COLLATION varchar(1) YES NULL CARDINALITY bigint(21) YES NULL SUB_PART bigint(3) YES NULL PACKED varchar(10) YES NULL -NULLABLE varchar(3) NO -INDEX_TYPE varchar(16) NO +NULLABLE varchar(3) NO NULL +INDEX_TYPE varchar(16) NO NULL COMMENT varchar(16) YES NULL -INDEX_COMMENT varchar(1024) NO -IGNORED varchar(3) NO +INDEX_COMMENT varchar(1024) NO NULL +IGNORED varchar(3) NO NULL SHOW CREATE TABLE information_schema.STATISTICS; Table Create Table STATISTICS CREATE TEMPORARY TABLE `STATISTICS` ( - `TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '', - `TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `TABLE_NAME` varchar(64) NOT NULL DEFAULT '', - `NON_UNIQUE` bigint(1) NOT NULL DEFAULT 0, - `INDEX_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `INDEX_NAME` varchar(64) NOT NULL DEFAULT '', - `SEQ_IN_INDEX` bigint(2) NOT NULL DEFAULT 0, - `COLUMN_NAME` varchar(64) NOT NULL DEFAULT '', - `COLLATION` varchar(1) DEFAULT NULL, - `CARDINALITY` bigint(21) DEFAULT NULL, - `SUB_PART` bigint(3) DEFAULT NULL, - `PACKED` varchar(10) DEFAULT NULL, - `NULLABLE` varchar(3) NOT NULL DEFAULT '', - `INDEX_TYPE` varchar(16) NOT NULL DEFAULT '', - `COMMENT` varchar(16) DEFAULT NULL, - `INDEX_COMMENT` varchar(1024) NOT NULL DEFAULT '', - `IGNORED` varchar(3) NOT NULL DEFAULT '' + `TABLE_CATALOG` varchar(512) NOT NULL, + `TABLE_SCHEMA` varchar(64) NOT NULL, + `TABLE_NAME` varchar(64) NOT NULL, + `NON_UNIQUE` bigint(1) NOT NULL, + `INDEX_SCHEMA` varchar(64) NOT NULL, + `INDEX_NAME` varchar(64) NOT NULL, + `SEQ_IN_INDEX` bigint(2) NOT NULL, + `COLUMN_NAME` varchar(64) NOT NULL, + `COLLATION` varchar(1), + `CARDINALITY` bigint(21), + `SUB_PART` bigint(3), + `PACKED` varchar(10), + `NULLABLE` varchar(3) NOT NULL, + `INDEX_TYPE` varchar(16) NOT NULL, + `COMMENT` varchar(16), + `INDEX_COMMENT` varchar(1024) NOT NULL, + `IGNORED` varchar(3) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.STATISTICS; Field Type Null Key Default Extra -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -NON_UNIQUE bigint(1) NO 0 -INDEX_SCHEMA varchar(64) NO -INDEX_NAME varchar(64) NO -SEQ_IN_INDEX bigint(2) NO 0 -COLUMN_NAME varchar(64) NO +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +NON_UNIQUE bigint(1) NO NULL +INDEX_SCHEMA varchar(64) NO NULL +INDEX_NAME varchar(64) NO NULL +SEQ_IN_INDEX bigint(2) NO NULL +COLUMN_NAME varchar(64) NO NULL COLLATION varchar(1) YES NULL CARDINALITY bigint(21) YES NULL SUB_PART bigint(3) YES NULL PACKED varchar(10) YES NULL -NULLABLE varchar(3) NO -INDEX_TYPE varchar(16) NO +NULLABLE varchar(3) NO NULL +INDEX_TYPE varchar(16) NO NULL COMMENT varchar(16) YES NULL -INDEX_COMMENT varchar(1024) NO -IGNORED varchar(3) NO +INDEX_COMMENT varchar(1024) NO NULL +IGNORED varchar(3) NO NULL SELECT table_catalog, table_schema, table_name, index_schema, index_name FROM information_schema.statistics WHERE table_catalog IS NOT NULL ORDER BY table_schema, table_name, index_schema, index_name; diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints.result b/mysql-test/suite/funcs_1/r/is_table_constraints.result index de44c2d5052..22b7148123d 100644 --- a/mysql-test/suite/funcs_1/r/is_table_constraints.result +++ b/mysql-test/suite/funcs_1/r/is_table_constraints.result @@ -28,30 +28,30 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.TABLE_CONSTRAINTS; Field Type Null Key Default Extra -CONSTRAINT_CATALOG varchar(512) NO -CONSTRAINT_SCHEMA varchar(64) NO -CONSTRAINT_NAME varchar(64) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -CONSTRAINT_TYPE varchar(64) NO +CONSTRAINT_CATALOG varchar(512) NO NULL +CONSTRAINT_SCHEMA varchar(64) NO NULL +CONSTRAINT_NAME varchar(64) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +CONSTRAINT_TYPE varchar(64) NO NULL SHOW CREATE TABLE information_schema.TABLE_CONSTRAINTS; Table Create Table TABLE_CONSTRAINTS CREATE TEMPORARY TABLE `TABLE_CONSTRAINTS` ( - `CONSTRAINT_CATALOG` varchar(512) NOT NULL DEFAULT '', - `CONSTRAINT_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `CONSTRAINT_NAME` varchar(64) NOT NULL DEFAULT '', - `TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `TABLE_NAME` varchar(64) NOT NULL DEFAULT '', - `CONSTRAINT_TYPE` varchar(64) NOT NULL DEFAULT '' + `CONSTRAINT_CATALOG` varchar(512) NOT NULL, + `CONSTRAINT_SCHEMA` varchar(64) NOT NULL, + `CONSTRAINT_NAME` varchar(64) NOT NULL, + `TABLE_SCHEMA` varchar(64) NOT NULL, + `TABLE_NAME` varchar(64) NOT NULL, + `CONSTRAINT_TYPE` varchar(64) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.TABLE_CONSTRAINTS; Field Type Null Key Default Extra -CONSTRAINT_CATALOG varchar(512) NO -CONSTRAINT_SCHEMA varchar(64) NO -CONSTRAINT_NAME varchar(64) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -CONSTRAINT_TYPE varchar(64) NO +CONSTRAINT_CATALOG varchar(512) NO NULL +CONSTRAINT_SCHEMA varchar(64) NO NULL +CONSTRAINT_NAME varchar(64) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +CONSTRAINT_TYPE varchar(64) NO NULL SELECT constraint_catalog, constraint_schema, constraint_name, table_schema, table_name FROM information_schema.table_constraints diff --git a/mysql-test/suite/funcs_1/r/is_table_privileges.result b/mysql-test/suite/funcs_1/r/is_table_privileges.result index f749a236b9a..c85d3cc3d96 100644 --- a/mysql-test/suite/funcs_1/r/is_table_privileges.result +++ b/mysql-test/suite/funcs_1/r/is_table_privileges.result @@ -28,30 +28,30 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.TABLE_PRIVILEGES; Field Type Null Key Default Extra -GRANTEE varchar(385) NO -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -PRIVILEGE_TYPE varchar(64) NO -IS_GRANTABLE varchar(3) NO +GRANTEE varchar(385) NO NULL +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +PRIVILEGE_TYPE varchar(64) NO NULL +IS_GRANTABLE varchar(3) NO NULL SHOW CREATE TABLE information_schema.TABLE_PRIVILEGES; Table Create Table TABLE_PRIVILEGES CREATE TEMPORARY TABLE `TABLE_PRIVILEGES` ( - `GRANTEE` varchar(385) NOT NULL DEFAULT '', - `TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '', - `TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `TABLE_NAME` varchar(64) NOT NULL DEFAULT '', - `PRIVILEGE_TYPE` varchar(64) NOT NULL DEFAULT '', - `IS_GRANTABLE` varchar(3) NOT NULL DEFAULT '' + `GRANTEE` varchar(385) NOT NULL, + `TABLE_CATALOG` varchar(512) NOT NULL, + `TABLE_SCHEMA` varchar(64) NOT NULL, + `TABLE_NAME` varchar(64) NOT NULL, + `PRIVILEGE_TYPE` varchar(64) NOT NULL, + `IS_GRANTABLE` varchar(3) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.TABLE_PRIVILEGES; Field Type Null Key Default Extra -GRANTEE varchar(385) NO -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -PRIVILEGE_TYPE varchar(64) NO -IS_GRANTABLE varchar(3) NO +GRANTEE varchar(385) NO NULL +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +PRIVILEGE_TYPE varchar(64) NO NULL +IS_GRANTABLE varchar(3) NO NULL SELECT table_catalog, table_schema, table_name, privilege_type FROM information_schema.table_privileges WHERE table_catalog IS NOT NULL; table_catalog table_schema table_name privilege_type diff --git a/mysql-test/suite/funcs_1/r/is_tables.result b/mysql-test/suite/funcs_1/r/is_tables.result index 54c75efd74e..08e721cde1c 100644 --- a/mysql-test/suite/funcs_1/r/is_tables.result +++ b/mysql-test/suite/funcs_1/r/is_tables.result @@ -28,10 +28,10 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.TABLES; Field Type Null Key Default Extra -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -TABLE_TYPE varchar(64) NO +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +TABLE_TYPE varchar(64) NO NULL ENGINE varchar(64) YES NULL VERSION bigint(21) unsigned YES NULL ROW_FORMAT varchar(10) YES NULL @@ -48,42 +48,42 @@ CHECK_TIME datetime YES NULL TABLE_COLLATION varchar(32) YES NULL CHECKSUM bigint(21) unsigned YES NULL CREATE_OPTIONS varchar(2048) YES NULL -TABLE_COMMENT varchar(2048) NO +TABLE_COMMENT varchar(2048) NO NULL MAX_INDEX_LENGTH bigint(21) unsigned YES NULL TEMPORARY varchar(1) YES NULL SHOW CREATE TABLE information_schema.TABLES; Table Create Table TABLES CREATE TEMPORARY TABLE `TABLES` ( - `TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '', - `TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `TABLE_NAME` varchar(64) NOT NULL DEFAULT '', - `TABLE_TYPE` varchar(64) NOT NULL DEFAULT '', - `ENGINE` varchar(64) DEFAULT NULL, - `VERSION` bigint(21) unsigned DEFAULT NULL, - `ROW_FORMAT` varchar(10) DEFAULT NULL, - `TABLE_ROWS` bigint(21) unsigned DEFAULT NULL, - `AVG_ROW_LENGTH` bigint(21) unsigned DEFAULT NULL, - `DATA_LENGTH` bigint(21) unsigned DEFAULT NULL, - `MAX_DATA_LENGTH` bigint(21) unsigned DEFAULT NULL, - `INDEX_LENGTH` bigint(21) unsigned DEFAULT NULL, - `DATA_FREE` bigint(21) unsigned DEFAULT NULL, - `AUTO_INCREMENT` bigint(21) unsigned DEFAULT NULL, - `CREATE_TIME` datetime DEFAULT NULL, - `UPDATE_TIME` datetime DEFAULT NULL, - `CHECK_TIME` datetime DEFAULT NULL, - `TABLE_COLLATION` varchar(32) DEFAULT NULL, - `CHECKSUM` bigint(21) unsigned DEFAULT NULL, - `CREATE_OPTIONS` varchar(2048) DEFAULT NULL, - `TABLE_COMMENT` varchar(2048) NOT NULL DEFAULT '', - `MAX_INDEX_LENGTH` bigint(21) unsigned DEFAULT NULL, - `TEMPORARY` varchar(1) DEFAULT NULL + `TABLE_CATALOG` varchar(512) NOT NULL, + `TABLE_SCHEMA` varchar(64) NOT NULL, + `TABLE_NAME` varchar(64) NOT NULL, + `TABLE_TYPE` varchar(64) NOT NULL, + `ENGINE` varchar(64), + `VERSION` bigint(21) unsigned, + `ROW_FORMAT` varchar(10), + `TABLE_ROWS` bigint(21) unsigned, + `AVG_ROW_LENGTH` bigint(21) unsigned, + `DATA_LENGTH` bigint(21) unsigned, + `MAX_DATA_LENGTH` bigint(21) unsigned, + `INDEX_LENGTH` bigint(21) unsigned, + `DATA_FREE` bigint(21) unsigned, + `AUTO_INCREMENT` bigint(21) unsigned, + `CREATE_TIME` datetime, + `UPDATE_TIME` datetime, + `CHECK_TIME` datetime, + `TABLE_COLLATION` varchar(32), + `CHECKSUM` bigint(21) unsigned, + `CREATE_OPTIONS` varchar(2048), + `TABLE_COMMENT` varchar(2048) NOT NULL, + `MAX_INDEX_LENGTH` bigint(21) unsigned, + `TEMPORARY` varchar(1) ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.TABLES; Field Type Null Key Default Extra -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -TABLE_TYPE varchar(64) NO +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +TABLE_TYPE varchar(64) NO NULL ENGINE varchar(64) YES NULL VERSION bigint(21) unsigned YES NULL ROW_FORMAT varchar(10) YES NULL @@ -100,7 +100,7 @@ CHECK_TIME datetime YES NULL TABLE_COLLATION varchar(32) YES NULL CHECKSUM bigint(21) unsigned YES NULL CREATE_OPTIONS varchar(2048) YES NULL -TABLE_COMMENT varchar(2048) NO +TABLE_COMMENT varchar(2048) NO NULL MAX_INDEX_LENGTH bigint(21) unsigned YES NULL TEMPORARY varchar(1) YES NULL SELECT table_catalog, table_schema, table_name diff --git a/mysql-test/suite/funcs_1/r/is_tables_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_embedded.result index 1d8e276ba73..5e9259bf557 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_tables_embedded.result @@ -28,10 +28,10 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.TABLES; Field Type Null Key Default Extra -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -TABLE_TYPE varchar(64) NO +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +TABLE_TYPE varchar(64) NO NULL ENGINE varchar(64) YES NULL VERSION bigint(21) unsigned YES NULL ROW_FORMAT varchar(10) YES NULL @@ -48,42 +48,42 @@ CHECK_TIME datetime YES NULL TABLE_COLLATION varchar(32) YES NULL CHECKSUM bigint(21) unsigned YES NULL CREATE_OPTIONS varchar(2048) YES NULL -TABLE_COMMENT varchar(2048) NO +TABLE_COMMENT varchar(2048) NO NULL MAX_INDEX_LENGTH bigint(21) unsigned YES NULL TEMPORARY varchar(1) YES NULL SHOW CREATE TABLE information_schema.TABLES; Table Create Table TABLES CREATE TEMPORARY TABLE `TABLES` ( - `TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '', - `TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `TABLE_NAME` varchar(64) NOT NULL DEFAULT '', - `TABLE_TYPE` varchar(64) NOT NULL DEFAULT '', - `ENGINE` varchar(64) DEFAULT NULL, - `VERSION` bigint(21) unsigned DEFAULT NULL, - `ROW_FORMAT` varchar(10) DEFAULT NULL, - `TABLE_ROWS` bigint(21) unsigned DEFAULT NULL, - `AVG_ROW_LENGTH` bigint(21) unsigned DEFAULT NULL, - `DATA_LENGTH` bigint(21) unsigned DEFAULT NULL, - `MAX_DATA_LENGTH` bigint(21) unsigned DEFAULT NULL, - `INDEX_LENGTH` bigint(21) unsigned DEFAULT NULL, - `DATA_FREE` bigint(21) unsigned DEFAULT NULL, - `AUTO_INCREMENT` bigint(21) unsigned DEFAULT NULL, - `CREATE_TIME` datetime DEFAULT NULL, - `UPDATE_TIME` datetime DEFAULT NULL, - `CHECK_TIME` datetime DEFAULT NULL, - `TABLE_COLLATION` varchar(32) DEFAULT NULL, - `CHECKSUM` bigint(21) unsigned DEFAULT NULL, - `CREATE_OPTIONS` varchar(2048) DEFAULT NULL, - `TABLE_COMMENT` varchar(2048) NOT NULL DEFAULT '', - `MAX_INDEX_LENGTH` bigint(21) unsigned DEFAULT NULL, - `TEMPORARY` varchar(1) DEFAULT NULL + `TABLE_CATALOG` varchar(512) NOT NULL, + `TABLE_SCHEMA` varchar(64) NOT NULL, + `TABLE_NAME` varchar(64) NOT NULL, + `TABLE_TYPE` varchar(64) NOT NULL, + `ENGINE` varchar(64), + `VERSION` bigint(21) unsigned, + `ROW_FORMAT` varchar(10), + `TABLE_ROWS` bigint(21) unsigned, + `AVG_ROW_LENGTH` bigint(21) unsigned, + `DATA_LENGTH` bigint(21) unsigned, + `MAX_DATA_LENGTH` bigint(21) unsigned, + `INDEX_LENGTH` bigint(21) unsigned, + `DATA_FREE` bigint(21) unsigned, + `AUTO_INCREMENT` bigint(21) unsigned, + `CREATE_TIME` datetime, + `UPDATE_TIME` datetime, + `CHECK_TIME` datetime, + `TABLE_COLLATION` varchar(32), + `CHECKSUM` bigint(21) unsigned, + `CREATE_OPTIONS` varchar(2048), + `TABLE_COMMENT` varchar(2048) NOT NULL, + `MAX_INDEX_LENGTH` bigint(21) unsigned, + `TEMPORARY` varchar(1) ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.TABLES; Field Type Null Key Default Extra -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -TABLE_TYPE varchar(64) NO +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +TABLE_TYPE varchar(64) NO NULL ENGINE varchar(64) YES NULL VERSION bigint(21) unsigned YES NULL ROW_FORMAT varchar(10) YES NULL @@ -100,7 +100,7 @@ CHECK_TIME datetime YES NULL TABLE_COLLATION varchar(32) YES NULL CHECKSUM bigint(21) unsigned YES NULL CREATE_OPTIONS varchar(2048) YES NULL -TABLE_COMMENT varchar(2048) NO +TABLE_COMMENT varchar(2048) NO NULL MAX_INDEX_LENGTH bigint(21) unsigned YES NULL TEMPORARY varchar(1) YES NULL SELECT table_catalog, table_schema, table_name diff --git a/mysql-test/suite/funcs_1/r/is_triggers.result b/mysql-test/suite/funcs_1/r/is_triggers.result index c6485e58f44..030d469db54 100644 --- a/mysql-test/suite/funcs_1/r/is_triggers.result +++ b/mysql-test/suite/funcs_1/r/is_triggers.result @@ -30,78 +30,78 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.TRIGGERS; Field Type Null Key Default Extra -TRIGGER_CATALOG varchar(512) NO -TRIGGER_SCHEMA varchar(64) NO -TRIGGER_NAME varchar(64) NO -EVENT_MANIPULATION varchar(6) NO -EVENT_OBJECT_CATALOG varchar(512) NO -EVENT_OBJECT_SCHEMA varchar(64) NO -EVENT_OBJECT_TABLE varchar(64) NO -ACTION_ORDER bigint(4) NO 0 +TRIGGER_CATALOG varchar(512) NO NULL +TRIGGER_SCHEMA varchar(64) NO NULL +TRIGGER_NAME varchar(64) NO NULL +EVENT_MANIPULATION varchar(6) NO NULL +EVENT_OBJECT_CATALOG varchar(512) NO NULL +EVENT_OBJECT_SCHEMA varchar(64) NO NULL +EVENT_OBJECT_TABLE varchar(64) NO NULL +ACTION_ORDER bigint(4) NO NULL ACTION_CONDITION longtext YES NULL -ACTION_STATEMENT longtext NO -ACTION_ORIENTATION varchar(9) NO -ACTION_TIMING varchar(6) NO +ACTION_STATEMENT longtext NO NULL +ACTION_ORIENTATION varchar(9) NO NULL +ACTION_TIMING varchar(6) NO NULL ACTION_REFERENCE_OLD_TABLE varchar(64) YES NULL ACTION_REFERENCE_NEW_TABLE varchar(64) YES NULL -ACTION_REFERENCE_OLD_ROW varchar(3) NO -ACTION_REFERENCE_NEW_ROW varchar(3) NO +ACTION_REFERENCE_OLD_ROW varchar(3) NO NULL +ACTION_REFERENCE_NEW_ROW varchar(3) NO NULL CREATED datetime(2) YES NULL -SQL_MODE varchar(8192) NO -DEFINER varchar(384) NO -CHARACTER_SET_CLIENT varchar(32) NO -COLLATION_CONNECTION varchar(32) NO -DATABASE_COLLATION varchar(32) NO +SQL_MODE varchar(8192) NO NULL +DEFINER varchar(384) NO NULL +CHARACTER_SET_CLIENT varchar(32) NO NULL +COLLATION_CONNECTION varchar(32) NO NULL +DATABASE_COLLATION varchar(32) NO NULL SHOW CREATE TABLE information_schema.TRIGGERS; Table Create Table TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` ( - `TRIGGER_CATALOG` varchar(512) NOT NULL DEFAULT '', - `TRIGGER_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `TRIGGER_NAME` varchar(64) NOT NULL DEFAULT '', - `EVENT_MANIPULATION` varchar(6) NOT NULL DEFAULT '', - `EVENT_OBJECT_CATALOG` varchar(512) NOT NULL DEFAULT '', - `EVENT_OBJECT_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `EVENT_OBJECT_TABLE` varchar(64) NOT NULL DEFAULT '', - `ACTION_ORDER` bigint(4) NOT NULL DEFAULT 0, - `ACTION_CONDITION` longtext DEFAULT NULL, - `ACTION_STATEMENT` longtext NOT NULL DEFAULT '', - `ACTION_ORIENTATION` varchar(9) NOT NULL DEFAULT '', - `ACTION_TIMING` varchar(6) NOT NULL DEFAULT '', - `ACTION_REFERENCE_OLD_TABLE` varchar(64) DEFAULT NULL, - `ACTION_REFERENCE_NEW_TABLE` varchar(64) DEFAULT NULL, - `ACTION_REFERENCE_OLD_ROW` varchar(3) NOT NULL DEFAULT '', - `ACTION_REFERENCE_NEW_ROW` varchar(3) NOT NULL DEFAULT '', - `CREATED` datetime(2) DEFAULT NULL, - `SQL_MODE` varchar(8192) NOT NULL DEFAULT '', - `DEFINER` varchar(384) NOT NULL DEFAULT '', - `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', - `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', - `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT '' + `TRIGGER_CATALOG` varchar(512) NOT NULL, + `TRIGGER_SCHEMA` varchar(64) NOT NULL, + `TRIGGER_NAME` varchar(64) NOT NULL, + `EVENT_MANIPULATION` varchar(6) NOT NULL, + `EVENT_OBJECT_CATALOG` varchar(512) NOT NULL, + `EVENT_OBJECT_SCHEMA` varchar(64) NOT NULL, + `EVENT_OBJECT_TABLE` varchar(64) NOT NULL, + `ACTION_ORDER` bigint(4) NOT NULL, + `ACTION_CONDITION` longtext, + `ACTION_STATEMENT` longtext NOT NULL, + `ACTION_ORIENTATION` varchar(9) NOT NULL, + `ACTION_TIMING` varchar(6) NOT NULL, + `ACTION_REFERENCE_OLD_TABLE` varchar(64), + `ACTION_REFERENCE_NEW_TABLE` varchar(64), + `ACTION_REFERENCE_OLD_ROW` varchar(3) NOT NULL, + `ACTION_REFERENCE_NEW_ROW` varchar(3) NOT NULL, + `CREATED` datetime(2), + `SQL_MODE` varchar(8192) NOT NULL, + `DEFINER` varchar(384) NOT NULL, + `CHARACTER_SET_CLIENT` varchar(32) NOT NULL, + `COLLATION_CONNECTION` varchar(32) NOT NULL, + `DATABASE_COLLATION` varchar(32) NOT NULL ) DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.TRIGGERS; Field Type Null Key Default Extra -TRIGGER_CATALOG varchar(512) NO -TRIGGER_SCHEMA varchar(64) NO -TRIGGER_NAME varchar(64) NO -EVENT_MANIPULATION varchar(6) NO -EVENT_OBJECT_CATALOG varchar(512) NO -EVENT_OBJECT_SCHEMA varchar(64) NO -EVENT_OBJECT_TABLE varchar(64) NO -ACTION_ORDER bigint(4) NO 0 +TRIGGER_CATALOG varchar(512) NO NULL +TRIGGER_SCHEMA varchar(64) NO NULL +TRIGGER_NAME varchar(64) NO NULL +EVENT_MANIPULATION varchar(6) NO NULL +EVENT_OBJECT_CATALOG varchar(512) NO NULL +EVENT_OBJECT_SCHEMA varchar(64) NO NULL +EVENT_OBJECT_TABLE varchar(64) NO NULL +ACTION_ORDER bigint(4) NO NULL ACTION_CONDITION longtext YES NULL -ACTION_STATEMENT longtext NO -ACTION_ORIENTATION varchar(9) NO -ACTION_TIMING varchar(6) NO +ACTION_STATEMENT longtext NO NULL +ACTION_ORIENTATION varchar(9) NO NULL +ACTION_TIMING varchar(6) NO NULL ACTION_REFERENCE_OLD_TABLE varchar(64) YES NULL ACTION_REFERENCE_NEW_TABLE varchar(64) YES NULL -ACTION_REFERENCE_OLD_ROW varchar(3) NO -ACTION_REFERENCE_NEW_ROW varchar(3) NO +ACTION_REFERENCE_OLD_ROW varchar(3) NO NULL +ACTION_REFERENCE_NEW_ROW varchar(3) NO NULL CREATED datetime(2) YES NULL -SQL_MODE varchar(8192) NO -DEFINER varchar(384) NO -CHARACTER_SET_CLIENT varchar(32) NO -COLLATION_CONNECTION varchar(32) NO -DATABASE_COLLATION varchar(32) NO +SQL_MODE varchar(8192) NO NULL +DEFINER varchar(384) NO NULL +CHARACTER_SET_CLIENT varchar(32) NO NULL +COLLATION_CONNECTION varchar(32) NO NULL +DATABASE_COLLATION varchar(32) NO NULL SELECT * FROM information_schema.triggers WHERE trigger_catalog IS NOT NULL OR event_object_catalog IS NOT NULL OR action_condition IS NOT NULL OR action_reference_old_table IS NOT NULL diff --git a/mysql-test/suite/funcs_1/r/is_triggers_embedded.result b/mysql-test/suite/funcs_1/r/is_triggers_embedded.result index 5a681db49b6..6c02073c954 100644 --- a/mysql-test/suite/funcs_1/r/is_triggers_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_triggers_embedded.result @@ -30,78 +30,78 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.TRIGGERS; Field Type Null Key Default Extra -TRIGGER_CATALOG varchar(512) NO -TRIGGER_SCHEMA varchar(64) NO -TRIGGER_NAME varchar(64) NO -EVENT_MANIPULATION varchar(6) NO -EVENT_OBJECT_CATALOG varchar(512) NO -EVENT_OBJECT_SCHEMA varchar(64) NO -EVENT_OBJECT_TABLE varchar(64) NO -ACTION_ORDER bigint(4) NO 0 +TRIGGER_CATALOG varchar(512) NO NULL +TRIGGER_SCHEMA varchar(64) NO NULL +TRIGGER_NAME varchar(64) NO NULL +EVENT_MANIPULATION varchar(6) NO NULL +EVENT_OBJECT_CATALOG varchar(512) NO NULL +EVENT_OBJECT_SCHEMA varchar(64) NO NULL +EVENT_OBJECT_TABLE varchar(64) NO NULL +ACTION_ORDER bigint(4) NO NULL ACTION_CONDITION longtext YES NULL -ACTION_STATEMENT longtext NO -ACTION_ORIENTATION varchar(9) NO -ACTION_TIMING varchar(6) NO +ACTION_STATEMENT longtext NO NULL +ACTION_ORIENTATION varchar(9) NO NULL +ACTION_TIMING varchar(6) NO NULL ACTION_REFERENCE_OLD_TABLE varchar(64) YES NULL ACTION_REFERENCE_NEW_TABLE varchar(64) YES NULL -ACTION_REFERENCE_OLD_ROW varchar(3) NO -ACTION_REFERENCE_NEW_ROW varchar(3) NO +ACTION_REFERENCE_OLD_ROW varchar(3) NO NULL +ACTION_REFERENCE_NEW_ROW varchar(3) NO NULL CREATED datetime(2) YES NULL -SQL_MODE varchar(8192) NO -DEFINER varchar(384) NO -CHARACTER_SET_CLIENT varchar(32) NO -COLLATION_CONNECTION varchar(32) NO -DATABASE_COLLATION varchar(32) NO +SQL_MODE varchar(8192) NO NULL +DEFINER varchar(384) NO NULL +CHARACTER_SET_CLIENT varchar(32) NO NULL +COLLATION_CONNECTION varchar(32) NO NULL +DATABASE_COLLATION varchar(32) NO NULL SHOW CREATE TABLE information_schema.TRIGGERS; Table Create Table TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` ( - `TRIGGER_CATALOG` varchar(512) NOT NULL DEFAULT '', - `TRIGGER_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `TRIGGER_NAME` varchar(64) NOT NULL DEFAULT '', - `EVENT_MANIPULATION` varchar(6) NOT NULL DEFAULT '', - `EVENT_OBJECT_CATALOG` varchar(512) NOT NULL DEFAULT '', - `EVENT_OBJECT_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `EVENT_OBJECT_TABLE` varchar(64) NOT NULL DEFAULT '', - `ACTION_ORDER` bigint(4) NOT NULL DEFAULT 0, - `ACTION_CONDITION` longtext DEFAULT NULL, - `ACTION_STATEMENT` longtext NOT NULL DEFAULT '', - `ACTION_ORIENTATION` varchar(9) NOT NULL DEFAULT '', - `ACTION_TIMING` varchar(6) NOT NULL DEFAULT '', - `ACTION_REFERENCE_OLD_TABLE` varchar(64) DEFAULT NULL, - `ACTION_REFERENCE_NEW_TABLE` varchar(64) DEFAULT NULL, - `ACTION_REFERENCE_OLD_ROW` varchar(3) NOT NULL DEFAULT '', - `ACTION_REFERENCE_NEW_ROW` varchar(3) NOT NULL DEFAULT '', - `CREATED` datetime(2) DEFAULT NULL, - `SQL_MODE` varchar(8192) NOT NULL DEFAULT '', - `DEFINER` varchar(384) NOT NULL DEFAULT '', - `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', - `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', - `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT '' + `TRIGGER_CATALOG` varchar(512) NOT NULL, + `TRIGGER_SCHEMA` varchar(64) NOT NULL, + `TRIGGER_NAME` varchar(64) NOT NULL, + `EVENT_MANIPULATION` varchar(6) NOT NULL, + `EVENT_OBJECT_CATALOG` varchar(512) NOT NULL, + `EVENT_OBJECT_SCHEMA` varchar(64) NOT NULL, + `EVENT_OBJECT_TABLE` varchar(64) NOT NULL, + `ACTION_ORDER` bigint(4) NOT NULL, + `ACTION_CONDITION` longtext, + `ACTION_STATEMENT` longtext NOT NULL, + `ACTION_ORIENTATION` varchar(9) NOT NULL, + `ACTION_TIMING` varchar(6) NOT NULL, + `ACTION_REFERENCE_OLD_TABLE` varchar(64), + `ACTION_REFERENCE_NEW_TABLE` varchar(64), + `ACTION_REFERENCE_OLD_ROW` varchar(3) NOT NULL, + `ACTION_REFERENCE_NEW_ROW` varchar(3) NOT NULL, + `CREATED` datetime(2), + `SQL_MODE` varchar(8192) NOT NULL, + `DEFINER` varchar(384) NOT NULL, + `CHARACTER_SET_CLIENT` varchar(32) NOT NULL, + `COLLATION_CONNECTION` varchar(32) NOT NULL, + `DATABASE_COLLATION` varchar(32) NOT NULL ) DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.TRIGGERS; Field Type Null Key Default Extra -TRIGGER_CATALOG varchar(512) NO -TRIGGER_SCHEMA varchar(64) NO -TRIGGER_NAME varchar(64) NO -EVENT_MANIPULATION varchar(6) NO -EVENT_OBJECT_CATALOG varchar(512) NO -EVENT_OBJECT_SCHEMA varchar(64) NO -EVENT_OBJECT_TABLE varchar(64) NO -ACTION_ORDER bigint(4) NO 0 +TRIGGER_CATALOG varchar(512) NO NULL +TRIGGER_SCHEMA varchar(64) NO NULL +TRIGGER_NAME varchar(64) NO NULL +EVENT_MANIPULATION varchar(6) NO NULL +EVENT_OBJECT_CATALOG varchar(512) NO NULL +EVENT_OBJECT_SCHEMA varchar(64) NO NULL +EVENT_OBJECT_TABLE varchar(64) NO NULL +ACTION_ORDER bigint(4) NO NULL ACTION_CONDITION longtext YES NULL -ACTION_STATEMENT longtext NO -ACTION_ORIENTATION varchar(9) NO -ACTION_TIMING varchar(6) NO +ACTION_STATEMENT longtext NO NULL +ACTION_ORIENTATION varchar(9) NO NULL +ACTION_TIMING varchar(6) NO NULL ACTION_REFERENCE_OLD_TABLE varchar(64) YES NULL ACTION_REFERENCE_NEW_TABLE varchar(64) YES NULL -ACTION_REFERENCE_OLD_ROW varchar(3) NO -ACTION_REFERENCE_NEW_ROW varchar(3) NO +ACTION_REFERENCE_OLD_ROW varchar(3) NO NULL +ACTION_REFERENCE_NEW_ROW varchar(3) NO NULL CREATED datetime(2) YES NULL -SQL_MODE varchar(8192) NO -DEFINER varchar(384) NO -CHARACTER_SET_CLIENT varchar(32) NO -COLLATION_CONNECTION varchar(32) NO -DATABASE_COLLATION varchar(32) NO +SQL_MODE varchar(8192) NO NULL +DEFINER varchar(384) NO NULL +CHARACTER_SET_CLIENT varchar(32) NO NULL +COLLATION_CONNECTION varchar(32) NO NULL +DATABASE_COLLATION varchar(32) NO NULL SELECT * FROM information_schema.triggers WHERE trigger_catalog IS NOT NULL OR event_object_catalog IS NOT NULL OR action_condition IS NOT NULL OR action_reference_old_table IS NOT NULL diff --git a/mysql-test/suite/funcs_1/r/is_user_privileges.result b/mysql-test/suite/funcs_1/r/is_user_privileges.result index 4363b2851e7..2105642e1c4 100644 --- a/mysql-test/suite/funcs_1/r/is_user_privileges.result +++ b/mysql-test/suite/funcs_1/r/is_user_privileges.result @@ -28,24 +28,24 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.USER_PRIVILEGES; Field Type Null Key Default Extra -GRANTEE varchar(385) NO -TABLE_CATALOG varchar(512) NO -PRIVILEGE_TYPE varchar(64) NO -IS_GRANTABLE varchar(3) NO +GRANTEE varchar(385) NO NULL +TABLE_CATALOG varchar(512) NO NULL +PRIVILEGE_TYPE varchar(64) NO NULL +IS_GRANTABLE varchar(3) NO NULL SHOW CREATE TABLE information_schema.USER_PRIVILEGES; Table Create Table USER_PRIVILEGES CREATE TEMPORARY TABLE `USER_PRIVILEGES` ( - `GRANTEE` varchar(385) NOT NULL DEFAULT '', - `TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '', - `PRIVILEGE_TYPE` varchar(64) NOT NULL DEFAULT '', - `IS_GRANTABLE` varchar(3) NOT NULL DEFAULT '' + `GRANTEE` varchar(385) NOT NULL, + `TABLE_CATALOG` varchar(512) NOT NULL, + `PRIVILEGE_TYPE` varchar(64) NOT NULL, + `IS_GRANTABLE` varchar(3) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.USER_PRIVILEGES; Field Type Null Key Default Extra -GRANTEE varchar(385) NO -TABLE_CATALOG varchar(512) NO -PRIVILEGE_TYPE varchar(64) NO -IS_GRANTABLE varchar(3) NO +GRANTEE varchar(385) NO NULL +TABLE_CATALOG varchar(512) NO NULL +PRIVILEGE_TYPE varchar(64) NO NULL +IS_GRANTABLE varchar(3) NO NULL SELECT grantee, table_catalog, privilege_type FROM information_schema.user_privileges WHERE table_catalog IS NULL OR table_catalog <> 'def'; diff --git a/mysql-test/suite/funcs_1/r/is_views.result b/mysql-test/suite/funcs_1/r/is_views.result index 2f0068a29f7..61c1f87023f 100644 --- a/mysql-test/suite/funcs_1/r/is_views.result +++ b/mysql-test/suite/funcs_1/r/is_views.result @@ -28,45 +28,45 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.VIEWS; Field Type Null Key Default Extra -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -VIEW_DEFINITION longtext NO -CHECK_OPTION varchar(8) NO -IS_UPDATABLE varchar(3) NO -DEFINER varchar(384) NO -SECURITY_TYPE varchar(7) NO -CHARACTER_SET_CLIENT varchar(32) NO -COLLATION_CONNECTION varchar(32) NO -ALGORITHM varchar(10) NO +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +VIEW_DEFINITION longtext NO NULL +CHECK_OPTION varchar(8) NO NULL +IS_UPDATABLE varchar(3) NO NULL +DEFINER varchar(384) NO NULL +SECURITY_TYPE varchar(7) NO NULL +CHARACTER_SET_CLIENT varchar(32) NO NULL +COLLATION_CONNECTION varchar(32) NO NULL +ALGORITHM varchar(10) NO NULL SHOW CREATE TABLE information_schema.VIEWS; Table Create Table VIEWS CREATE TEMPORARY TABLE `VIEWS` ( - `TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '', - `TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `TABLE_NAME` varchar(64) NOT NULL DEFAULT '', - `VIEW_DEFINITION` longtext NOT NULL DEFAULT '', - `CHECK_OPTION` varchar(8) NOT NULL DEFAULT '', - `IS_UPDATABLE` varchar(3) NOT NULL DEFAULT '', - `DEFINER` varchar(384) NOT NULL DEFAULT '', - `SECURITY_TYPE` varchar(7) NOT NULL DEFAULT '', - `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', - `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', - `ALGORITHM` varchar(10) NOT NULL DEFAULT '' + `TABLE_CATALOG` varchar(512) NOT NULL, + `TABLE_SCHEMA` varchar(64) NOT NULL, + `TABLE_NAME` varchar(64) NOT NULL, + `VIEW_DEFINITION` longtext NOT NULL, + `CHECK_OPTION` varchar(8) NOT NULL, + `IS_UPDATABLE` varchar(3) NOT NULL, + `DEFINER` varchar(384) NOT NULL, + `SECURITY_TYPE` varchar(7) NOT NULL, + `CHARACTER_SET_CLIENT` varchar(32) NOT NULL, + `COLLATION_CONNECTION` varchar(32) NOT NULL, + `ALGORITHM` varchar(10) NOT NULL ) DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.VIEWS; Field Type Null Key Default Extra -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -VIEW_DEFINITION longtext NO -CHECK_OPTION varchar(8) NO -IS_UPDATABLE varchar(3) NO -DEFINER varchar(384) NO -SECURITY_TYPE varchar(7) NO -CHARACTER_SET_CLIENT varchar(32) NO -COLLATION_CONNECTION varchar(32) NO -ALGORITHM varchar(10) NO +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +VIEW_DEFINITION longtext NO NULL +CHECK_OPTION varchar(8) NO NULL +IS_UPDATABLE varchar(3) NO NULL +DEFINER varchar(384) NO NULL +SECURITY_TYPE varchar(7) NO NULL +CHARACTER_SET_CLIENT varchar(32) NO NULL +COLLATION_CONNECTION varchar(32) NO NULL +ALGORITHM varchar(10) NO NULL SELECT table_catalog, table_schema, table_name FROM information_schema.views WHERE table_catalog <> 'def'; table_catalog table_schema table_name diff --git a/mysql-test/suite/funcs_1/r/is_views_embedded.result b/mysql-test/suite/funcs_1/r/is_views_embedded.result index 31950041635..d2fafe995de 100644 --- a/mysql-test/suite/funcs_1/r/is_views_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_views_embedded.result @@ -28,45 +28,45 @@ DROP FUNCTION test.f1; ######################################################################### DESCRIBE information_schema.VIEWS; Field Type Null Key Default Extra -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -VIEW_DEFINITION longtext NO -CHECK_OPTION varchar(8) NO -IS_UPDATABLE varchar(3) NO -DEFINER varchar(384) NO -SECURITY_TYPE varchar(7) NO -CHARACTER_SET_CLIENT varchar(32) NO -COLLATION_CONNECTION varchar(32) NO -ALGORITHM varchar(10) NO +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +VIEW_DEFINITION longtext NO NULL +CHECK_OPTION varchar(8) NO NULL +IS_UPDATABLE varchar(3) NO NULL +DEFINER varchar(384) NO NULL +SECURITY_TYPE varchar(7) NO NULL +CHARACTER_SET_CLIENT varchar(32) NO NULL +COLLATION_CONNECTION varchar(32) NO NULL +ALGORITHM varchar(10) NO NULL SHOW CREATE TABLE information_schema.VIEWS; Table Create Table VIEWS CREATE TEMPORARY TABLE `VIEWS` ( - `TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '', - `TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '', - `TABLE_NAME` varchar(64) NOT NULL DEFAULT '', - `VIEW_DEFINITION` longtext NOT NULL DEFAULT '', - `CHECK_OPTION` varchar(8) NOT NULL DEFAULT '', - `IS_UPDATABLE` varchar(3) NOT NULL DEFAULT '', - `DEFINER` varchar(384) NOT NULL DEFAULT '', - `SECURITY_TYPE` varchar(7) NOT NULL DEFAULT '', - `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', - `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', - `ALGORITHM` varchar(10) NOT NULL DEFAULT '' + `TABLE_CATALOG` varchar(512) NOT NULL, + `TABLE_SCHEMA` varchar(64) NOT NULL, + `TABLE_NAME` varchar(64) NOT NULL, + `VIEW_DEFINITION` longtext NOT NULL, + `CHECK_OPTION` varchar(8) NOT NULL, + `IS_UPDATABLE` varchar(3) NOT NULL, + `DEFINER` varchar(384) NOT NULL, + `SECURITY_TYPE` varchar(7) NOT NULL, + `CHARACTER_SET_CLIENT` varchar(32) NOT NULL, + `COLLATION_CONNECTION` varchar(32) NOT NULL, + `ALGORITHM` varchar(10) NOT NULL ) DEFAULT CHARSET=utf8mb3 SHOW COLUMNS FROM information_schema.VIEWS; Field Type Null Key Default Extra -TABLE_CATALOG varchar(512) NO -TABLE_SCHEMA varchar(64) NO -TABLE_NAME varchar(64) NO -VIEW_DEFINITION longtext NO -CHECK_OPTION varchar(8) NO -IS_UPDATABLE varchar(3) NO -DEFINER varchar(384) NO -SECURITY_TYPE varchar(7) NO -CHARACTER_SET_CLIENT varchar(32) NO -COLLATION_CONNECTION varchar(32) NO -ALGORITHM varchar(10) NO +TABLE_CATALOG varchar(512) NO NULL +TABLE_SCHEMA varchar(64) NO NULL +TABLE_NAME varchar(64) NO NULL +VIEW_DEFINITION longtext NO NULL +CHECK_OPTION varchar(8) NO NULL +IS_UPDATABLE varchar(3) NO NULL +DEFINER varchar(384) NO NULL +SECURITY_TYPE varchar(7) NO NULL +CHARACTER_SET_CLIENT varchar(32) NO NULL +COLLATION_CONNECTION varchar(32) NO NULL +ALGORITHM varchar(10) NO NULL SELECT table_catalog, table_schema, table_name FROM information_schema.views WHERE table_catalog <> 'def'; table_catalog table_schema table_name diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result index c70389ad65e..43ce4046fba 100644 --- a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result +++ b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result @@ -24,24 +24,24 @@ connection default; SHOW CREATE TABLE processlist; Table Create Table PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( - `ID` bigint(4) NOT NULL DEFAULT 0, - `USER` varchar(128) NOT NULL DEFAULT '', - `HOST` varchar(64) NOT NULL DEFAULT '', - `DB` varchar(64) DEFAULT NULL, - `COMMAND` varchar(16) NOT NULL DEFAULT '', - `TIME` int(7) NOT NULL DEFAULT 0, - `STATE` varchar(64) DEFAULT NULL, - `INFO` longtext DEFAULT NULL, - `TIME_MS` decimal(22,3) NOT NULL DEFAULT 0.000, - `STAGE` tinyint(2) NOT NULL DEFAULT 0, - `MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0, - `PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000, - `MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, - `MAX_MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, - `EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0, - `QUERY_ID` bigint(4) NOT NULL DEFAULT 0, - `INFO_BINARY` blob DEFAULT NULL, - `TID` bigint(4) NOT NULL DEFAULT 0 + `ID` bigint(4) NOT NULL, + `USER` varchar(128) NOT NULL, + `HOST` varchar(64) NOT NULL, + `DB` varchar(64), + `COMMAND` varchar(16) NOT NULL, + `TIME` int(7) NOT NULL, + `STATE` varchar(64), + `INFO` longtext, + `TIME_MS` decimal(22,3) NOT NULL, + `STAGE` tinyint(2) NOT NULL, + `MAX_STAGE` tinyint(2) NOT NULL, + `PROGRESS` decimal(7,3) NOT NULL, + `MEMORY_USED` bigint(7) NOT NULL, + `MAX_MEMORY_USED` bigint(7) NOT NULL, + `EXAMINED_ROWS` int(7) NOT NULL, + `QUERY_ID` bigint(4) NOT NULL, + `INFO_BINARY` blob, + `TID` bigint(4) NOT NULL ) DEFAULT CHARSET=utf8mb3 SHOW processlist; Id User Host db Command Time State Info Progress @@ -104,24 +104,24 @@ SHOW/SELECT shows only the processes (1) of the user. SHOW CREATE TABLE processlist; Table Create Table PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( - `ID` bigint(4) NOT NULL DEFAULT 0, - `USER` varchar(128) NOT NULL DEFAULT '', - `HOST` varchar(64) NOT NULL DEFAULT '', - `DB` varchar(64) DEFAULT NULL, - `COMMAND` varchar(16) NOT NULL DEFAULT '', - `TIME` int(7) NOT NULL DEFAULT 0, - `STATE` varchar(64) DEFAULT NULL, - `INFO` longtext DEFAULT NULL, - `TIME_MS` decimal(22,3) NOT NULL DEFAULT 0.000, - `STAGE` tinyint(2) NOT NULL DEFAULT 0, - `MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0, - `PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000, - `MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, - `MAX_MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, - `EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0, - `QUERY_ID` bigint(4) NOT NULL DEFAULT 0, - `INFO_BINARY` blob DEFAULT NULL, - `TID` bigint(4) NOT NULL DEFAULT 0 + `ID` bigint(4) NOT NULL, + `USER` varchar(128) NOT NULL, + `HOST` varchar(64) NOT NULL, + `DB` varchar(64), + `COMMAND` varchar(16) NOT NULL, + `TIME` int(7) NOT NULL, + `STATE` varchar(64), + `INFO` longtext, + `TIME_MS` decimal(22,3) NOT NULL, + `STAGE` tinyint(2) NOT NULL, + `MAX_STAGE` tinyint(2) NOT NULL, + `PROGRESS` decimal(7,3) NOT NULL, + `MEMORY_USED` bigint(7) NOT NULL, + `MAX_MEMORY_USED` bigint(7) NOT NULL, + `EXAMINED_ROWS` int(7) NOT NULL, + `QUERY_ID` bigint(4) NOT NULL, + `INFO_BINARY` blob, + `TID` bigint(4) NOT NULL ) DEFAULT CHARSET=utf8mb3 SHOW processlist; Id User Host db Command Time State Info Progress diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result index b3077fa4a7e..a2ef23ebfe9 100644 --- a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result +++ b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result @@ -24,24 +24,24 @@ connection default; SHOW CREATE TABLE processlist; Table Create Table PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( - `ID` bigint(4) NOT NULL DEFAULT 0, - `USER` varchar(128) NOT NULL DEFAULT '', - `HOST` varchar(64) NOT NULL DEFAULT '', - `DB` varchar(64) DEFAULT NULL, - `COMMAND` varchar(16) NOT NULL DEFAULT '', - `TIME` int(7) NOT NULL DEFAULT 0, - `STATE` varchar(64) DEFAULT NULL, - `INFO` longtext DEFAULT NULL, - `TIME_MS` decimal(22,3) NOT NULL DEFAULT 0.000, - `STAGE` tinyint(2) NOT NULL DEFAULT 0, - `MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0, - `PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000, - `MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, - `MAX_MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, - `EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0, - `QUERY_ID` bigint(4) NOT NULL DEFAULT 0, - `INFO_BINARY` blob DEFAULT NULL, - `TID` bigint(4) NOT NULL DEFAULT 0 + `ID` bigint(4) NOT NULL, + `USER` varchar(128) NOT NULL, + `HOST` varchar(64) NOT NULL, + `DB` varchar(64), + `COMMAND` varchar(16) NOT NULL, + `TIME` int(7) NOT NULL, + `STATE` varchar(64), + `INFO` longtext, + `TIME_MS` decimal(22,3) NOT NULL, + `STAGE` tinyint(2) NOT NULL, + `MAX_STAGE` tinyint(2) NOT NULL, + `PROGRESS` decimal(7,3) NOT NULL, + `MEMORY_USED` bigint(7) NOT NULL, + `MAX_MEMORY_USED` bigint(7) NOT NULL, + `EXAMINED_ROWS` int(7) NOT NULL, + `QUERY_ID` bigint(4) NOT NULL, + `INFO_BINARY` blob, + `TID` bigint(4) NOT NULL ) DEFAULT CHARSET=utf8mb3 SHOW processlist; Id User Host db Command Time State Info Progress @@ -104,24 +104,24 @@ SHOW/SELECT shows only the processes (1) of the user. SHOW CREATE TABLE processlist; Table Create Table PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( - `ID` bigint(4) NOT NULL DEFAULT 0, - `USER` varchar(128) NOT NULL DEFAULT '', - `HOST` varchar(64) NOT NULL DEFAULT '', - `DB` varchar(64) DEFAULT NULL, - `COMMAND` varchar(16) NOT NULL DEFAULT '', - `TIME` int(7) NOT NULL DEFAULT 0, - `STATE` varchar(64) DEFAULT NULL, - `INFO` longtext DEFAULT NULL, - `TIME_MS` decimal(22,3) NOT NULL DEFAULT 0.000, - `STAGE` tinyint(2) NOT NULL DEFAULT 0, - `MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0, - `PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000, - `MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, - `MAX_MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, - `EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0, - `QUERY_ID` bigint(4) NOT NULL DEFAULT 0, - `INFO_BINARY` blob DEFAULT NULL, - `TID` bigint(4) NOT NULL DEFAULT 0 + `ID` bigint(4) NOT NULL, + `USER` varchar(128) NOT NULL, + `HOST` varchar(64) NOT NULL, + `DB` varchar(64), + `COMMAND` varchar(16) NOT NULL, + `TIME` int(7) NOT NULL, + `STATE` varchar(64), + `INFO` longtext, + `TIME_MS` decimal(22,3) NOT NULL, + `STAGE` tinyint(2) NOT NULL, + `MAX_STAGE` tinyint(2) NOT NULL, + `PROGRESS` decimal(7,3) NOT NULL, + `MEMORY_USED` bigint(7) NOT NULL, + `MAX_MEMORY_USED` bigint(7) NOT NULL, + `EXAMINED_ROWS` int(7) NOT NULL, + `QUERY_ID` bigint(4) NOT NULL, + `INFO_BINARY` blob, + `TID` bigint(4) NOT NULL ) DEFAULT CHARSET=utf8mb3 SHOW processlist; Id User Host db Command Time State Info Progress diff --git a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result index 34dbd6b92ee..b0305a80b46 100644 --- a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result +++ b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result @@ -12,24 +12,24 @@ USE test; SHOW CREATE TABLE INFORMATION_SCHEMA.PROCESSLIST; Table Create Table PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( - `ID` bigint(4) NOT NULL DEFAULT 0, - `USER` varchar(128) NOT NULL DEFAULT '', - `HOST` varchar(64) NOT NULL DEFAULT '', - `DB` varchar(64) DEFAULT NULL, - `COMMAND` varchar(16) NOT NULL DEFAULT '', - `TIME` int(7) NOT NULL DEFAULT 0, - `STATE` varchar(64) DEFAULT NULL, - `INFO` longtext DEFAULT NULL, - `TIME_MS` decimal(22,3) NOT NULL DEFAULT 0.000, - `STAGE` tinyint(2) NOT NULL DEFAULT 0, - `MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0, - `PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000, - `MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, - `MAX_MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, - `EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0, - `QUERY_ID` bigint(4) NOT NULL DEFAULT 0, - `INFO_BINARY` blob DEFAULT NULL, - `TID` bigint(4) NOT NULL DEFAULT 0 + `ID` bigint(4) NOT NULL, + `USER` varchar(128) NOT NULL, + `HOST` varchar(64) NOT NULL, + `DB` varchar(64), + `COMMAND` varchar(16) NOT NULL, + `TIME` int(7) NOT NULL, + `STATE` varchar(64), + `INFO` longtext, + `TIME_MS` decimal(22,3) NOT NULL, + `STAGE` tinyint(2) NOT NULL, + `MAX_STAGE` tinyint(2) NOT NULL, + `PROGRESS` decimal(7,3) NOT NULL, + `MEMORY_USED` bigint(7) NOT NULL, + `MAX_MEMORY_USED` bigint(7) NOT NULL, + `EXAMINED_ROWS` int(7) NOT NULL, + `QUERY_ID` bigint(4) NOT NULL, + `INFO_BINARY` blob, + `TID` bigint(4) NOT NULL ) DEFAULT CHARSET=utf8mb3 # Ensure that the information about the own connection is correct. #-------------------------------------------------------------------------- diff --git a/mysql-test/suite/funcs_1/r/processlist_val_ps.result b/mysql-test/suite/funcs_1/r/processlist_val_ps.result index ba927bb60ee..7b840bd3996 100644 --- a/mysql-test/suite/funcs_1/r/processlist_val_ps.result +++ b/mysql-test/suite/funcs_1/r/processlist_val_ps.result @@ -12,24 +12,24 @@ USE test; SHOW CREATE TABLE INFORMATION_SCHEMA.PROCESSLIST; Table Create Table PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( - `ID` bigint(4) NOT NULL DEFAULT 0, - `USER` varchar(128) NOT NULL DEFAULT '', - `HOST` varchar(64) NOT NULL DEFAULT '', - `DB` varchar(64) DEFAULT NULL, - `COMMAND` varchar(16) NOT NULL DEFAULT '', - `TIME` int(7) NOT NULL DEFAULT 0, - `STATE` varchar(64) DEFAULT NULL, - `INFO` longtext DEFAULT NULL, - `TIME_MS` decimal(22,3) NOT NULL DEFAULT 0.000, - `STAGE` tinyint(2) NOT NULL DEFAULT 0, - `MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0, - `PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000, - `MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, - `MAX_MEMORY_USED` bigint(7) NOT NULL DEFAULT 0, - `EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0, - `QUERY_ID` bigint(4) NOT NULL DEFAULT 0, - `INFO_BINARY` blob DEFAULT NULL, - `TID` bigint(4) NOT NULL DEFAULT 0 + `ID` bigint(4) NOT NULL, + `USER` varchar(128) NOT NULL, + `HOST` varchar(64) NOT NULL, + `DB` varchar(64), + `COMMAND` varchar(16) NOT NULL, + `TIME` int(7) NOT NULL, + `STATE` varchar(64), + `INFO` longtext, + `TIME_MS` decimal(22,3) NOT NULL, + `STAGE` tinyint(2) NOT NULL, + `MAX_STAGE` tinyint(2) NOT NULL, + `PROGRESS` decimal(7,3) NOT NULL, + `MEMORY_USED` bigint(7) NOT NULL, + `MAX_MEMORY_USED` bigint(7) NOT NULL, + `EXAMINED_ROWS` int(7) NOT NULL, + `QUERY_ID` bigint(4) NOT NULL, + `INFO_BINARY` blob, + `TID` bigint(4) NOT NULL ) DEFAULT CHARSET=utf8mb3 # Ensure that the information about the own connection is correct. #-------------------------------------------------------------------------- diff --git a/mysql-test/suite/funcs_1/t/is_columns_is_embedded.test b/mysql-test/suite/funcs_1/t/is_columns_is_embedded.test index 9db247fd6fd..bb9cc2a6ffb 100644 --- a/mysql-test/suite/funcs_1/t/is_columns_is_embedded.test +++ b/mysql-test/suite/funcs_1/t/is_columns_is_embedded.test @@ -14,7 +14,7 @@ # --source include/have_innodb.inc ---source include/is_embedded.inc +--source include/is_embedded_no_privileges.inc let $my_where = WHERE table_schema = 'information_schema' AND table_name <> 'profiling' AND table_name not like 'innodb_%'; diff --git a/mysql-test/suite/funcs_1/t/is_columns_myisam_embedded.test b/mysql-test/suite/funcs_1/t/is_columns_myisam_embedded.test index 9e31190c008..3679cdebbe2 100644 --- a/mysql-test/suite/funcs_1/t/is_columns_myisam_embedded.test +++ b/mysql-test/suite/funcs_1/t/is_columns_myisam_embedded.test @@ -10,10 +10,8 @@ # 2008-06-06 mleich Create this this variant for the embedded server. # -if (`SELECT VERSION() NOT LIKE '%embedded%'`) -{ - --skip Test requires: embedded server -} +--source include/is_embedded_no_privileges.inc + let $engine_type= MyISAM; --enable_prepare_warnings SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; diff --git a/mysql-test/suite/funcs_1/t/is_columns_mysql_embedded.test b/mysql-test/suite/funcs_1/t/is_columns_mysql_embedded.test index d1ed45425ec..9ef1b6d869a 100644 --- a/mysql-test/suite/funcs_1/t/is_columns_mysql_embedded.test +++ b/mysql-test/suite/funcs_1/t/is_columns_mysql_embedded.test @@ -10,10 +10,7 @@ # 2008-06-06 mleich Create this variant for the embedded server # -if (`SELECT VERSION() NOT LIKE '%embedded%'`) -{ - --skip Test requires: embedded server -} +--source include/is_embedded_no_privileges.inc let $my_where = WHERE table_schema = 'mysql'; --source suite/funcs_1/datadict/columns.inc diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index c00bc326bca..1e38075de0d 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -12,7 +12,6 @@ GCF-1081 : MDEV-18283 Galera test failure on galera.GCF-1081 GCF-939 : MDEV-21520 galera.GCF-939 -MDEV-20225 : MDEV-20886 galera.MDEV-20225 MW-328A : MDEV-22666 galera.MW-328A MTR failed: "Semaphore wait has lasted > 600 seconds" and do not release port 16002 MW-328B : MDEV-22666 galera.MW-328A MTR failed: "Semaphore wait has lasted > 600 seconds" and do not release port 16002 MW-328D : MDEV-27550 ER_LOCK_DEADLOCK is gone after MDEV-27025 @@ -41,7 +40,6 @@ galera_var_node_address : MDEV-20485 Galera test failure galera_var_notify_cmd : MDEV-21905 Galera test galera_var_notify_cmd causes hang galera_var_retry_autocommit: MDEV-18181 Galera test failure on galera.galera_var_retry_autocommit galera_wsrep_provider_unset_set: wsrep_provider is read-only for security reasons -mysql-wsrep#198 : MDEV-24446: galera.mysql-wsrep#198 MTR failed: query 'reap' failed: 2000: Unknown MySQL error partition : MDEV-19958 Galera test failure on galera.partition pxc-421: wsrep_provider is read-only for security reasons query_cache: MDEV-15805 Test failure on galera.query_cache diff --git a/mysql-test/suite/galera/r/MDEV-10715.result b/mysql-test/suite/galera/r/MDEV-10715.result index 5ab60f08097..12b9c2367c4 100644 --- a/mysql-test/suite/galera/r/MDEV-10715.result +++ b/mysql-test/suite/galera/r/MDEV-10715.result @@ -26,3 +26,5 @@ wsrep_last_written_gtid() 1-1-0 connection node_1; drop table t1; +connection node_2; +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); diff --git a/mysql-test/suite/galera/r/MDEV-20225.result b/mysql-test/suite/galera/r/MDEV-20225.result index 9f20daed9de..245051309d1 100644 --- a/mysql-test/suite/galera/r/MDEV-20225.result +++ b/mysql-test/suite/galera/r/MDEV-20225.result @@ -11,11 +11,12 @@ DROP TRIGGER tr1; connection node_2; connection node_1; INSERT INTO t1 VALUES (NULL); -connection node_2; +connection node_2a; SET GLOBAL debug_dbug = 'RESET'; SET DEBUG_SYNC = 'now SIGNAL signal.mdev_20225_continue'; SET DEBUG_SYNC = 'RESET'; SET GLOBAL wsrep_slave_threads = 1; +connection node_2; SHOW TRIGGERS; Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/MDEV-25494.result b/mysql-test/suite/galera/r/MDEV-25494.result new file mode 100644 index 00000000000..e889fecc42e --- /dev/null +++ b/mysql-test/suite/galera/r/MDEV-25494.result @@ -0,0 +1,14 @@ +connection node_2; +connection node_1; +SET SESSION binlog_format=STATEMENT; +Warnings: +Warning 1105 MariaDB Galera and flashback do not support binlog format: STATEMENT +CREATE TEMPORARY TABLE t (i INT) UNION=(t); +ALTER TABLE t ADD extrac CHAR(1); +SHOW CREATE TABLE t; +Table Create Table +t CREATE TEMPORARY TABLE `t` ( + `i` int(11) DEFAULT NULL, + `extrac` char(1) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t; diff --git a/mysql-test/suite/galera/r/enforce_storage_engine2.result b/mysql-test/suite/galera/r/enforce_storage_engine2.result index 8b174139eae..e0fb8d867dc 100644 --- a/mysql-test/suite/galera/r/enforce_storage_engine2.result +++ b/mysql-test/suite/galera/r/enforce_storage_engine2.result @@ -9,6 +9,7 @@ CREATE TABLE t1(i INT) ENGINE=INNODB; CREATE TABLE t2(i INT) ENGINE=MYISAM; Warnings: Note 1266 Using storage engine InnoDB for table 't2' +Note 1266 Using storage engine InnoDB for table 't2' connection node_2; SHOW TABLES; Tables_in_test diff --git a/mysql-test/suite/galera/r/galera-features#117.result b/mysql-test/suite/galera/r/galera-features#117.result index 583f3c74a8b..a5233b9ae30 100644 --- a/mysql-test/suite/galera/r/galera-features#117.result +++ b/mysql-test/suite/galera/r/galera-features#117.result @@ -1,5 +1,7 @@ connection node_2; connection node_1; +connection node_1; +connection node_2; connection node_2; SET SESSION wsrep_on=OFF; CREATE TABLE test.t1 (f2 INTEGER); @@ -35,3 +37,4 @@ Killing server ... CALL mtr.add_suppression("Inconsistent by consensus."); CALL mtr.add_suppression("WSREP: Failed to execute TOI action"); CALL mtr.add_suppression("WSREP: TO isolation end failed"); +connection node_1; diff --git a/mysql-test/suite/galera/r/galera_create_table_like.result b/mysql-test/suite/galera/r/galera_create_table_like.result index 82543331ad5..d1633077dcb 100644 --- a/mysql-test/suite/galera/r/galera_create_table_like.result +++ b/mysql-test/suite/galera/r/galera_create_table_like.result @@ -49,3 +49,8 @@ DROP TABLE schema2.real_table2; DROP TABLE schema2.real_table3; DROP SCHEMA schema1; DROP SCHEMA schema2; +use test; +CREATE TEMPORARY TABLE t (c INT) ENGINE=mrg_myisam UNION=(t,t2) insert_method=FIRST; +CREATE TABLE t2 LIKE t; +ERROR HY000: Table 't' is differently defined or of non-MyISAM type or doesn't exist +DROP TABLE t; diff --git a/mysql-test/suite/galera/r/galera_ddl_fk_conflict.result b/mysql-test/suite/galera/r/galera_ddl_fk_conflict.result index 5f09345b79b..03e84f9facd 100644 --- a/mysql-test/suite/galera/r/galera_ddl_fk_conflict.result +++ b/mysql-test/suite/galera/r/galera_ddl_fk_conflict.result @@ -7,389 +7,6 @@ connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1; connection node_1b; SET SESSION wsrep_sync_wait=0; ###################################################################### -# Test for OPTIMIZE -###################################################################### -###################################################################### -# -# Scenario #1: DML working on FK parent table BF aborted by DDL -# over child table -# -###################################################################### -connection node_1; -SET SESSION wsrep_sync_wait=0; -CREATE TABLE p1 (pk INTEGER PRIMARY KEY, f2 CHAR(30)); -INSERT INTO p1 VALUES (1, 'INITIAL VALUE'); -CREATE TABLE p2 (pk INTEGER PRIMARY KEY, f2 CHAR(30)); -INSERT INTO p2 VALUES (1, 'INITIAL VALUE'); -INSERT INTO p2 VALUES (2, 'INITIAL VALUE'); -CREATE TABLE c1 (pk INTEGER PRIMARY KEY, fk INTEGER, FOREIGN KEY (fk) REFERENCES p1(pk)); -INSERT INTO c1 VALUES (1,1); -CREATE TABLE c2 (pk INTEGER PRIMARY KEY, fk1 INTEGER, fk2 INTEGER, FOREIGN KEY (fk1) REFERENCES p1(pk), FOREIGN KEY (fk2) REFERENCES p2(pk)); -INSERT INTO c2 VALUES (1,1,1), (2,1,2); -connection node_1; -SET AUTOCOMMIT=ON; -START TRANSACTION; -UPDATE p1 SET f2 = 'TO DEADLOCK' WHERE pk = 1; -connection node_2; -SET SESSION wsrep_sync_wait=0; -OPTIMIZE TABLE c1 ; -Table Op Msg_type Msg_text -test.c1 optimize note Table does not support optimize, doing recreate + analyze instead -test.c1 optimize status OK -connection node_1; -COMMIT; -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -SELECT COUNT(*) AS EXPECT_1 FROM p1 WHERE f2 = 'INITIAL VALUE'; -EXPECT_1 -1 -SELECT COUNT(*) AS EXPECT_2 FROM p2 WHERE f2 = 'INITIAL VALUE'; -EXPECT_2 -2 -connection node_2; -SELECT COUNT(*) AS EXPECT_1 FROM p1 WHERE f2 = 'INITIAL VALUE'; -EXPECT_1 -1 -SELECT COUNT(*) AS EXPECT_2 FROM p2 WHERE f2 = 'INITIAL VALUE'; -EXPECT_2 -2 -###################################################################### -# -# Scenario #2: DML working on FK parent table tries to replicate, but -# fails in certification for earlier DDL on child table -# -###################################################################### -connection node_1; -BEGIN; -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; -connection node_2; -OPTIMIZE TABLE c1 ; -Table Op Msg_type Msg_text -test.c1 optimize note Table does not support optimize, doing recreate + analyze instead -test.c1 optimize status OK -connection node_1a; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -connection node_1; -UPDATE p1 SET f2 = 'TO DEADLOCK' WHERE pk = 1; -COMMIT; -connection node_1a; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; -connection node_1; -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -SELECT 'I deadlocked'; -I deadlocked -I deadlocked -SELECT COUNT(*) AS EXPECT_1 FROM p1 WHERE f2 = 'INITIAL VALUE'; -EXPECT_1 -1 -SELECT COUNT(*) AS EXPECT_2 FROM p2 WHERE f2 = 'INITIAL VALUE'; -EXPECT_2 -2 -connection node_2; -SELECT COUNT(*) AS EXPECT_1 FROM p1 WHERE f2 = 'INITIAL VALUE'; -EXPECT_1 -1 -SELECT COUNT(*) AS EXPECT_2 FROM p2 WHERE f2 = 'INITIAL VALUE'; -EXPECT_2 -2 -###################################################################### -# -# Scenario #3: 2 DMLs working on two FK parent tables try to replicate, -# but fails in certification for earlier DDL on child table -# which is child to both FK parents -# -###################################################################### -connection node_1; -BEGIN; -connection node_1b; -BEGIN; -connection node_1a; -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; -connection node_2; -OPTIMIZE TABLE c2 ; -Table Op Msg_type Msg_text -test.c2 optimize note Table does not support optimize, doing recreate + analyze instead -test.c2 optimize status OK -connection node_1a; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -connection node_1; -UPDATE p1 SET f2 = 'TO DEADLOCK' WHERE pk = 1; -COMMIT; -connection node_1b; -UPDATE p2 SET f2 = 'TO DEADLOCK' WHERE pk = 2; -COMMIT; -connection node_1a; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; -connection node_1; -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -SELECT 'I deadlocked'; -I deadlocked -I deadlocked -connection node_1b; -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -SELECT 'I deadlocked'; -I deadlocked -I deadlocked -SELECT COUNT(*) AS EXPECT_1 FROM p1 WHERE f2 = 'INITIAL VALUE'; -EXPECT_1 -1 -SELECT COUNT(*) AS EXPECT_2 FROM p2 WHERE f2 = 'INITIAL VALUE'; -EXPECT_2 -2 -connection node_2; -SELECT COUNT(*) AS EXPECT_1 FROM p1 WHERE f2 = 'INITIAL VALUE'; -EXPECT_1 -1 -SELECT COUNT(*) AS EXPECT_2 FROM p2 WHERE f2 = 'INITIAL VALUE'; -EXPECT_2 -2 -DROP TABLE c1, c2; -DROP TABLE p1, p2; -###################################################################### -# Test for OPTIMIZE -###################################################################### -connection node_1; -SET SESSION wsrep_sync_wait=0; -CREATE TABLE p1 (pk INTEGER PRIMARY KEY, f2 CHAR(30)); -INSERT INTO p1 VALUES (1, 'INITIAL VALUE'); -CREATE TABLE c1 (pk INTEGER PRIMARY KEY, fk INTEGER, FOREIGN KEY (fk) REFERENCES p1(pk)); -INSERT INTO c1 VALUES (1,1); -###################################################################### -# -# Scenario #4: DML working on FK parent table tries to replicate, but -# fails in certification for earlier DDL on child table -# and another temporary table. TMP table should be skipped -# but FK child table should be replicated with proper keys -# -###################################################################### -connection node_1; -BEGIN; -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; -connection node_2; -CREATE TEMPORARY TABLE tmp (i int); -OPTIMIZE TABLE c1, tmp ; -Table Op Msg_type Msg_text -test.c1 optimize note Table does not support optimize, doing recreate + analyze instead -test.c1 optimize status OK -test.tmp optimize note Table does not support optimize, doing recreate + analyze instead -test.tmp optimize status OK -DROP TABLE tmp; -connection node_1a; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -connection node_1; -UPDATE p1 SET f2 = 'TO DEADLOCK' WHERE pk = 1; -COMMIT; -connection node_1a; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; -connection node_1; -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -SELECT 'I deadlocked'; -I deadlocked -I deadlocked -SELECT COUNT(*) AS EXPECT_1 FROM p1 WHERE f2 = 'INITIAL VALUE'; -EXPECT_1 -1 -connection node_2; -SELECT COUNT(*) AS EXPECT_1 FROM p1 WHERE f2 = 'INITIAL VALUE'; -EXPECT_1 -1 -DROP TABLE c1; -DROP TABLE p1; -###################################################################### -# Test for REPAIR -###################################################################### -###################################################################### -# -# Scenario #1: DML working on FK parent table BF aborted by DDL -# over child table -# -###################################################################### -connection node_1; -SET SESSION wsrep_sync_wait=0; -CREATE TABLE p1 (pk INTEGER PRIMARY KEY, f2 CHAR(30)); -INSERT INTO p1 VALUES (1, 'INITIAL VALUE'); -CREATE TABLE p2 (pk INTEGER PRIMARY KEY, f2 CHAR(30)); -INSERT INTO p2 VALUES (1, 'INITIAL VALUE'); -INSERT INTO p2 VALUES (2, 'INITIAL VALUE'); -CREATE TABLE c1 (pk INTEGER PRIMARY KEY, fk INTEGER, FOREIGN KEY (fk) REFERENCES p1(pk)); -INSERT INTO c1 VALUES (1,1); -CREATE TABLE c2 (pk INTEGER PRIMARY KEY, fk1 INTEGER, fk2 INTEGER, FOREIGN KEY (fk1) REFERENCES p1(pk), FOREIGN KEY (fk2) REFERENCES p2(pk)); -INSERT INTO c2 VALUES (1,1,1), (2,1,2); -connection node_1; -SET AUTOCOMMIT=ON; -START TRANSACTION; -UPDATE p1 SET f2 = 'TO DEADLOCK' WHERE pk = 1; -connection node_2; -SET SESSION wsrep_sync_wait=0; -REPAIR TABLE c1 ; -Table Op Msg_type Msg_text -test.c1 repair note The storage engine for the table doesn't support repair -connection node_1; -COMMIT; -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -SELECT COUNT(*) AS EXPECT_1 FROM p1 WHERE f2 = 'INITIAL VALUE'; -EXPECT_1 -1 -SELECT COUNT(*) AS EXPECT_2 FROM p2 WHERE f2 = 'INITIAL VALUE'; -EXPECT_2 -2 -connection node_2; -SELECT COUNT(*) AS EXPECT_1 FROM p1 WHERE f2 = 'INITIAL VALUE'; -EXPECT_1 -1 -SELECT COUNT(*) AS EXPECT_2 FROM p2 WHERE f2 = 'INITIAL VALUE'; -EXPECT_2 -2 -###################################################################### -# -# Scenario #2: DML working on FK parent table tries to replicate, but -# fails in certification for earlier DDL on child table -# -###################################################################### -connection node_1; -BEGIN; -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; -connection node_2; -REPAIR TABLE c1 ; -Table Op Msg_type Msg_text -test.c1 repair note The storage engine for the table doesn't support repair -connection node_1a; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -connection node_1; -UPDATE p1 SET f2 = 'TO DEADLOCK' WHERE pk = 1; -COMMIT; -connection node_1a; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; -connection node_1; -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -SELECT 'I deadlocked'; -I deadlocked -I deadlocked -SELECT COUNT(*) AS EXPECT_1 FROM p1 WHERE f2 = 'INITIAL VALUE'; -EXPECT_1 -1 -SELECT COUNT(*) AS EXPECT_2 FROM p2 WHERE f2 = 'INITIAL VALUE'; -EXPECT_2 -2 -connection node_2; -SELECT COUNT(*) AS EXPECT_1 FROM p1 WHERE f2 = 'INITIAL VALUE'; -EXPECT_1 -1 -SELECT COUNT(*) AS EXPECT_2 FROM p2 WHERE f2 = 'INITIAL VALUE'; -EXPECT_2 -2 -###################################################################### -# -# Scenario #3: 2 DMLs working on two FK parent tables try to replicate, -# but fails in certification for earlier DDL on child table -# which is child to both FK parents -# -###################################################################### -connection node_1; -BEGIN; -connection node_1b; -BEGIN; -connection node_1a; -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; -connection node_2; -REPAIR TABLE c2 ; -Table Op Msg_type Msg_text -test.c2 repair note The storage engine for the table doesn't support repair -connection node_1a; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -connection node_1; -UPDATE p1 SET f2 = 'TO DEADLOCK' WHERE pk = 1; -COMMIT; -connection node_1b; -UPDATE p2 SET f2 = 'TO DEADLOCK' WHERE pk = 2; -COMMIT; -connection node_1a; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; -connection node_1; -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -SELECT 'I deadlocked'; -I deadlocked -I deadlocked -connection node_1b; -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -SELECT 'I deadlocked'; -I deadlocked -I deadlocked -SELECT COUNT(*) AS EXPECT_1 FROM p1 WHERE f2 = 'INITIAL VALUE'; -EXPECT_1 -1 -SELECT COUNT(*) AS EXPECT_2 FROM p2 WHERE f2 = 'INITIAL VALUE'; -EXPECT_2 -2 -connection node_2; -SELECT COUNT(*) AS EXPECT_1 FROM p1 WHERE f2 = 'INITIAL VALUE'; -EXPECT_1 -1 -SELECT COUNT(*) AS EXPECT_2 FROM p2 WHERE f2 = 'INITIAL VALUE'; -EXPECT_2 -2 -DROP TABLE c1, c2; -DROP TABLE p1, p2; -###################################################################### -# Test for REPAIR -###################################################################### -connection node_1; -SET SESSION wsrep_sync_wait=0; -CREATE TABLE p1 (pk INTEGER PRIMARY KEY, f2 CHAR(30)); -INSERT INTO p1 VALUES (1, 'INITIAL VALUE'); -CREATE TABLE c1 (pk INTEGER PRIMARY KEY, fk INTEGER, FOREIGN KEY (fk) REFERENCES p1(pk)); -INSERT INTO c1 VALUES (1,1); -###################################################################### -# -# Scenario #4: DML working on FK parent table tries to replicate, but -# fails in certification for earlier DDL on child table -# and another temporary table. TMP table should be skipped -# but FK child table should be replicated with proper keys -# -###################################################################### -connection node_1; -BEGIN; -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; -connection node_2; -CREATE TEMPORARY TABLE tmp (i int); -REPAIR TABLE c1, tmp ; -Table Op Msg_type Msg_text -test.c1 repair note The storage engine for the table doesn't support repair -test.tmp repair note The storage engine for the table doesn't support repair -DROP TABLE tmp; -connection node_1a; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -connection node_1; -UPDATE p1 SET f2 = 'TO DEADLOCK' WHERE pk = 1; -COMMIT; -connection node_1a; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; -connection node_1; -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -SELECT 'I deadlocked'; -I deadlocked -I deadlocked -SELECT COUNT(*) AS EXPECT_1 FROM p1 WHERE f2 = 'INITIAL VALUE'; -EXPECT_1 -1 -connection node_2; -SELECT COUNT(*) AS EXPECT_1 FROM p1 WHERE f2 = 'INITIAL VALUE'; -EXPECT_1 -1 -DROP TABLE c1; -DROP TABLE p1; -###################################################################### # Test for ALTER ENGINE=INNODB ###################################################################### ###################################################################### diff --git a/mysql-test/suite/galera/r/galera_ddl_fk_no_conflict.result b/mysql-test/suite/galera/r/galera_ddl_fk_no_conflict.result new file mode 100644 index 00000000000..43046922143 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_ddl_fk_no_conflict.result @@ -0,0 +1,330 @@ +connection node_2; +connection node_1; +CREATE TABLE parent (pk INTEGER PRIMARY KEY); +CREATE TABLE child (pk INTEGER PRIMARY KEY, parent_id INTEGER, FOREIGN KEY(parent_id) REFERENCES parent(pk) ); +INSERT INTO parent VALUES (1), (2), (3), (4); +INSERT INTO child VALUES (1,1), (2,2), (3,3), (4,4); +connection node_1; +START TRANSACTION; +SELECT * FROM parent FOR UPDATE; +pk +1 +2 +3 +4 +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +OPTIMIZE TABLE child;; +Table Op Msg_type Msg_text +test.child optimize note Table does not support optimize, doing recreate + analyze instead +test.child optimize status OK +connection node_1; +COMMIT; +DROP TABLE child, parent; +disconnect node_1a; +CREATE TABLE parent (pk INTEGER PRIMARY KEY); +CREATE TABLE child (pk INTEGER PRIMARY KEY, parent_id INTEGER, FOREIGN KEY(parent_id) REFERENCES parent(pk) ON UPDATE CASCADE); +INSERT INTO parent VALUES (1), (2), (3), (4); +INSERT INTO child VALUES (1,1), (2,2), (3,3), (4,4); +connection node_1; +START TRANSACTION; +SELECT * FROM parent FOR UPDATE; +pk +1 +2 +3 +4 +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +OPTIMIZE TABLE child;; +Table Op Msg_type Msg_text +test.child optimize note Table does not support optimize, doing recreate + analyze instead +test.child optimize status OK +connection node_1; +COMMIT; +DROP TABLE child, parent; +disconnect node_1a; +CREATE TABLE parent (pk INTEGER PRIMARY KEY); +CREATE TABLE child (pk INTEGER PRIMARY KEY, parent_id INTEGER, FOREIGN KEY(parent_id) REFERENCES parent(pk) ON DELETE CASCADE); +INSERT INTO parent VALUES (1), (2), (3), (4); +INSERT INTO child VALUES (1,1), (2,2), (3,3), (4,4); +connection node_1; +START TRANSACTION; +SELECT * FROM parent FOR UPDATE; +pk +1 +2 +3 +4 +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +OPTIMIZE TABLE child;; +Table Op Msg_type Msg_text +test.child optimize note Table does not support optimize, doing recreate + analyze instead +test.child optimize status OK +connection node_1; +COMMIT; +DROP TABLE child, parent; +disconnect node_1a; +CREATE TABLE parent (pk INTEGER PRIMARY KEY); +CREATE TABLE child (pk INTEGER PRIMARY KEY, parent_id INTEGER, FOREIGN KEY(parent_id) REFERENCES parent(pk) ON UPDATE CASCADE ON DELETE CASCADE); +INSERT INTO parent VALUES (1), (2), (3), (4); +INSERT INTO child VALUES (1,1), (2,2), (3,3), (4,4); +connection node_1; +START TRANSACTION; +SELECT * FROM parent FOR UPDATE; +pk +1 +2 +3 +4 +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +OPTIMIZE TABLE child;; +Table Op Msg_type Msg_text +test.child optimize note Table does not support optimize, doing recreate + analyze instead +test.child optimize status OK +connection node_1; +COMMIT; +DROP TABLE child, parent; +disconnect node_1a; +CREATE TABLE parent (pk INTEGER PRIMARY KEY); +CREATE TABLE child (pk INTEGER PRIMARY KEY, parent_id INTEGER, FOREIGN KEY(parent_id) REFERENCES parent(pk) ); +INSERT INTO parent VALUES (1), (2), (3), (4); +INSERT INTO child VALUES (1,1), (2,2), (3,3), (4,4); +connection node_1; +START TRANSACTION; +SELECT * FROM parent FOR UPDATE; +pk +1 +2 +3 +4 +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +REPAIR TABLE child;; +Table Op Msg_type Msg_text +test.child repair note The storage engine for the table doesn't support repair +connection node_1; +COMMIT; +DROP TABLE child, parent; +disconnect node_1a; +CREATE TABLE parent (pk INTEGER PRIMARY KEY); +CREATE TABLE child (pk INTEGER PRIMARY KEY, parent_id INTEGER, FOREIGN KEY(parent_id) REFERENCES parent(pk) ON UPDATE CASCADE); +INSERT INTO parent VALUES (1), (2), (3), (4); +INSERT INTO child VALUES (1,1), (2,2), (3,3), (4,4); +connection node_1; +START TRANSACTION; +SELECT * FROM parent FOR UPDATE; +pk +1 +2 +3 +4 +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +REPAIR TABLE child;; +Table Op Msg_type Msg_text +test.child repair note The storage engine for the table doesn't support repair +connection node_1; +COMMIT; +DROP TABLE child, parent; +disconnect node_1a; +CREATE TABLE parent (pk INTEGER PRIMARY KEY); +CREATE TABLE child (pk INTEGER PRIMARY KEY, parent_id INTEGER, FOREIGN KEY(parent_id) REFERENCES parent(pk) ON DELETE CASCADE); +INSERT INTO parent VALUES (1), (2), (3), (4); +INSERT INTO child VALUES (1,1), (2,2), (3,3), (4,4); +connection node_1; +START TRANSACTION; +SELECT * FROM parent FOR UPDATE; +pk +1 +2 +3 +4 +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +REPAIR TABLE child;; +Table Op Msg_type Msg_text +test.child repair note The storage engine for the table doesn't support repair +connection node_1; +COMMIT; +DROP TABLE child, parent; +disconnect node_1a; +CREATE TABLE parent (pk INTEGER PRIMARY KEY); +CREATE TABLE child (pk INTEGER PRIMARY KEY, parent_id INTEGER, FOREIGN KEY(parent_id) REFERENCES parent(pk) ON UPDATE CASCADE ON DELETE CASCADE); +INSERT INTO parent VALUES (1), (2), (3), (4); +INSERT INTO child VALUES (1,1), (2,2), (3,3), (4,4); +connection node_1; +START TRANSACTION; +SELECT * FROM parent FOR UPDATE; +pk +1 +2 +3 +4 +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +REPAIR TABLE child;; +Table Op Msg_type Msg_text +test.child repair note The storage engine for the table doesn't support repair +connection node_1; +COMMIT; +DROP TABLE child, parent; +disconnect node_1a; +CREATE TABLE parent (pk INTEGER PRIMARY KEY); +CREATE TABLE child (pk INTEGER PRIMARY KEY, parent_id INTEGER, FOREIGN KEY(parent_id) REFERENCES parent(pk) ); +INSERT INTO parent VALUES (1), (2), (3), (4); +INSERT INTO child VALUES (1,1), (2,2), (3,3), (4,4); +connection node_1; +START TRANSACTION; +SELECT * FROM parent FOR UPDATE; +pk +1 +2 +3 +4 +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +CHECK TABLE child;; +Table Op Msg_type Msg_text +test.child check status OK +connection node_1; +COMMIT; +DROP TABLE child, parent; +disconnect node_1a; +CREATE TABLE parent (pk INTEGER PRIMARY KEY); +CREATE TABLE child (pk INTEGER PRIMARY KEY, parent_id INTEGER, FOREIGN KEY(parent_id) REFERENCES parent(pk) ON UPDATE CASCADE); +INSERT INTO parent VALUES (1), (2), (3), (4); +INSERT INTO child VALUES (1,1), (2,2), (3,3), (4,4); +connection node_1; +START TRANSACTION; +SELECT * FROM parent FOR UPDATE; +pk +1 +2 +3 +4 +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +CHECK TABLE child;; +Table Op Msg_type Msg_text +test.child check status OK +connection node_1; +COMMIT; +DROP TABLE child, parent; +disconnect node_1a; +CREATE TABLE parent (pk INTEGER PRIMARY KEY); +CREATE TABLE child (pk INTEGER PRIMARY KEY, parent_id INTEGER, FOREIGN KEY(parent_id) REFERENCES parent(pk) ON DELETE CASCADE); +INSERT INTO parent VALUES (1), (2), (3), (4); +INSERT INTO child VALUES (1,1), (2,2), (3,3), (4,4); +connection node_1; +START TRANSACTION; +SELECT * FROM parent FOR UPDATE; +pk +1 +2 +3 +4 +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +CHECK TABLE child;; +Table Op Msg_type Msg_text +test.child check status OK +connection node_1; +COMMIT; +DROP TABLE child, parent; +disconnect node_1a; +CREATE TABLE parent (pk INTEGER PRIMARY KEY); +CREATE TABLE child (pk INTEGER PRIMARY KEY, parent_id INTEGER, FOREIGN KEY(parent_id) REFERENCES parent(pk) ON UPDATE CASCADE ON DELETE CASCADE); +INSERT INTO parent VALUES (1), (2), (3), (4); +INSERT INTO child VALUES (1,1), (2,2), (3,3), (4,4); +connection node_1; +START TRANSACTION; +SELECT * FROM parent FOR UPDATE; +pk +1 +2 +3 +4 +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +CHECK TABLE child;; +Table Op Msg_type Msg_text +test.child check status OK +connection node_1; +COMMIT; +DROP TABLE child, parent; +disconnect node_1a; +CREATE TABLE parent (pk INTEGER PRIMARY KEY); +CREATE TABLE child (pk INTEGER PRIMARY KEY, parent_id INTEGER, FOREIGN KEY(parent_id) REFERENCES parent(pk) ); +INSERT INTO parent VALUES (1), (2), (3), (4); +INSERT INTO child VALUES (1,1), (2,2), (3,3), (4,4); +connection node_1; +START TRANSACTION; +SELECT * FROM parent FOR UPDATE; +pk +1 +2 +3 +4 +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +ANALYZE TABLE child;; +Table Op Msg_type Msg_text +test.child analyze status Engine-independent statistics collected +test.child analyze status OK +connection node_1; +COMMIT; +DROP TABLE child, parent; +disconnect node_1a; +CREATE TABLE parent (pk INTEGER PRIMARY KEY); +CREATE TABLE child (pk INTEGER PRIMARY KEY, parent_id INTEGER, FOREIGN KEY(parent_id) REFERENCES parent(pk) ON UPDATE CASCADE); +INSERT INTO parent VALUES (1), (2), (3), (4); +INSERT INTO child VALUES (1,1), (2,2), (3,3), (4,4); +connection node_1; +START TRANSACTION; +SELECT * FROM parent FOR UPDATE; +pk +1 +2 +3 +4 +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +ANALYZE TABLE child;; +Table Op Msg_type Msg_text +test.child analyze status Engine-independent statistics collected +test.child analyze status OK +connection node_1; +COMMIT; +DROP TABLE child, parent; +disconnect node_1a; +CREATE TABLE parent (pk INTEGER PRIMARY KEY); +CREATE TABLE child (pk INTEGER PRIMARY KEY, parent_id INTEGER, FOREIGN KEY(parent_id) REFERENCES parent(pk) ON DELETE CASCADE); +INSERT INTO parent VALUES (1), (2), (3), (4); +INSERT INTO child VALUES (1,1), (2,2), (3,3), (4,4); +connection node_1; +START TRANSACTION; +SELECT * FROM parent FOR UPDATE; +pk +1 +2 +3 +4 +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +ANALYZE TABLE child;; +Table Op Msg_type Msg_text +test.child analyze status Engine-independent statistics collected +test.child analyze status OK +connection node_1; +COMMIT; +DROP TABLE child, parent; +disconnect node_1a; +CREATE TABLE parent (pk INTEGER PRIMARY KEY); +CREATE TABLE child (pk INTEGER PRIMARY KEY, parent_id INTEGER, FOREIGN KEY(parent_id) REFERENCES parent(pk) ON UPDATE CASCADE ON DELETE CASCADE); +INSERT INTO parent VALUES (1), (2), (3), (4); +INSERT INTO child VALUES (1,1), (2,2), (3,3), (4,4); +connection node_1; +START TRANSACTION; +SELECT * FROM parent FOR UPDATE; +pk +1 +2 +3 +4 +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +ANALYZE TABLE child;; +Table Op Msg_type Msg_text +test.child analyze status Engine-independent statistics collected +test.child analyze status OK +connection node_1; +COMMIT; +DROP TABLE child, parent; +disconnect node_1a; diff --git a/mysql-test/suite/galera/r/galera_gtid_server_id.result b/mysql-test/suite/galera/r/galera_gtid_server_id.result new file mode 100644 index 00000000000..8765fcc1636 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_gtid_server_id.result @@ -0,0 +1,83 @@ +connection node_2; +connection node_1; +connection node_1; +select @@gtid_domain_id, @@server_id, @@wsrep_gtid_domain_id,@@wsrep_gtid_mode; +@@gtid_domain_id @@server_id @@wsrep_gtid_domain_id @@wsrep_gtid_mode +0 11 1 1 +connection node_2; +call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node."); +select @@gtid_domain_id, @@server_id, @@wsrep_gtid_domain_id,@@wsrep_gtid_mode; +@@gtid_domain_id @@server_id @@wsrep_gtid_domain_id @@wsrep_gtid_mode +0 12 1 1 +connection node_1; +CREATE TABLE t1(id int not null primary key) engine=innodb; +INSERT INTO t1 values (1); +show global variables like '%gtid%'; +Variable_name Value +gtid_binlog_pos 1-11-2 +gtid_binlog_state 1-11-2 +gtid_cleanup_batch_size 64 +gtid_current_pos 1-11-2 +gtid_domain_id 0 +gtid_ignore_duplicates OFF +gtid_pos_auto_engines +gtid_slave_pos +gtid_strict_mode OFF +wsrep_gtid_domain_id 1 +wsrep_gtid_mode ON +connection node_2; +SET SESSION wsrep_sync_wait=15; +show global variables like '%gtid%'; +Variable_name Value +gtid_binlog_pos 0-12-1,1-11-2 +gtid_binlog_state 0-12-1,1-11-2 +gtid_cleanup_batch_size 64 +gtid_current_pos 0-12-1 +gtid_domain_id 0 +gtid_ignore_duplicates OFF +gtid_pos_auto_engines +gtid_slave_pos +gtid_strict_mode OFF +wsrep_gtid_domain_id 1 +wsrep_gtid_mode ON +SET GLOBAL server_id=200; +ERROR 42000: Variable 'server_id' can't be set to the value of '200' +SHOW WARNINGS; +Level Code Message +Warning 1231 Can't change server_id because wsrep and wsrep_gtid_mode is set. You can set server_id only with wsrep_new_cluster. +Error 1231 Variable 'server_id' can't be set to the value of '200' +SET SESSION server_id=200; +ERROR 42000: Variable 'server_id' can't be set to the value of '200' +SHOW WARNINGS; +Level Code Message +Warning 1231 Can't change server_id because wsrep and wsrep_gtid_mode is set. You can set server_id only with wsrep_new_cluster. +Error 1231 Variable 'server_id' can't be set to the value of '200' +INSERT INTO t1 values(2); +show global variables like '%gtid%'; +Variable_name Value +gtid_binlog_pos 0-12-1,1-11-3 +gtid_binlog_state 0-12-1,1-11-3 +gtid_cleanup_batch_size 64 +gtid_current_pos 0-12-1 +gtid_domain_id 0 +gtid_ignore_duplicates OFF +gtid_pos_auto_engines +gtid_slave_pos +gtid_strict_mode OFF +wsrep_gtid_domain_id 1 +wsrep_gtid_mode ON +connection node_1; +show global variables like '%gtid%'; +Variable_name Value +gtid_binlog_pos 1-11-3 +gtid_binlog_state 1-11-3 +gtid_cleanup_batch_size 64 +gtid_current_pos 1-11-3 +gtid_domain_id 0 +gtid_ignore_duplicates OFF +gtid_pos_auto_engines +gtid_slave_pos +gtid_strict_mode OFF +wsrep_gtid_domain_id 1 +wsrep_gtid_mode ON +DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_gtid_slave.result b/mysql-test/suite/galera/r/galera_gtid_slave.result index 1ff062064e7..d460d169811 100644 --- a/mysql-test/suite/galera/r/galera_gtid_slave.result +++ b/mysql-test/suite/galera/r/galera_gtid_slave.result @@ -41,3 +41,5 @@ reset master; SET GLOBAL wsrep_on=ON; connection node_3; reset master; +connection node_2; +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); diff --git a/mysql-test/suite/galera/r/galera_gtid_slave_sst_rsync.result b/mysql-test/suite/galera/r/galera_gtid_slave_sst_rsync.result index 992f6c3455b..f41e3abc497 100644 --- a/mysql-test/suite/galera/r/galera_gtid_slave_sst_rsync.result +++ b/mysql-test/suite/galera/r/galera_gtid_slave_sst_rsync.result @@ -166,3 +166,5 @@ set global wsrep_on=ON; #Connection 3 connection node_3; reset master; +connection node_2; +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); diff --git a/mysql-test/suite/galera/r/galera_gtid_trx_conflict.result b/mysql-test/suite/galera/r/galera_gtid_trx_conflict.result index dcabff40841..602816f18a9 100644 --- a/mysql-test/suite/galera/r/galera_gtid_trx_conflict.result +++ b/mysql-test/suite/galera/r/galera_gtid_trx_conflict.result @@ -42,3 +42,4 @@ SELECT @@gtid_binlog_state; @@gtid_binlog_state 1-1-101 DROP TABLE t1; +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); diff --git a/mysql-test/suite/galera/r/galera_last_committed_id.result b/mysql-test/suite/galera/r/galera_last_committed_id.result index eadf49d7ce0..1a1339ede32 100644 --- a/mysql-test/suite/galera/r/galera_last_committed_id.result +++ b/mysql-test/suite/galera/r/galera_last_committed_id.result @@ -33,3 +33,5 @@ wsrep_last_written_id_advanced 1 SET AUTOCOMMIT=ON; DROP TABLE t1; +connection node_2; +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); diff --git a/mysql-test/suite/galera/r/galera_myisam_transactions.result b/mysql-test/suite/galera/r/galera_myisam_transactions.result index 091c5ffb6f6..04f68c29305 100644 --- a/mysql-test/suite/galera/r/galera_myisam_transactions.result +++ b/mysql-test/suite/galera/r/galera_myisam_transactions.result @@ -37,3 +37,18 @@ SELECT COUNT(*) = 0 FROM t2; COUNT(*) = 0 1 DROP TABLE t1, t2, t3; +SET SESSION lock_wait_timeout=2; +SET GLOBAL wsrep_replicate_myisam= ON; +Warnings: +Warning 1287 '@@wsrep_replicate_myisam' is deprecated and will be removed in a future release. Please use '@@wsrep_mode=REPLICATE_MYISAM' instead +CREATE TEMPORARY TABLE t1 (i INT, PRIMARY KEY pk (i)) ENGINE=MyISAM; +Warnings: +Warning 1280 Name 'pk' ignored for PRIMARY key. +PREPARE stmt FROM "INSERT INTO t1 (id) SELECT * FROM (SELECT 4 AS i) AS y"; +INSERT INTO t1 VALUES(4); +DEALLOCATE PREPARE stmt; +COMMIT; +DROP TABLE t1; +SET GLOBAL wsrep_replicate_myisam=OFF; +Warnings: +Warning 1287 '@@wsrep_replicate_myisam' is deprecated and will be removed in a future release. Please use '@@wsrep_mode=REPLICATE_MYISAM' instead diff --git a/mysql-test/suite/galera/r/galera_repair_view.result b/mysql-test/suite/galera/r/galera_repair_view.result new file mode 100644 index 00000000000..8dfe8c8db52 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_repair_view.result @@ -0,0 +1,17 @@ +connection node_2; +connection node_1; +CREATE TABLE t1(a int not null primary key) engine=innodb; +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +CREATE VIEW v1 AS SELECT a FROM t1; +REPAIR VIEW v1; +Table Op Msg_type Msg_text +test.v1 repair status OK +DROP VIEW v1; +DROP TABLE t1; +CREATE VIEW v1 AS SELECT table_name FROM information_schema.tables; +REPAIR VIEW v1; +Table Op Msg_type Msg_text +test.v1 repair status OK +DROP VIEW v1; diff --git a/mysql-test/suite/galera/r/galera_sequences.result b/mysql-test/suite/galera/r/galera_sequences.result new file mode 100644 index 00000000000..48593d2a258 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_sequences.result @@ -0,0 +1,49 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 1000000 increment by 0 cache 1000 nocycle ENGINE=InnoDB; +SHOW CREATE SEQUENCE seq; +Table Create Table +seq CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 1000000 increment by 0 cache 1000 nocycle ENGINE=InnoDB +connection node_2; +SHOW CREATE SEQUENCE seq; +Table Create Table +seq CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 1000000 increment by 0 cache 1000 nocycle ENGINE=InnoDB +connection node_1; +ALTER SEQUENCE seq MAXVALUE = 10000; +SHOW CREATE SEQUENCE seq; +Table Create Table +seq CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 10000 increment by 0 cache 1000 nocycle ENGINE=InnoDB +connection node_2; +SHOW CREATE SEQUENCE seq; +Table Create Table +seq CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 10000 increment by 0 cache 1000 nocycle ENGINE=InnoDB +connection node_1; +DROP SEQUENCE seq; +SHOW CREATE SEQUENCE seq; +ERROR 42S02: Table 'test.seq' doesn't exist +connection node_2; +SHOW CREATE SEQUENCE seq; +ERROR 42S02: Table 'test.seq' doesn't exist +connection node_1; +CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1; +select NEXT VALUE FOR Seq1_1; +NEXT VALUE FOR Seq1_1 +1 +alter table Seq1_1 engine=myisam; +select NEXT VALUE FOR Seq1_1; +NEXT VALUE FOR Seq1_1 +1001 +alter table Seq1_1 engine=innodb; +select NEXT VALUE FOR Seq1_1; +NEXT VALUE FOR Seq1_1 +2001 +connection node_2; +SHOW CREATE SEQUENCE Seq1_1; +Table Create Table +Seq1_1 CREATE SEQUENCE `Seq1_1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB +select NEXT VALUE FOR Seq1_1; +NEXT VALUE FOR Seq1_1 +1 +connection node_1; +DROP SEQUENCE Seq1_1; diff --git a/mysql-test/suite/galera/r/galera_sync_wait_upto.result b/mysql-test/suite/galera/r/galera_sync_wait_upto.result index e18cd3b5432..c9f468774fb 100644 --- a/mysql-test/suite/galera/r/galera_sync_wait_upto.result +++ b/mysql-test/suite/galera/r/galera_sync_wait_upto.result @@ -23,3 +23,5 @@ WSREP_SYNC_WAIT_UPTO 1 connection node_1; DROP TABLE t1; +connection node_2; +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); diff --git a/mysql-test/suite/galera/r/galera_var_gtid_domain_id.result b/mysql-test/suite/galera/r/galera_var_gtid_domain_id.result index 3a23f0c8122..0edfdf47d34 100644 --- a/mysql-test/suite/galera/r/galera_var_gtid_domain_id.result +++ b/mysql-test/suite/galera/r/galera_var_gtid_domain_id.result @@ -89,6 +89,8 @@ connection node_2; set global wsrep_on=OFF; reset master; set global wsrep_on=ON; +connection node_2; +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); disconnect node_2; disconnect node_1; # End of test diff --git a/mysql-test/suite/galera/r/mdev_10518.result b/mysql-test/suite/galera/r/mdev_10518.result index b07f5303586..8426cd31349 100644 --- a/mysql-test/suite/galera/r/mdev_10518.result +++ b/mysql-test/suite/galera/r/mdev_10518.result @@ -89,6 +89,8 @@ connection node_2; set global wsrep_on=OFF; reset master; set global wsrep_on=ON; +connection node_2; +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); disconnect node_2; disconnect node_1; # End of test diff --git a/mysql-test/suite/sys_vars/r/wsrep_slave_threads_basic.result b/mysql-test/suite/galera/r/wsrep_slave_threads_basic.result index 62be5a42416..edfb4747d92 100644 --- a/mysql-test/suite/sys_vars/r/wsrep_slave_threads_basic.result +++ b/mysql-test/suite/galera/r/wsrep_slave_threads_basic.result @@ -1,3 +1,5 @@ +connection node_2; +connection node_1; # # wsrep_slave_threads # diff --git a/mysql-test/suite/galera/t/MDEV-10715.test b/mysql-test/suite/galera/t/MDEV-10715.test index 186320589c3..20c5293f01b 100644 --- a/mysql-test/suite/galera/t/MDEV-10715.test +++ b/mysql-test/suite/galera/t/MDEV-10715.test @@ -17,3 +17,6 @@ select wsrep_last_written_gtid(); --connection node_1 drop table t1; + +--connection node_2 +CALL mtr.add_suppression("Ignoring server id for non bootstrap node");
\ No newline at end of file diff --git a/mysql-test/suite/galera/t/MDEV-20225.test b/mysql-test/suite/galera/t/MDEV-20225.test index 2124e499530..60ab1c53e40 100644 --- a/mysql-test/suite/galera/t/MDEV-20225.test +++ b/mysql-test/suite/galera/t/MDEV-20225.test @@ -34,12 +34,16 @@ INSERT INTO t1 VALUES (NULL); # so there is no sync point or condition to wait. --sleep 1 ---connection node_2 +--let $galera_connection_name = node_2a +--let $galera_server_number = 2 +--source include/galera_connect.inc +--connection node_2a SET GLOBAL debug_dbug = 'RESET'; SET DEBUG_SYNC = 'now SIGNAL signal.mdev_20225_continue'; SET DEBUG_SYNC = 'RESET'; SET GLOBAL wsrep_slave_threads = 1; +--connection node_2 # Trigger should now be dropped on node_2. --let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME like '%tr1' --source include/wait_condition.inc diff --git a/mysql-test/suite/galera/t/MDEV-25494.test b/mysql-test/suite/galera/t/MDEV-25494.test new file mode 100644 index 00000000000..a6a70145469 --- /dev/null +++ b/mysql-test/suite/galera/t/MDEV-25494.test @@ -0,0 +1,7 @@ +--source include/galera_cluster.inc + +SET SESSION binlog_format=STATEMENT; +CREATE TEMPORARY TABLE t (i INT) UNION=(t); +ALTER TABLE t ADD extrac CHAR(1); +SHOW CREATE TABLE t; +DROP TABLE t; diff --git a/mysql-test/suite/galera/t/galera-features#117.test b/mysql-test/suite/galera/t/galera-features#117.test index 0436b201a09..30301996d1c 100644 --- a/mysql-test/suite/galera/t/galera-features#117.test +++ b/mysql-test/suite/galera/t/galera-features#117.test @@ -4,6 +4,11 @@ --source include/galera_cluster.inc --source include/have_innodb.inc +# Save original auto_increment_offset values. +--let $node_1=node_1 +--let $node_2=node_2 +--source ../galera/include/auto_increment_offset_save.inc + --connection node_2 SET SESSION wsrep_on=OFF; CREATE TABLE test.t1 (f2 INTEGER); @@ -36,3 +41,7 @@ SHOW TABLES IN test; CALL mtr.add_suppression("Inconsistent by consensus."); CALL mtr.add_suppression("WSREP: Failed to execute TOI action"); CALL mtr.add_suppression("WSREP: TO isolation end failed"); + +--connection node_1 +# Restore original auto_increment_offset values. +--source ../galera/include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera/t/galera_create_table_like.test b/mysql-test/suite/galera/t/galera_create_table_like.test index 0e0e8b0ffcf..3cf51521be1 100644 --- a/mysql-test/suite/galera/t/galera_create_table_like.test +++ b/mysql-test/suite/galera/t/galera_create_table_like.test @@ -48,3 +48,12 @@ DROP TABLE schema2.real_table3; DROP SCHEMA schema1; DROP SCHEMA schema2; + +# +# MDEV-25856: SIGSEGV in ha_myisammrg::append_create_info +# +use test; +CREATE TEMPORARY TABLE t (c INT) ENGINE=mrg_myisam UNION=(t,t2) insert_method=FIRST; +--error 1472 +CREATE TABLE t2 LIKE t; +DROP TABLE t; diff --git a/mysql-test/suite/galera/t/galera_ddl_fk_conflict.test b/mysql-test/suite/galera/t/galera_ddl_fk_conflict.test index 88837933e5a..4ec866a9f74 100644 --- a/mysql-test/suite/galera/t/galera_ddl_fk_conflict.test +++ b/mysql-test/suite/galera/t/galera_ddl_fk_conflict.test @@ -17,14 +17,6 @@ SET SESSION wsrep_sync_wait=0; --connection node_1b SET SESSION wsrep_sync_wait=0; ---let $table_admin_command = OPTIMIZE ---source galera_ddl_fk_conflict.inc ---source galera_ddl_fk_conflict_with_tmp.inc - ---let $table_admin_command = REPAIR ---source galera_ddl_fk_conflict.inc ---source galera_ddl_fk_conflict_with_tmp.inc - --let $table_admin_command = ALTER --let $table_admin_command_end = ENGINE=INNODB --source galera_ddl_fk_conflict.inc diff --git a/mysql-test/suite/galera/t/galera_ddl_fk_no_conflict.inc b/mysql-test/suite/galera/t/galera_ddl_fk_no_conflict.inc new file mode 100644 index 00000000000..9e2dd391678 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_ddl_fk_no_conflict.inc @@ -0,0 +1,34 @@ +# This test attempts to show that OPTIMIZE on a child table does NOT +# acquire MDL locks on the parent table. # +# param: $table_admin_command +# DDL table command to test, script will build full SQL statement: +# $table_admin_command TABLE c; +# +# param: $FK_constraint +# Foreign key constraint to use when creating the child table. +# + +CREATE TABLE parent (pk INTEGER PRIMARY KEY); +--eval CREATE TABLE child (pk INTEGER PRIMARY KEY, parent_id INTEGER, FOREIGN KEY(parent_id) REFERENCES parent(pk) $fk_constraint) + +INSERT INTO parent VALUES (1), (2), (3), (4); +INSERT INTO child VALUES (1,1), (2,2), (3,3), (4,4); + +--connection node_1 +# Start a transaction that uses the parent table, +# so that we acquire MDL lock on parent. +START TRANSACTION; +SELECT * FROM parent FOR UPDATE; + +# In a different connection, execute the table +# admin command (OPTIMIZE / REPAIR ...) on the child table. +--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 +--eval $table_admin_command TABLE child; + +# Expect no conflict. +--connection node_1 +COMMIT; + +DROP TABLE child, parent; + +--disconnect node_1a diff --git a/mysql-test/suite/galera/t/galera_ddl_fk_no_conflict.test b/mysql-test/suite/galera/t/galera_ddl_fk_no_conflict.test new file mode 100644 index 00000000000..6307b629e2b --- /dev/null +++ b/mysql-test/suite/galera/t/galera_ddl_fk_no_conflict.test @@ -0,0 +1,57 @@ +# +# This test attempts to show that table admin commands +# (OPTIMIZE / REPAIR / ANALYZE ...) on child table, +# do NOT cause conflicts on parent table operations. +# Contrary to what is said in MDEV-21577, which claimed +# that OPTIMIZE and REPAIR do take MDL locks on parent +# table. +# +# Should this test start failing due to a conflict +# (i.e. ER_LOCK_DEADLOCK), then it might be that we +# are missing additional keys for certification +# on the corresponding table admin command. + +--source include/galera_cluster.inc + +--let $table_admin_command = OPTIMIZE +--let $fk_constraint = +--source galera_ddl_fk_no_conflict.inc +--let $fk_constraint = ON UPDATE CASCADE +--source galera_ddl_fk_no_conflict.inc +--let $fk_constraint = ON DELETE CASCADE +--source galera_ddl_fk_no_conflict.inc +--let $fk_constraint = ON UPDATE CASCADE ON DELETE CASCADE +--source galera_ddl_fk_no_conflict.inc + + +--let $table_admin_command = REPAIR +--let $fk_constraint = +--source galera_ddl_fk_no_conflict.inc +--let $fk_constraint = ON UPDATE CASCADE +--source galera_ddl_fk_no_conflict.inc +--let $fk_constraint = ON DELETE CASCADE +--source galera_ddl_fk_no_conflict.inc +--let $fk_constraint = ON UPDATE CASCADE ON DELETE CASCADE +--source galera_ddl_fk_no_conflict.inc + + +--let $table_admin_command = CHECK +--let $fk_constraint = +--source galera_ddl_fk_no_conflict.inc +--let $fk_constraint = ON UPDATE CASCADE +--source galera_ddl_fk_no_conflict.inc +--let $fk_constraint = ON DELETE CASCADE +--source galera_ddl_fk_no_conflict.inc +--let $fk_constraint = ON UPDATE CASCADE ON DELETE CASCADE +--source galera_ddl_fk_no_conflict.inc + + +--let $table_admin_command = ANALYZE +--let $fk_constraint = +--source galera_ddl_fk_no_conflict.inc +--let $fk_constraint = ON UPDATE CASCADE +--source galera_ddl_fk_no_conflict.inc +--let $fk_constraint = ON DELETE CASCADE +--source galera_ddl_fk_no_conflict.inc +--let $fk_constraint = ON UPDATE CASCADE ON DELETE CASCADE +--source galera_ddl_fk_no_conflict.inc diff --git a/mysql-test/suite/galera/t/galera_gtid_server_id.cnf b/mysql-test/suite/galera/t/galera_gtid_server_id.cnf new file mode 100644 index 00000000000..bda7a00ab2e --- /dev/null +++ b/mysql-test/suite/galera/t/galera_gtid_server_id.cnf @@ -0,0 +1,16 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +wsrep_gtid_domain_id=1 +wsrep_gtid_mode=ON +server-id=11 +log_slave_updates +log_bin + +[mysqld.2] +wsrep_gtid_domain_id=1 +wsrep_gtid_mode=ON +server-id=12 +log_slave_updates +log_bin + diff --git a/mysql-test/suite/galera/t/galera_gtid_server_id.test b/mysql-test/suite/galera/t/galera_gtid_server_id.test new file mode 100644 index 00000000000..9bb07371f92 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_gtid_server_id.test @@ -0,0 +1,28 @@ +--source include/galera_cluster.inc + +--connection node_1 +select @@gtid_domain_id, @@server_id, @@wsrep_gtid_domain_id,@@wsrep_gtid_mode; +--connection node_2 +call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node."); +select @@gtid_domain_id, @@server_id, @@wsrep_gtid_domain_id,@@wsrep_gtid_mode; + +--connection node_1 +CREATE TABLE t1(id int not null primary key) engine=innodb; +INSERT INTO t1 values (1); +show global variables like '%gtid%'; +--connection node_2 +SET SESSION wsrep_sync_wait=15; +show global variables like '%gtid%'; +# This should give error +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL server_id=200; +SHOW WARNINGS; +# This should give error +--error ER_WRONG_VALUE_FOR_VAR +SET SESSION server_id=200; +SHOW WARNINGS; +INSERT INTO t1 values(2); +show global variables like '%gtid%'; +--connection node_1 +show global variables like '%gtid%'; +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/galera_gtid_slave.test b/mysql-test/suite/galera/t/galera_gtid_slave.test index df55ea03cb0..b3fbbb02d5f 100644 --- a/mysql-test/suite/galera/t/galera_gtid_slave.test +++ b/mysql-test/suite/galera/t/galera_gtid_slave.test @@ -90,3 +90,6 @@ SET GLOBAL wsrep_on=ON; --connection node_3 reset master; + +--connection node_2 +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); diff --git a/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test b/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test index d03445d537a..b2ddc7e153d 100644 --- a/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test +++ b/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test @@ -197,3 +197,6 @@ set global wsrep_on=ON; --echo #Connection 3 --connection node_3 reset master; + +--connection node_2 +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); diff --git a/mysql-test/suite/galera/t/galera_gtid_trx_conflict.test b/mysql-test/suite/galera/t/galera_gtid_trx_conflict.test index 27539b2ab52..6f05196b8da 100644 --- a/mysql-test/suite/galera/t/galera_gtid_trx_conflict.test +++ b/mysql-test/suite/galera/t/galera_gtid_trx_conflict.test @@ -51,6 +51,6 @@ SELECT @@gtid_binlog_state; --connection node_2 SELECT @@gtid_binlog_state; - - DROP TABLE t1; + +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); diff --git a/mysql-test/suite/galera/t/galera_last_committed_id.test b/mysql-test/suite/galera/t/galera_last_committed_id.test index b6e3e1f7e7a..6e1f0de7d0b 100644 --- a/mysql-test/suite/galera/t/galera_last_committed_id.test +++ b/mysql-test/suite/galera/t/galera_last_committed_id.test @@ -64,3 +64,6 @@ COMMIT; SET AUTOCOMMIT=ON; DROP TABLE t1; + +--connection node_2 +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); diff --git a/mysql-test/suite/galera/t/galera_myisam_transactions.test b/mysql-test/suite/galera/t/galera_myisam_transactions.test index 00e0bf3fdca..30677ddbe4d 100644 --- a/mysql-test/suite/galera/t/galera_myisam_transactions.test +++ b/mysql-test/suite/galera/t/galera_myisam_transactions.test @@ -34,3 +34,16 @@ SELECT COUNT(*) = 0 FROM t2; SELECT COUNT(*) = 0 FROM t2; DROP TABLE t1, t2, t3; + +# +# MDEV-25201 : Assertion `thd->wsrep_trx_meta.gtid.seqno == (-1)' failed in int wsrep_to_isolation_begin(THD*, const char*, const char*, const TABLE_LIST*, Alter_info*) +# +SET SESSION lock_wait_timeout=2; +SET GLOBAL wsrep_replicate_myisam= ON; +CREATE TEMPORARY TABLE t1 (i INT, PRIMARY KEY pk (i)) ENGINE=MyISAM; +PREPARE stmt FROM "INSERT INTO t1 (id) SELECT * FROM (SELECT 4 AS i) AS y"; +INSERT INTO t1 VALUES(4); +DEALLOCATE PREPARE stmt; +COMMIT; +DROP TABLE t1; +SET GLOBAL wsrep_replicate_myisam=OFF; diff --git a/mysql-test/suite/galera/t/galera_repair_view.test b/mysql-test/suite/galera/t/galera_repair_view.test new file mode 100644 index 00000000000..0010d90c7ec --- /dev/null +++ b/mysql-test/suite/galera/t/galera_repair_view.test @@ -0,0 +1,12 @@ +--source include/galera_cluster.inc + +CREATE TABLE t1(a int not null primary key) engine=innodb; +REPAIR TABLE t1; +CREATE VIEW v1 AS SELECT a FROM t1; +REPAIR VIEW v1; +DROP VIEW v1; +DROP TABLE t1; + +CREATE VIEW v1 AS SELECT table_name FROM information_schema.tables; +REPAIR VIEW v1; +DROP VIEW v1; diff --git a/mysql-test/suite/galera/t/galera_sequences.test b/mysql-test/suite/galera/t/galera_sequences.test new file mode 100644 index 00000000000..480366f6a6f --- /dev/null +++ b/mysql-test/suite/galera/t/galera_sequences.test @@ -0,0 +1,46 @@ +--source include/galera_cluster.inc + +# +# MDEV-19353 : Alter Sequence do not replicate to another nodes with in Galera Cluster +# + +--connection node_1 +CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 1000000 increment by 0 cache 1000 nocycle ENGINE=InnoDB; +SHOW CREATE SEQUENCE seq; + +--connection node_2 +SHOW CREATE SEQUENCE seq; + +--connection node_1 +ALTER SEQUENCE seq MAXVALUE = 10000; +SHOW CREATE SEQUENCE seq; + +--connection node_2 +SHOW CREATE SEQUENCE seq; + +--connection node_1 +DROP SEQUENCE seq; +--error ER_NO_SUCH_TABLE +SHOW CREATE SEQUENCE seq; + +--connection node_2 +--error ER_NO_SUCH_TABLE +SHOW CREATE SEQUENCE seq; + +# +# MDEV-18848 : Galera: 10.4 node crashed with Assertion `client_state.transaction().active()` after altering SEQUENCE table's engine to myisam and back to innodb +# +--connection node_1 +CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1; +select NEXT VALUE FOR Seq1_1; +alter table Seq1_1 engine=myisam; +select NEXT VALUE FOR Seq1_1; +alter table Seq1_1 engine=innodb; +select NEXT VALUE FOR Seq1_1; + +--connection node_2 +SHOW CREATE SEQUENCE Seq1_1; +select NEXT VALUE FOR Seq1_1; + +--connection node_1 +DROP SEQUENCE Seq1_1; diff --git a/mysql-test/suite/galera/t/galera_sync_wait_upto.test b/mysql-test/suite/galera/t/galera_sync_wait_upto.test index 05353ac7a3a..8465ddebfeb 100644 --- a/mysql-test/suite/galera/t/galera_sync_wait_upto.test +++ b/mysql-test/suite/galera/t/galera_sync_wait_upto.test @@ -70,3 +70,6 @@ INSERT INTO t1 VALUES (2); --connection node_1 DROP TABLE t1; + +--connection node_2 +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); diff --git a/mysql-test/suite/galera/t/galera_var_gtid_domain_id.test b/mysql-test/suite/galera/t/galera_var_gtid_domain_id.test index eec47507e3a..4de1121ae77 100644 --- a/mysql-test/suite/galera/t/galera_var_gtid_domain_id.test +++ b/mysql-test/suite/galera/t/galera_var_gtid_domain_id.test @@ -59,6 +59,8 @@ set global wsrep_on=OFF; reset master; set global wsrep_on=ON; +--connection node_2 +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); + --source include/galera_end.inc --echo # End of test - diff --git a/mysql-test/suite/galera/t/mdev_10518.test b/mysql-test/suite/galera/t/mdev_10518.test index eec47507e3a..4de1121ae77 100644 --- a/mysql-test/suite/galera/t/mdev_10518.test +++ b/mysql-test/suite/galera/t/mdev_10518.test @@ -59,6 +59,8 @@ set global wsrep_on=OFF; reset master; set global wsrep_on=ON; +--connection node_2 +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); + --source include/galera_end.inc --echo # End of test - diff --git a/mysql-test/suite/sys_vars/t/wsrep_slave_threads_basic.test b/mysql-test/suite/galera/t/wsrep_slave_threads_basic.test index 80b4648982d..ecf159f8365 100644 --- a/mysql-test/suite/sys_vars/t/wsrep_slave_threads_basic.test +++ b/mysql-test/suite/galera/t/wsrep_slave_threads_basic.test @@ -1,4 +1,4 @@ ---source include/have_wsrep.inc +--source include/galera_cluster.inc --echo # --echo # wsrep_slave_threads diff --git a/mysql-test/suite/galera_3nodes/r/GCF-363.result b/mysql-test/suite/galera_3nodes/r/GCF-363.result index fbcbac3a398..ca6d354f28f 100644 --- a/mysql-test/suite/galera_3nodes/r/GCF-363.result +++ b/mysql-test/suite/galera_3nodes/r/GCF-363.result @@ -7,6 +7,10 @@ connection node_3; connection node_1; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) ENGINE=InnoDB; connection node_1; +connection node_1; +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) ENGINE=InnoDB; SET GLOBAL wsrep_on=OFF; INSERT INTO t1 VALUES (1, 'a'); SET GLOBAL wsrep_on=ON; @@ -48,3 +52,4 @@ connection node_3; CALL mtr.add_suppression("WSREP: Vote 0 \\\(success\\\) on (.*) is inconsistent with group. Leaving cluster."); CALL mtr.add_suppression("WSREP: Inconsistency detected: Inconsistent by consensus on "); CALL mtr.add_suppression("Plugin 'InnoDB' will be forced to shutdown"); +connection node_1; diff --git a/mysql-test/suite/galera_3nodes/r/galera_2_cluster.result b/mysql-test/suite/galera_3nodes/r/galera_2_cluster.result index 87898891f9b..5214eafa1c8 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_2_cluster.result +++ b/mysql-test/suite/galera_3nodes/r/galera_2_cluster.result @@ -75,15 +75,19 @@ connection node_2; SET GLOBAL wsrep_on = OFF; RESET MASTER; SET GLOBAL wsrep_on = ON; +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); connection node_3; SET GLOBAL wsrep_on = OFF; RESET MASTER; SET GLOBAL wsrep_on = ON; +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); connection node_5; SET GLOBAL wsrep_on = OFF; RESET MASTER; SET GLOBAL wsrep_on = ON; +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); connection node_6; SET GLOBAL wsrep_on = OFF; RESET MASTER; SET GLOBAL wsrep_on = ON; +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); diff --git a/mysql-test/suite/galera_3nodes/t/GCF-363.test b/mysql-test/suite/galera_3nodes/t/GCF-363.test index 76be88bc771..4836d53b733 100644 --- a/mysql-test/suite/galera_3nodes/t/GCF-363.test +++ b/mysql-test/suite/galera_3nodes/t/GCF-363.test @@ -17,6 +17,8 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) ENGINE=InnoDB; --connection node_1 +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) ENGINE=InnoDB; + SET GLOBAL wsrep_on=OFF; INSERT INTO t1 VALUES (1, 'a'); SET GLOBAL wsrep_on=ON; @@ -71,4 +73,6 @@ 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"); +--connection node_1 +# Restore original auto_increment_offset values. --source ../galera/include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test b/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test index 8a9a74a7252..d7b0f36551f 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test +++ b/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test @@ -129,20 +129,28 @@ SET GLOBAL wsrep_on = OFF; RESET MASTER; SET GLOBAL wsrep_on = ON; +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); + --connection node_3 SET GLOBAL wsrep_on = OFF; RESET MASTER; SET GLOBAL wsrep_on = ON; +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); + --connection node_5 SET GLOBAL wsrep_on = OFF; RESET MASTER; SET GLOBAL wsrep_on = ON; +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); + --connection node_6 SET GLOBAL wsrep_on = OFF; RESET MASTER; SET GLOBAL wsrep_on = ON; + +CALL mtr.add_suppression("Ignoring server id for non bootstrap node"); diff --git a/mysql-test/suite/galera_sr/r/MDEV-27553.result b/mysql-test/suite/galera_sr/r/MDEV-27553.result new file mode 100644 index 00000000000..f6f81bd13f1 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/MDEV-27553.result @@ -0,0 +1,23 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +connection node_1; +SET SESSION wsrep_trx_fragment_size=1; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +SET @@global.debug_dbug="+d,ha_index_init_fail"; +ROLLBACK; +connection node_2; +SELECT COUNT(*) `Expect 0` FROM mysql.wsrep_streaming_log; +Expect 0 +0 +connection node_1; +SET @@global.debug_dbug=""; +SELECT COUNT(*) `Expect 1` FROM mysql.wsrep_streaming_log; +Expect 1 +1 +SET SESSION wsrep_on=OFF; +DELETE FROM mysql.wsrep_streaming_log; +SET SESSION wsrep_on=ON; +DROP TABLE t1; +CALL mtr.add_suppression("WSREP: Failed to init table for index scan"); diff --git a/mysql-test/suite/galera_sr/r/MDEV-27615.result b/mysql-test/suite/galera_sr/r/MDEV-27615.result new file mode 100644 index 00000000000..a3475811285 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/MDEV-27615.result @@ -0,0 +1,27 @@ +connection node_2; +connection node_1; +connection node_1; +connection node_2; +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_2; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; +SET DEBUG_SYNC='wsrep_before_fragment_certification SIGNAL before_fragment WAIT_FOR continue'; +SET SESSION wsrep_trx_fragment_size=1; +START TRANSACTION; +INSERT INTO t1 VALUES (1);; +connection node_2a; +SET SESSION wsrep_sync_wait = 0; +SET DEBUG_SYNC='now WAIT_FOR before_fragment'; +SET GLOBAL wsrep_cluster_address = ''; +SET DEBUG_SYNC = 'now SIGNAL continue'; +connection node_2; +ERROR HY000: Lost connection to MySQL server during query +connection node_2a; +SELECT * FROM mysql.wsrep_streaming_log; +node_uuid trx_id seqno flags frag +SELECT * FROM t1; +f1 +DROP TABLE t1; +SET DEBUG_SYNC = 'RESET'; +disconnect node_2; +connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2; diff --git a/mysql-test/suite/galera_sr/r/mdev_18631.result b/mysql-test/suite/galera_sr/r/mdev_18631.result index bc6c0e48538..779ae5266a3 100644 --- a/mysql-test/suite/galera_sr/r/mdev_18631.result +++ b/mysql-test/suite/galera_sr/r/mdev_18631.result @@ -5,6 +5,7 @@ connection node_1; CREATE TABLE t1(f1 INT PRIMARY KEY) ENGINE=INNODB; INSERT INTO t1 VALUES (1), (2), (3); connection node_2; +call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node."); SELECT * FROM t1; f1 1 diff --git a/mysql-test/suite/galera_sr/t/MDEV-27553.test b/mysql-test/suite/galera_sr/t/MDEV-27553.test new file mode 100644 index 00000000000..d17af175512 --- /dev/null +++ b/mysql-test/suite/galera_sr/t/MDEV-27553.test @@ -0,0 +1,33 @@ +# +# MDEV-27553 Assertion `inited==INDEX' failed: int handler::ha_index_end() +# + +--source include/galera_cluster.inc +--source include/have_debug.inc + +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); + +--connection node_1 +--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address` +SET SESSION wsrep_trx_fragment_size=1; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +# This will result in failure to remove fragments +# from streaming log, in the following ROLLBACK. +SET @@global.debug_dbug="+d,ha_index_init_fail"; +ROLLBACK; + +--connection node_2 +SELECT COUNT(*) `Expect 0` FROM mysql.wsrep_streaming_log; + + +--connection node_1 +SET @@global.debug_dbug=""; +SELECT COUNT(*) `Expect 1` FROM mysql.wsrep_streaming_log; + +SET SESSION wsrep_on=OFF; +DELETE FROM mysql.wsrep_streaming_log; +SET SESSION wsrep_on=ON; +DROP TABLE t1; + +CALL mtr.add_suppression("WSREP: Failed to init table for index scan"); diff --git a/mysql-test/suite/galera_sr/t/MDEV-27615.test b/mysql-test/suite/galera_sr/t/MDEV-27615.test new file mode 100644 index 00000000000..121a85fb20c --- /dev/null +++ b/mysql-test/suite/galera_sr/t/MDEV-27615.test @@ -0,0 +1,72 @@ +# +# MDEV-27615 - Assertion `server_id.is_undefined() == false' +# failed in wsrep::transaction::certify_fragment() +# + +--source include/galera_cluster.inc +--source include/have_debug_sync.inc + +--let $node_1=node_1 +--let $node_2=node_2 +--source suite/galera/include/auto_increment_offset_save.inc + +--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 + +--connection node_2 +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; + +# +# Set debug sync point right before the assert +# +SET DEBUG_SYNC='wsrep_before_fragment_certification SIGNAL before_fragment WAIT_FOR continue'; + +SET SESSION wsrep_trx_fragment_size=1; +START TRANSACTION; +--send INSERT INTO t1 VALUES (1); + + +# +# Disconnect node_2 from cluster +# +--connection node_2a +SET SESSION wsrep_sync_wait = 0; +--let $node_2_cluster_address = `SELECT @@wsrep_cluster_address` +SET DEBUG_SYNC='now WAIT_FOR before_fragment'; +SET GLOBAL wsrep_cluster_address = ''; + +--let $wait_condition = SELECT VARIABLE_VALUE = 'Disconnected' FROM information_schema.global_status WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +--source include/wait_condition.inc +SET DEBUG_SYNC = 'now SIGNAL continue'; + + +# +# Disconnect causes connection to node_2 to be closed +# +--connection node_2 +--error 2013 # CR_SERVER_LOST +--reap + + +# +# Reconnect node 2 +# +--connection node_2a +--disable_query_log +--eval SET GLOBAL wsrep_cluster_address = '$node_2_cluster_address'; +--enable_query_log +--source include/wait_wsrep_ready.inc + +# +# Expect the transaction to be rolled back and cleanup +# +SELECT * FROM mysql.wsrep_streaming_log; +SELECT * FROM t1; + +DROP TABLE t1; +SET DEBUG_SYNC = 'RESET'; + +--disconnect node_2 +--connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2 + + +--source suite/galera/include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera_sr/t/mdev_18631.test b/mysql-test/suite/galera_sr/t/mdev_18631.test index b6a0d85bbd4..0d1ea34c2f2 100644 --- a/mysql-test/suite/galera_sr/t/mdev_18631.test +++ b/mysql-test/suite/galera_sr/t/mdev_18631.test @@ -14,6 +14,7 @@ CREATE TABLE t1(f1 INT PRIMARY KEY) ENGINE=INNODB; INSERT INTO t1 VALUES (1), (2), (3); --connection node_2 +call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node."); SELECT * FROM t1; --connection node_1 diff --git a/mysql-test/suite/innodb/r/innodb-wl5522.result b/mysql-test/suite/innodb/r/innodb-wl5522.result index dc03bd91424..8079057712d 100644 --- a/mysql-test/suite/innodb/r/innodb-wl5522.result +++ b/mysql-test/suite/innodb/r/innodb-wl5522.result @@ -337,7 +337,7 @@ SELECT * FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files ALTER TABLE t1 IMPORT TABLESPACE; -ERROR HY000: Schema mismatch (Number of columns don't match, table has 6 columns but the tablespace meta-data file has 5 columns) +ERROR HY000: Schema mismatch (Column c3 not found in tablespace.) unlink: t1.ibd unlink: t1.cfg DROP TABLE t1; @@ -922,6 +922,22 @@ c1 c2 15 1 16 1 DROP TABLE t1; +CREATE TABLE t1 ( id INT NOT NULL, i1 INT, i2 INT, i3 INT, PRIMARY KEY (id)) engine=innodb; +CREATE TABLE t2 ( id INT NOT NULL, i1 INT, i2 INT, PRIMARY KEY (id)) engine=innodb; +ALTER TABLE t2 DISCARD TABLESPACE; +FLUSH TABLES t1 FOR EXPORT; +UNLOCK TABLES; +ALTER TABLE t2 IMPORT TABLESPACE; +ERROR HY000: Schema mismatch (Column DB_ROW_ID ordinal value mismatch, it's at 3 in the table and 4 in the tablespace meta-data file) +DROP TABLE t1, t2; +CREATE TABLE t1 ( id INT NOT NULL, i1 INT, i2 INT, PRIMARY KEY (id)) engine=innodb; +CREATE TABLE t2 ( id INT NOT NULL, i1 INT, i2 INT, i3 INT, PRIMARY KEY (id)) engine=innodb; +ALTER TABLE t2 DISCARD TABLESPACE; +FLUSH TABLES t1 FOR EXPORT; +UNLOCK TABLES; +ALTER TABLE t2 IMPORT TABLESPACE; +ERROR HY000: Schema mismatch (Column i3 not found in tablespace.) +DROP TABLE t1, t2; call mtr.add_suppression("Got error -1 when reading table '.*'"); call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'"); call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded"); diff --git a/mysql-test/suite/innodb/r/innodb_buffer_pool_resize_with_chunks.result b/mysql-test/suite/innodb/r/innodb_buffer_pool_resize_with_chunks.result index 4bf244c9588..efb652091bf 100644 --- a/mysql-test/suite/innodb/r/innodb_buffer_pool_resize_with_chunks.result +++ b/mysql-test/suite/innodb/r/innodb_buffer_pool_resize_with_chunks.result @@ -1,6 +1,6 @@ select @@innodb_buffer_pool_chunk_size; @@innodb_buffer_pool_chunk_size -2097152 +4194304 create table t1 (id int not null, val int not null default '0', primary key (id)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED; create or replace view view0 as select 1 union all select 1; set @`v_id` := 0; @@ -18,9 +18,9 @@ count(val) 262144 drop table t1; drop view view0; -set global innodb_buffer_pool_size = 1048576; +set global innodb_buffer_pool_size = 2*1048576; Warnings: -Warning 1292 Truncated incorrect innodb_buffer_pool_size value: '1048576' +Warning 1292 Truncated incorrect innodb_buffer_pool_size value: '2097152' select @@innodb_buffer_pool_size; @@innodb_buffer_pool_size -6291456 +4194304 diff --git a/mysql-test/suite/innodb/r/innodb_information_schema.result b/mysql-test/suite/innodb/r/innodb_information_schema.result index 6325917c236..921b062eae3 100644 --- a/mysql-test/suite/innodb/r/innodb_information_schema.result +++ b/mysql-test/suite/innodb/r/innodb_information_schema.result @@ -1,18 +1,18 @@ lock_mode lock_type lock_table lock_index lock_rec lock_data -X RECORD `test`.```t'\"_str` PRIMARY 2 '1', 'abc', '''abc', 'abc''', 'a''bc', 'a''bc''', '''abc''''' -X RECORD `test`.```t'\"_str` PRIMARY 2 '1', 'abc', '''abc', 'abc''', 'a''bc', 'a''bc''', '''abc''''' -X RECORD `test`.```t'\"_str` PRIMARY 3 '2', 'abc', '"abc', 'abc"', 'a"bc', 'a"bc"', '"abc""' -X RECORD `test`.```t'\"_str` PRIMARY 3 '2', 'abc', '"abc', 'abc"', 'a"bc', 'a"bc"', '"abc""' -X RECORD `test`.```t'\"_str` PRIMARY 4 '3', 'abc', '\\abc', 'abc\\', 'a\\bc', 'a\\bc\\', '\\abc\\\\' -X RECORD `test`.```t'\"_str` PRIMARY 4 '3', 'abc', '\\abc', 'abc\\', 'a\\bc', 'a\\bc\\', '\\abc\\\\' -X RECORD `test`.```t'\"_str` PRIMARY 5 '4', 'abc', '\0abc', 'abc\0', 'a\0bc', 'a\0bc\0', 'a\0bc\0\0' -X RECORD `test`.```t'\"_str` PRIMARY 5 '4', 'abc', '\0abc', 'abc\0', 'a\0bc', 'a\0bc\0', 'a\0bc\0\0' -X RECORD `test`.`t_min` PRIMARY 2 -128, 0, -32768, 0, -8388608, 0, -2147483648, 0, -9223372036854775808, 0 -X RECORD `test`.`t_min` PRIMARY 2 -128, 0, -32768, 0, -8388608, 0, -2147483648, 0, -9223372036854775808, 0 -X RECORD `test`.`t_max` PRIMARY 2 127, 255, 32767, 65535, 8388607, 16777215, 2147483647, 4294967295, 9223372036854775807, 18446744073709551615 -X RECORD `test`.`t_max` PRIMARY 2 127, 255, 32767, 65535, 8388607, 16777215, 2147483647, 4294967295, 9223372036854775807, 18446744073709551615 -X RECORD `test`.```t'\"_str` PRIMARY 1 supremum pseudo-record -X RECORD `test`.```t'\"_str` PRIMARY 1 supremum pseudo-record +X RECORD `test`.```t'\"_str` PRIMARY 1 # +X RECORD `test`.```t'\"_str` PRIMARY 1 # +X RECORD `test`.```t'\"_str` PRIMARY 2 # +X RECORD `test`.```t'\"_str` PRIMARY 2 # +X RECORD `test`.```t'\"_str` PRIMARY 3 # +X RECORD `test`.```t'\"_str` PRIMARY 3 # +X RECORD `test`.```t'\"_str` PRIMARY 4 # +X RECORD `test`.```t'\"_str` PRIMARY 4 # +X RECORD `test`.```t'\"_str` PRIMARY 5 # +X RECORD `test`.```t'\"_str` PRIMARY 5 # +X RECORD `test`.`t_max` PRIMARY 2 # +X RECORD `test`.`t_max` PRIMARY 2 # +X RECORD `test`.`t_min` PRIMARY 2 # +X RECORD `test`.`t_min` PRIMARY 2 # lock_table COUNT(*) `test`.`t_max` 2 `test`.`t_min` 2 @@ -22,28 +22,28 @@ lock_table COUNT(*) "test"."t_min" 2 "test"."`t'\""_str" 10 Field Type Null Key Default Extra -trx_id bigint(21) unsigned NO 0 -trx_state varchar(13) NO -trx_started datetime NO 0000-00-00 00:00:00 +trx_id bigint(21) unsigned NO NULL +trx_state varchar(13) NO NULL +trx_started datetime NO NULL trx_requested_lock_id varchar(81) YES NULL trx_wait_started datetime YES NULL -trx_weight bigint(21) unsigned NO 0 -trx_mysql_thread_id bigint(21) unsigned NO 0 +trx_weight bigint(21) unsigned NO NULL +trx_mysql_thread_id bigint(21) unsigned NO NULL trx_query varchar(1024) YES NULL trx_operation_state varchar(64) YES NULL -trx_tables_in_use bigint(21) unsigned NO 0 -trx_tables_locked bigint(21) unsigned NO 0 -trx_lock_structs bigint(21) unsigned NO 0 -trx_lock_memory_bytes bigint(21) unsigned NO 0 -trx_rows_locked bigint(21) unsigned NO 0 -trx_rows_modified bigint(21) unsigned NO 0 -trx_concurrency_tickets bigint(21) unsigned NO 0 +trx_tables_in_use bigint(21) unsigned NO NULL +trx_tables_locked bigint(21) unsigned NO NULL +trx_lock_structs bigint(21) unsigned NO NULL +trx_lock_memory_bytes bigint(21) unsigned NO NULL +trx_rows_locked bigint(21) unsigned NO NULL +trx_rows_modified bigint(21) unsigned NO NULL +trx_concurrency_tickets bigint(21) unsigned NO NULL trx_isolation_level enum('READ UNCOMMITTED','READ COMMITTED','REPEATABLE READ','SERIALIZABLE') NO NULL -trx_unique_checks int(1) NO 0 -trx_foreign_key_checks int(1) NO 0 +trx_unique_checks int(1) NO NULL +trx_foreign_key_checks int(1) NO NULL trx_last_foreign_key_error varchar(256) YES NULL -trx_is_read_only int(1) NO 0 -trx_autocommit_non_locking int(1) NO 0 +trx_is_read_only int(1) NO NULL +trx_autocommit_non_locking int(1) NO NULL trx_state trx_weight trx_tables_in_use trx_tables_locked trx_rows_locked trx_rows_modified trx_concurrency_tickets trx_isolation_level trx_unique_checks trx_foreign_key_checks RUNNING 3 0 1 6 1 0 REPEATABLE READ 1 1 trx_isolation_level trx_unique_checks trx_foreign_key_checks diff --git a/mysql-test/suite/innodb/r/instant_alter_import.result b/mysql-test/suite/innodb/r/instant_alter_import.result index c569c65d4ce..5c6497b5939 100644 --- a/mysql-test/suite/innodb/r/instant_alter_import.result +++ b/mysql-test/suite/innodb/r/instant_alter_import.result @@ -121,3 +121,12 @@ FLUSH TABLE t1 FOR EXPORT; UNLOCK TABLES; ALTER TABLE t2 IMPORT TABLESPACE; DROP TABLE t2, t1; +CREATE TABLE t1 ( id INT NOT NULL, i1 INT, i2 INT, PRIMARY KEY (id)) engine=innodb; +CREATE TABLE t2 ( id INT NOT NULL, i1 INT, i2 INT, PRIMARY KEY (id)) engine=innodb; +ALTER TABLE test.t1 add COLUMN i3 INT AFTER i1; +ALTER TABLE t2 DISCARD TABLESPACE; +FLUSH TABLES t1 FOR EXPORT; +UNLOCK TABLES; +ALTER TABLE t2 IMPORT TABLESPACE; +ERROR HY000: Index for table 't2' is corrupt; try to repair it +DROP TABLE t1, t2; diff --git a/mysql-test/suite/innodb/r/no_pad.result b/mysql-test/suite/innodb/r/no_pad.result new file mode 100644 index 00000000000..0c039c30a5e --- /dev/null +++ b/mysql-test/suite/innodb/r/no_pad.result @@ -0,0 +1,7 @@ +CREATE TABLE t1 (a CHAR(8), id INT, PRIMARY KEY (a,id)) COLLATE utf8_nopad_bin +ENGINE=InnoDB ROW_FORMAT=REDUNDANT; +INSERT INTO t1 VALUES ('',1); +ALTER TABLE t1 ROW_FORMAT=DYNAMIC; +INSERT INTO t1 VALUES ('',2); +ALTER TABLE t1 ROW_FORMAT=REDUNDANT; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/recovery_memory.result b/mysql-test/suite/innodb/r/recovery_memory.result new file mode 100644 index 00000000000..4fa31009130 --- /dev/null +++ b/mysql-test/suite/innodb/r/recovery_memory.result @@ -0,0 +1,12 @@ +CREATE TABLE t1(c TEXT, KEY(c(3072)))ENGINE=InnoDB; +CREATE PROCEDURE dorepeat() +LOOP +INSERT INTO t1 VALUES ('abc'); +UPDATE t1 SET c='cba'; +END LOOP +| +connect con1,localhost,root,,,; +CALL dorepeat(); +connection default; +# restart: --innodb_buffer_pool_size=5242880 +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/restart,16k,innodb.rdiff b/mysql-test/suite/innodb/r/restart,16k,innodb.rdiff new file mode 100644 index 00000000000..b36ed067913 --- /dev/null +++ b/mysql-test/suite/innodb/r/restart,16k,innodb.rdiff @@ -0,0 +1,16 @@ +--- ./suite/innodb/r/restart.result 2022-01-18 20:36:56.054653376 +1100 ++++ suite/innodb/r/restart.reject 2022-01-19 08:12:28.602794678 +1100 +@@ -32,10 +32,10 @@ + SELECT @@innodb_buffer_pool_size INTO @innodb_buffer_pool_size_orig; + SELECT CEILING((256 + 64) * @@innodb_page_size / 1048576) * 1048576 INTO @min_pool_size; + EXECUTE IMMEDIATE 'SET GLOBAL innodb_buffer_pool_size = ?' USING (@min_pool_size -1); +-ERROR 42000: Variable 'innodb_buffer_pool_size' can't be set to the value of 'WRONG_VALUE' ++ERROR 42000: Variable 'innodb_buffer_pool_size' can't be set to the value of '5242879' + SHOW WARNINGS; + Level Code Message +-Warning 1210 innodb_buffer_pool_size must be at least MIN_VAL for innodb_page_size=PAGE_SIZE +-Error 1231 Variable 'innodb_buffer_pool_size' can't be set to the value of 'WRONG_VALUE' ++Warning 1210 innodb_buffer_pool_size must be at least 5242880 for innodb_page_size=16384 ++Error 1231 Variable 'innodb_buffer_pool_size' can't be set to the value of '5242879' + EXECUTE IMMEDIATE 'SET GLOBAL innodb_buffer_pool_size = ?' USING (@min_pool_size); + SET GLOBAL innodb_buffer_pool_size = @innodb_buffer_pool_size_orig; diff --git a/mysql-test/suite/innodb/r/restart,32k,innodb.rdiff b/mysql-test/suite/innodb/r/restart,32k,innodb.rdiff new file mode 100644 index 00000000000..8fa057814c4 --- /dev/null +++ b/mysql-test/suite/innodb/r/restart,32k,innodb.rdiff @@ -0,0 +1,16 @@ +--- ./suite/innodb/r/restart.result 2022-01-18 20:36:56.054653376 +1100 ++++ suite/innodb/r/restart.reject 2022-01-19 08:07:57.402230887 +1100 +@@ -32,10 +32,10 @@ + SELECT @@innodb_buffer_pool_size INTO @innodb_buffer_pool_size_orig; + SELECT CEILING((256 + 64) * @@innodb_page_size / 1048576) * 1048576 INTO @min_pool_size; + EXECUTE IMMEDIATE 'SET GLOBAL innodb_buffer_pool_size = ?' USING (@min_pool_size -1); +-ERROR 42000: Variable 'innodb_buffer_pool_size' can't be set to the value of 'WRONG_VALUE' ++ERROR 42000: Variable 'innodb_buffer_pool_size' can't be set to the value of '10485759' + SHOW WARNINGS; + Level Code Message +-Warning 1210 innodb_buffer_pool_size must be at least MIN_VAL for innodb_page_size=PAGE_SIZE +-Error 1231 Variable 'innodb_buffer_pool_size' can't be set to the value of 'WRONG_VALUE' ++Warning 1210 innodb_buffer_pool_size must be at least 10485760 for innodb_page_size=32768 ++Error 1231 Variable 'innodb_buffer_pool_size' can't be set to the value of '10485759' + EXECUTE IMMEDIATE 'SET GLOBAL innodb_buffer_pool_size = ?' USING (@min_pool_size); + SET GLOBAL innodb_buffer_pool_size = @innodb_buffer_pool_size_orig; diff --git a/mysql-test/suite/innodb/r/restart,4k,innodb.rdiff b/mysql-test/suite/innodb/r/restart,4k,innodb.rdiff new file mode 100644 index 00000000000..7d0846360e0 --- /dev/null +++ b/mysql-test/suite/innodb/r/restart,4k,innodb.rdiff @@ -0,0 +1,16 @@ +--- ./suite/innodb/r/restart.result 2022-01-18 20:36:56.054653376 +1100 ++++ suite/innodb/r/restart.reject 2022-01-19 08:13:56.397475513 +1100 +@@ -32,10 +32,10 @@ + SELECT @@innodb_buffer_pool_size INTO @innodb_buffer_pool_size_orig; + SELECT CEILING((256 + 64) * @@innodb_page_size / 1048576) * 1048576 INTO @min_pool_size; + EXECUTE IMMEDIATE 'SET GLOBAL innodb_buffer_pool_size = ?' USING (@min_pool_size -1); +-ERROR 42000: Variable 'innodb_buffer_pool_size' can't be set to the value of 'WRONG_VALUE' ++ERROR 42000: Variable 'innodb_buffer_pool_size' can't be set to the value of '2097151' + SHOW WARNINGS; + Level Code Message +-Warning 1210 innodb_buffer_pool_size must be at least MIN_VAL for innodb_page_size=PAGE_SIZE +-Error 1231 Variable 'innodb_buffer_pool_size' can't be set to the value of 'WRONG_VALUE' ++Warning 1210 innodb_buffer_pool_size must be at least 2097152 for innodb_page_size=4096 ++Error 1231 Variable 'innodb_buffer_pool_size' can't be set to the value of '2097151' + EXECUTE IMMEDIATE 'SET GLOBAL innodb_buffer_pool_size = ?' USING (@min_pool_size); + SET GLOBAL innodb_buffer_pool_size = @innodb_buffer_pool_size_orig; diff --git a/mysql-test/suite/innodb/r/restart,64k,innodb.rdiff b/mysql-test/suite/innodb/r/restart,64k,innodb.rdiff new file mode 100644 index 00000000000..3ac9f45b196 --- /dev/null +++ b/mysql-test/suite/innodb/r/restart,64k,innodb.rdiff @@ -0,0 +1,16 @@ +--- ./suite/innodb/r/restart.result 2022-01-18 20:36:56.054653376 +1100 ++++ suite/innodb/r/restart.reject 2022-01-19 08:11:32.418759095 +1100 +@@ -32,10 +32,10 @@ + SELECT @@innodb_buffer_pool_size INTO @innodb_buffer_pool_size_orig; + SELECT CEILING((256 + 64) * @@innodb_page_size / 1048576) * 1048576 INTO @min_pool_size; + EXECUTE IMMEDIATE 'SET GLOBAL innodb_buffer_pool_size = ?' USING (@min_pool_size -1); +-ERROR 42000: Variable 'innodb_buffer_pool_size' can't be set to the value of 'WRONG_VALUE' ++ERROR 42000: Variable 'innodb_buffer_pool_size' can't be set to the value of '20971519' + SHOW WARNINGS; + Level Code Message +-Warning 1210 innodb_buffer_pool_size must be at least MIN_VAL for innodb_page_size=PAGE_SIZE +-Error 1231 Variable 'innodb_buffer_pool_size' can't be set to the value of 'WRONG_VALUE' ++Warning 1210 innodb_buffer_pool_size must be at least 20971520 for innodb_page_size=65536 ++Error 1231 Variable 'innodb_buffer_pool_size' can't be set to the value of '20971519' + EXECUTE IMMEDIATE 'SET GLOBAL innodb_buffer_pool_size = ?' USING (@min_pool_size); + SET GLOBAL innodb_buffer_pool_size = @innodb_buffer_pool_size_orig; diff --git a/mysql-test/suite/innodb/r/restart,8k,innodb.rdiff b/mysql-test/suite/innodb/r/restart,8k,innodb.rdiff new file mode 100644 index 00000000000..4da55ebfcef --- /dev/null +++ b/mysql-test/suite/innodb/r/restart,8k,innodb.rdiff @@ -0,0 +1,16 @@ +--- ./suite/innodb/r/restart.result 2022-01-18 20:36:56.054653376 +1100 ++++ suite/innodb/r/restart.reject 2022-01-19 08:13:11.027788852 +1100 +@@ -32,10 +32,10 @@ + SELECT @@innodb_buffer_pool_size INTO @innodb_buffer_pool_size_orig; + SELECT CEILING((256 + 64) * @@innodb_page_size / 1048576) * 1048576 INTO @min_pool_size; + EXECUTE IMMEDIATE 'SET GLOBAL innodb_buffer_pool_size = ?' USING (@min_pool_size -1); +-ERROR 42000: Variable 'innodb_buffer_pool_size' can't be set to the value of 'WRONG_VALUE' ++ERROR 42000: Variable 'innodb_buffer_pool_size' can't be set to the value of '3145727' + SHOW WARNINGS; + Level Code Message +-Warning 1210 innodb_buffer_pool_size must be at least MIN_VAL for innodb_page_size=PAGE_SIZE +-Error 1231 Variable 'innodb_buffer_pool_size' can't be set to the value of 'WRONG_VALUE' ++Warning 1210 innodb_buffer_pool_size must be at least 3145728 for innodb_page_size=8192 ++Error 1231 Variable 'innodb_buffer_pool_size' can't be set to the value of '3145727' + EXECUTE IMMEDIATE 'SET GLOBAL innodb_buffer_pool_size = ?' USING (@min_pool_size); + SET GLOBAL innodb_buffer_pool_size = @innodb_buffer_pool_size_orig; diff --git a/mysql-test/suite/innodb/r/restart.result b/mysql-test/suite/innodb/r/restart.result index ea9734d5a01..aba08a9ae99 100644 --- a/mysql-test/suite/innodb/r/restart.result +++ b/mysql-test/suite/innodb/r/restart.result @@ -27,3 +27,16 @@ a SELECT * FROM td; a DROP TABLE tr,tc,td; +# +# MDEV-27467 innodb to enfore the minimum innodb_buffer_pool_size in SET (resize) the same as startup +# +SELECT @@innodb_buffer_pool_size INTO @innodb_buffer_pool_size_orig; +SELECT CEILING((256 + 64) * @@innodb_page_size / 1048576) * 1048576 INTO @min_pool_size; +EXECUTE IMMEDIATE 'SET GLOBAL innodb_buffer_pool_size = ?' USING (@min_pool_size -1); +ERROR 42000: Variable 'innodb_buffer_pool_size' can't be set to the value of 'WRONG_VALUE' +SHOW WARNINGS; +Level Code Message +Warning 1210 innodb_buffer_pool_size must be at least MIN_VAL for innodb_page_size=PAGE_SIZE +Error 1231 Variable 'innodb_buffer_pool_size' can't be set to the value of 'WRONG_VALUE' +EXECUTE IMMEDIATE 'SET GLOBAL innodb_buffer_pool_size = ?' USING (@min_pool_size); +SET GLOBAL innodb_buffer_pool_size = @innodb_buffer_pool_size_orig; diff --git a/mysql-test/suite/innodb/r/skip_symbolic_links.result b/mysql-test/suite/innodb/r/skip_symbolic_links.result new file mode 100644 index 00000000000..e7a8a3cf86b --- /dev/null +++ b/mysql-test/suite/innodb/r/skip_symbolic_links.result @@ -0,0 +1,56 @@ +SELECT @@have_symlink; +@@have_symlink +DISABLED +CREATE TABLE t1(a INT) ENGINE=InnoDB DATA DIRECTORY 'MYSQL_TMP_DIR'; +Warnings: +Warning 1618 <DATA DIRECTORY> option ignored +DROP TABLE t1; +CREATE TABLE t1(a INT) ENGINE=InnoDB; +ALTER TABLE t1 DATA DIRECTORY 'MYSQL_TMP_DIR'; +Warnings: +Warning 1618 <DATA DIRECTORY> option ignored +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t1; +# restart: --symbolic-links +CREATE TABLE t1(a INT PRIMARY KEY, b INT) ENGINE=InnoDB +DATA DIRECTORY 'MYSQL_TMP_DIR'; +CREATE TABLE t2(a INT PRIMARY KEY, b INT) ENGINE=InnoDB +DATA DIRECTORY 'MYSQL_TMP_DIR'; +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +# restart +ALTER TABLE t1 FORCE, ALGORITHM=INPLACE; +Warnings: +Warning 1618 <DATA DIRECTORY> option ignored +ALTER TABLE t2 FORCE, ALGORITHM=COPY; +Warnings: +Warning 1618 <DATA DIRECTORY> option ignored +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +Warnings: +Warning 1618 <DATA DIRECTORY> option ignored +t1.ibd +DROP TABLE t2; +RENAME TABLE t1 TO t2; +ALTER TABLE t2 ADD UNIQUE INDEX(b), RENAME TO t3; +Warnings: +Warning 1618 <DATA DIRECTORY> option ignored +ALTER TABLE t3 RENAME TO t2; +ALTER TABLE t2 DROP INDEX b, RENAME TO t1; +Warnings: +Warning 1618 <DATA DIRECTORY> option ignored +ALTER TABLE t1 CHANGE b c INT; +Warnings: +Warning 1618 <DATA DIRECTORY> option ignored +ALTER TABLE t1 CHANGE c b INT NOT NULL; +Warnings: +Warning 1618 <DATA DIRECTORY> option ignored +t1.ibd +TRUNCATE TABLE t1; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/101_compatibility.test b/mysql-test/suite/innodb/t/101_compatibility.test index eb1ec3b26ac..878daad2756 100644 --- a/mysql-test/suite/innodb/t/101_compatibility.test +++ b/mysql-test/suite/innodb/t/101_compatibility.test @@ -1,5 +1,6 @@ --source include/innodb_page_size.inc --source include/not_embedded.inc +--source include/have_symlink.inc -- echo # -- echo # MDEV-11623 MariaDB 10.1 fails to start datadir created with diff --git a/mysql-test/suite/innodb/t/create_isl_with_direct.test b/mysql-test/suite/innodb/t/create_isl_with_direct.test index 1427264e13e..2092d03b72f 100644 --- a/mysql-test/suite/innodb/t/create_isl_with_direct.test +++ b/mysql-test/suite/innodb/t/create_isl_with_direct.test @@ -1,5 +1,6 @@ --source include/not_embedded.inc --source include/have_innodb.inc +--source include/have_symlink.inc --disable_query_log CALL mtr.add_suppression(".*Failed to set O_DIRECT on file.*"); diff --git a/mysql-test/suite/innodb/t/innodb-wl5522.test b/mysql-test/suite/innodb/t/innodb-wl5522.test index a70ae86f1cd..80d987fb87f 100644 --- a/mysql-test/suite/innodb/t/innodb-wl5522.test +++ b/mysql-test/suite/innodb/t/innodb-wl5522.test @@ -1084,6 +1084,44 @@ DROP TABLE t1; SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed; --enable_query_log + +CREATE TABLE t1 ( id INT NOT NULL, i1 INT, i2 INT, i3 INT, PRIMARY KEY (id)) engine=innodb; +CREATE TABLE t2 ( id INT NOT NULL, i1 INT, i2 INT, PRIMARY KEY (id)) engine=innodb; + +ALTER TABLE t2 DISCARD TABLESPACE; +FLUSH TABLES t1 FOR EXPORT; + +--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd +--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg + +UNLOCK TABLES; +--error ER_TABLE_SCHEMA_MISMATCH +ALTER TABLE t2 IMPORT TABLESPACE; + +DROP TABLE t1, t2; + + +CREATE TABLE t1 ( id INT NOT NULL, i1 INT, i2 INT, PRIMARY KEY (id)) engine=innodb; +--remove_file $MYSQLD_DATADIR/test/t2.ibd +CREATE TABLE t2 ( id INT NOT NULL, i1 INT, i2 INT, i3 INT, PRIMARY KEY (id)) engine=innodb; + +ALTER TABLE t2 DISCARD TABLESPACE; +FLUSH TABLES t1 FOR EXPORT; + +--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd +--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg + +UNLOCK TABLES; +--error ER_TABLE_SCHEMA_MISMATCH +ALTER TABLE t2 IMPORT TABLESPACE; + +--remove_file $MYSQLD_DATADIR/test/t2.ibd +--remove_file $MYSQLD_DATADIR/test/t2.cfg + + +DROP TABLE t1, t2; + + call mtr.add_suppression("Got error -1 when reading table '.*'"); call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'"); call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded"); diff --git a/mysql-test/suite/innodb/t/innodb-wl5980-alter.test b/mysql-test/suite/innodb/t/innodb-wl5980-alter.test index 213997a8682..09c54db644f 100644 --- a/mysql-test/suite/innodb/t/innodb-wl5980-alter.test +++ b/mysql-test/suite/innodb/t/innodb-wl5980-alter.test @@ -4,6 +4,7 @@ --echo # --source include/have_innodb.inc +--source include/have_symlink.inc SET @innodb_file_per_table_orig=@@GLOBAL.innodb_file_per_table; LET $regexp=/FTS_[0-9a-f_]+([A-Z0-9_]+)\.([islbd]{3})/FTS_AUX_\1.\2/; diff --git a/mysql-test/suite/innodb/t/innodb-wl5980-debug.test b/mysql-test/suite/innodb/t/innodb-wl5980-debug.test index 2c5e2b48870..dbb8ad33676 100644 --- a/mysql-test/suite/innodb/t/innodb-wl5980-debug.test +++ b/mysql-test/suite/innodb/t/innodb-wl5980-debug.test @@ -8,6 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc --source include/have_innodb.inc +--source include/have_symlink.inc # These messages are expected in the log call mtr.add_suppression("Cannot find space id [0-9]+ in the tablespace memory cache"); diff --git a/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_with_chunks.opt b/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_with_chunks.opt index b97a3995457..ade197de338 100644 --- a/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_with_chunks.opt +++ b/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_with_chunks.opt @@ -1,3 +1,3 @@ --innodb-buffer-pool-size=16M ---innodb-buffer-pool-chunk-size=2M +--innodb-buffer-pool-chunk-size=4M --innodb-page-size=4k diff --git a/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_with_chunks.test b/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_with_chunks.test index b63bede11ad..d11443ca1b2 100644 --- a/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_with_chunks.test +++ b/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_with_chunks.test @@ -51,7 +51,7 @@ drop table t1; drop view view0; # Try to shrink buffer pool to smaller than chunk size -set global innodb_buffer_pool_size = 1048576; +set global innodb_buffer_pool_size = 2*1048576; --source include/wait_condition.inc select @@innodb_buffer_pool_size; diff --git a/mysql-test/suite/innodb/t/innodb_information_schema.test b/mysql-test/suite/innodb/t/innodb_information_schema.test index 395fa779773..88e2d3601a6 100644 --- a/mysql-test/suite/innodb/t/innodb_information_schema.test +++ b/mysql-test/suite/innodb/t/innodb_information_schema.test @@ -148,6 +148,8 @@ if (!$success) -- echo Timeout waiting for rows in INNODB_LOCKS to appear } +--replace_column 6 # +--sorted_result SELECT lock_mode, lock_type, lock_table, lock_index, lock_rec, lock_data FROM INFORMATION_SCHEMA.INNODB_LOCKS ORDER BY lock_data; diff --git a/mysql-test/suite/innodb/t/instant_alter_import.test b/mysql-test/suite/innodb/t/instant_alter_import.test index 99ae48ba815..5504cee4dce 100644 --- a/mysql-test/suite/innodb/t/instant_alter_import.test +++ b/mysql-test/suite/innodb/t/instant_alter_import.test @@ -6,6 +6,11 @@ call mtr.add_suppression("Operating system error number .* in a file operation." call mtr.add_suppression("The error means the system cannot find the path specified."); call mtr.add_suppression("File ./test/t1.ibd: 'delete' returned OS error"); +--disable_query_log +call mtr.add_suppression("Table `test`.`t2` contains unrecognizable instant ALTER metadata"); +call mtr.add_suppression("Index for table 't2' is corrupt; try to repair it"); +--enable_query_log + set default_storage_engine=innodb; --echo # @@ -185,3 +190,21 @@ UNLOCK TABLES; ALTER TABLE t2 IMPORT TABLESPACE; DROP TABLE t2, t1; + + +CREATE TABLE t1 ( id INT NOT NULL, i1 INT, i2 INT, PRIMARY KEY (id)) engine=innodb; +CREATE TABLE t2 ( id INT NOT NULL, i1 INT, i2 INT, PRIMARY KEY (id)) engine=innodb; + +ALTER TABLE test.t1 add COLUMN i3 INT AFTER i1; + +ALTER TABLE t2 DISCARD TABLESPACE; +FLUSH TABLES t1 FOR EXPORT; + +--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd +--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg + +UNLOCK TABLES; +--error ER_NOT_KEYFILE +ALTER TABLE t2 IMPORT TABLESPACE; + +DROP TABLE t1, t2; diff --git a/mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test b/mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test index 92c3e2fbb08..ac5f14ba9ad 100644 --- a/mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test +++ b/mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test @@ -47,7 +47,8 @@ EOF --error ER_UNKNOWN_STORAGE_ENGINE SELECT * FROM t1 WHERE PK = 1; -let $restart_parameters=--innodb-force-recovery=1; +# We will disable also purge, to not let it request the corrupted page. +let $restart_parameters=--innodb-force-recovery=2; --source include/restart_mysqld.inc SELECT * FROM t1 WHERE PK = 1; --error ER_NOT_KEYFILE diff --git a/mysql-test/suite/innodb/t/no_pad.test b/mysql-test/suite/innodb/t/no_pad.test new file mode 100644 index 00000000000..1be1972c9ca --- /dev/null +++ b/mysql-test/suite/innodb/t/no_pad.test @@ -0,0 +1,10 @@ +--source include/have_innodb.inc + +CREATE TABLE t1 (a CHAR(8), id INT, PRIMARY KEY (a,id)) COLLATE utf8_nopad_bin +ENGINE=InnoDB ROW_FORMAT=REDUNDANT; + +INSERT INTO t1 VALUES ('',1); +ALTER TABLE t1 ROW_FORMAT=DYNAMIC; +INSERT INTO t1 VALUES ('',2); +ALTER TABLE t1 ROW_FORMAT=REDUNDANT; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/recovery_memory.opt b/mysql-test/suite/innodb/t/recovery_memory.opt new file mode 100644 index 00000000000..7207fd27a42 --- /dev/null +++ b/mysql-test/suite/innodb/t/recovery_memory.opt @@ -0,0 +1 @@ +--innodb_buffer_pool_size=1073741824 diff --git a/mysql-test/suite/innodb/t/recovery_memory.test b/mysql-test/suite/innodb/t/recovery_memory.test new file mode 100644 index 00000000000..d9afd52c499 --- /dev/null +++ b/mysql-test/suite/innodb/t/recovery_memory.test @@ -0,0 +1,21 @@ +--source include/have_innodb.inc +--source include/big_test.inc +CREATE TABLE t1(c TEXT, KEY(c(3072)))ENGINE=InnoDB; +DELIMITER |; + +CREATE PROCEDURE dorepeat() + LOOP + INSERT INTO t1 VALUES ('abc'); + UPDATE t1 SET c='cba'; + END LOOP +| + +DELIMITER ;| +connect(con1,localhost,root,,,); +send CALL dorepeat(); +connection default; +sleep 10; +let $shutdown_timeout=0; +let $restart_parameters=--innodb_buffer_pool_size=5242880; +--source include/restart_mysqld.inc +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/restart.opt b/mysql-test/suite/innodb/t/restart.opt new file mode 100644 index 00000000000..ce43e89cb2b --- /dev/null +++ b/mysql-test/suite/innodb/t/restart.opt @@ -0,0 +1,2 @@ +--loose-innodb_disable_resize_buffer_pool_debug=0 +--innodb-buffer-pool-chunk-size=1M diff --git a/mysql-test/suite/innodb/t/restart.test b/mysql-test/suite/innodb/t/restart.test index a5f2e5a42e8..1ca4f51c747 100644 --- a/mysql-test/suite/innodb/t/restart.test +++ b/mysql-test/suite/innodb/t/restart.test @@ -1,5 +1,6 @@ --source include/innodb_page_size.inc --source include/not_embedded.inc +--source include/have_symlink.inc let datadir= `select @@datadir`; let page_size= `select @@innodb_page_size`; @@ -85,3 +86,26 @@ SELECT * FROM tr; SELECT * FROM tc; SELECT * FROM td; DROP TABLE tr,tc,td; + +--echo # +--echo # MDEV-27467 innodb to enfore the minimum innodb_buffer_pool_size in SET (resize) the same as startup +--echo # + +let $wait_timeout = 180; +let $wait_condition = + SELECT SUBSTR(variable_value, 1, 34) = 'Completed resizing buffer pool at ' + FROM information_schema.global_status + WHERE LOWER(variable_name) = 'innodb_buffer_pool_resize_status'; + +SELECT @@innodb_buffer_pool_size INTO @innodb_buffer_pool_size_orig; +SELECT CEILING((256 + 64) * @@innodb_page_size / 1048576) * 1048576 INTO @min_pool_size; +--error ER_WRONG_VALUE_FOR_VAR +EXECUTE IMMEDIATE 'SET GLOBAL innodb_buffer_pool_size = ?' USING (@min_pool_size -1); + +SHOW WARNINGS; + +EXECUTE IMMEDIATE 'SET GLOBAL innodb_buffer_pool_size = ?' USING (@min_pool_size); + +--source include/wait_condition.inc + +SET GLOBAL innodb_buffer_pool_size = @innodb_buffer_pool_size_orig; diff --git a/mysql-test/suite/innodb/t/skip_symbolic_links.opt b/mysql-test/suite/innodb/t/skip_symbolic_links.opt new file mode 100644 index 00000000000..c7844699cdb --- /dev/null +++ b/mysql-test/suite/innodb/t/skip_symbolic_links.opt @@ -0,0 +1 @@ +--skip-symbolic-links diff --git a/mysql-test/suite/innodb/t/skip_symbolic_links.test b/mysql-test/suite/innodb/t/skip_symbolic_links.test new file mode 100644 index 00000000000..b5274d220c8 --- /dev/null +++ b/mysql-test/suite/innodb/t/skip_symbolic_links.test @@ -0,0 +1,51 @@ +--source include/have_innodb.inc +--source include/not_windows.inc + +SELECT @@have_symlink; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +eval CREATE TABLE t1(a INT) ENGINE=InnoDB DATA DIRECTORY '$MYSQL_TMP_DIR'; +DROP TABLE t1; +CREATE TABLE t1(a INT) ENGINE=InnoDB; + +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +eval ALTER TABLE t1 DATA DIRECTORY '$MYSQL_TMP_DIR'; +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--let $restart_parameters=--symbolic-links +--source include/restart_mysqld.inc + +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +eval CREATE TABLE t1(a INT PRIMARY KEY, b INT) ENGINE=InnoDB +DATA DIRECTORY '$MYSQL_TMP_DIR'; +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +eval CREATE TABLE t2(a INT PRIMARY KEY, b INT) ENGINE=InnoDB +DATA DIRECTORY '$MYSQL_TMP_DIR'; + +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; + +--let $restart_parameters= +--source include/restart_mysqld.inc + +# Native ALTER will retain DATA DIRECTORY +ALTER TABLE t1 FORCE, ALGORITHM=INPLACE; +ALTER TABLE t2 FORCE, ALGORITHM=COPY; +OPTIMIZE TABLE t1; +--list_files $MYSQL_TMP_DIR/test +DROP TABLE t2; + +RENAME TABLE t1 TO t2; +ALTER TABLE t2 ADD UNIQUE INDEX(b), RENAME TO t3; + +ALTER TABLE t3 RENAME TO t2; +ALTER TABLE t2 DROP INDEX b, RENAME TO t1; +ALTER TABLE t1 CHANGE b c INT; +ALTER TABLE t1 CHANGE c b INT NOT NULL; + +--list_files $MYSQL_TMP_DIR/test +# TRUNCATE TABLE will discard DATA DIRECTORY. +TRUNCATE TABLE t1; +--list_files $MYSQL_TMP_DIR/test +DROP TABLE t1; diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_plugin.result b/mysql-test/suite/innodb_fts/r/innodb_fts_plugin.result index 85271aebcf4..60be41d5839 100644 --- a/mysql-test/suite/innodb_fts/r/innodb_fts_plugin.result +++ b/mysql-test/suite/innodb_fts/r/innodb_fts_plugin.result @@ -162,6 +162,7 @@ id title body SELECT COUNT(*) FROM articles; COUNT(*) 5 +INSERT INTO articles (title, body) VALUES ('111', '1234 1234 1234'); DROP TABLE articles; # Test Part 5: Test Uninstall Plugin After Index is Built CREATE TABLE articles ( diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_plugin.test b/mysql-test/suite/innodb_fts/t/innodb_fts_plugin.test index 643e4a08b0e..aa52ef5051a 100644 --- a/mysql-test/suite/innodb_fts/t/innodb_fts_plugin.test +++ b/mysql-test/suite/innodb_fts/t/innodb_fts_plugin.test @@ -160,6 +160,8 @@ SELECT * FROM articles WHERE SELECT * FROM articles WHERE MATCH(title, body) AGAINST('full text search'); SELECT COUNT(*) FROM articles; + +INSERT INTO articles (title, body) VALUES ('111', '1234 1234 1234'); DROP TABLE articles; -- echo # Test Part 5: Test Uninstall Plugin After Index is Built diff --git a/mysql-test/suite/innodb_gis/r/rtree_split.result b/mysql-test/suite/innodb_gis/r/rtree_split.result index df88960ba3d..2d6e8a1dfbe 100644 --- a/mysql-test/suite/innodb_gis/r/rtree_split.result +++ b/mysql-test/suite/innodb_gis/r/rtree_split.result @@ -61,3 +61,10 @@ select count(*) from t1 where MBRWithin(t1.c2, @g1); count(*) 57344 drop table t1; +# +# MDEV-27417 Spatial index tries to update +# change buffer bookkeeping page +# +CREATE TEMPORARY TABLE t1 (c POINT NOT NULL, SPATIAL(c)) ENGINE=InnoDB; +INSERT INTO t1 SELECT PointFromText('POINT(0 0)') FROM seq_1_to_366; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb_gis/t/rtree_split.test b/mysql-test/suite/innodb_gis/t/rtree_split.test index 6f285187508..8697141ddea 100644 --- a/mysql-test/suite/innodb_gis/t/rtree_split.test +++ b/mysql-test/suite/innodb_gis/t/rtree_split.test @@ -73,3 +73,11 @@ select count(*) from t1 where MBRWithin(t1.c2, @g1); # Clean up. drop table t1; + +--echo # +--echo # MDEV-27417 Spatial index tries to update +--echo # change buffer bookkeeping page +--echo # +CREATE TEMPORARY TABLE t1 (c POINT NOT NULL, SPATIAL(c)) ENGINE=InnoDB; +INSERT INTO t1 SELECT PointFromText('POINT(0 0)') FROM seq_1_to_366; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb_i_s/innodb_buffer_page.result b/mysql-test/suite/innodb_i_s/innodb_buffer_page.result index fb2e9913e47..91140c3d9af 100644 --- a/mysql-test/suite/innodb_i_s/innodb_buffer_page.result +++ b/mysql-test/suite/innodb_i_s/innodb_buffer_page.result @@ -1,26 +1,26 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_BUFFER_PAGE; Table Create Table INNODB_BUFFER_PAGE CREATE TEMPORARY TABLE `INNODB_BUFFER_PAGE` ( - `POOL_ID` int(11) unsigned NOT NULL DEFAULT 0, - `BLOCK_ID` bigint(21) unsigned NOT NULL DEFAULT 0, - `SPACE` int(11) unsigned NOT NULL DEFAULT 0, - `PAGE_NUMBER` int(11) unsigned NOT NULL DEFAULT 0, - `PAGE_TYPE` varchar(64) DEFAULT NULL, - `FLUSH_TYPE` int(11) unsigned NOT NULL DEFAULT 0, - `FIX_COUNT` int(11) unsigned NOT NULL DEFAULT 0, - `IS_HASHED` int(1) NOT NULL DEFAULT 0, - `NEWEST_MODIFICATION` bigint(21) unsigned NOT NULL DEFAULT 0, - `OLDEST_MODIFICATION` bigint(21) unsigned NOT NULL DEFAULT 0, - `ACCESS_TIME` bigint(21) unsigned NOT NULL DEFAULT 0, - `TABLE_NAME` varchar(1024) DEFAULT NULL, - `INDEX_NAME` varchar(64) DEFAULT NULL, - `NUMBER_RECORDS` bigint(21) unsigned NOT NULL DEFAULT 0, - `DATA_SIZE` bigint(21) unsigned NOT NULL DEFAULT 0, - `COMPRESSED_SIZE` bigint(21) unsigned NOT NULL DEFAULT 0, + `POOL_ID` int(11) unsigned NOT NULL, + `BLOCK_ID` bigint(21) unsigned NOT NULL, + `SPACE` int(11) unsigned NOT NULL, + `PAGE_NUMBER` int(11) unsigned NOT NULL, + `PAGE_TYPE` varchar(64), + `FLUSH_TYPE` int(11) unsigned NOT NULL, + `FIX_COUNT` int(11) unsigned NOT NULL, + `IS_HASHED` int(1) NOT NULL, + `NEWEST_MODIFICATION` bigint(21) unsigned NOT NULL, + `OLDEST_MODIFICATION` bigint(21) unsigned NOT NULL, + `ACCESS_TIME` bigint(21) unsigned NOT NULL, + `TABLE_NAME` varchar(1024), + `INDEX_NAME` varchar(64), + `NUMBER_RECORDS` bigint(21) unsigned NOT NULL, + `DATA_SIZE` bigint(21) unsigned NOT NULL, + `COMPRESSED_SIZE` bigint(21) unsigned NOT NULL, `PAGE_STATE` enum('NOT_USED','MEMORY','REMOVE_HASH','FILE_PAGE') NOT NULL, `IO_FIX` enum('IO_NONE','IO_READ','IO_WRITE') NOT NULL, - `IS_OLD` int(1) NOT NULL DEFAULT 0, - `FREE_PAGE_CLOCK` bigint(21) unsigned NOT NULL DEFAULT 0 + `IS_OLD` int(1) NOT NULL, + `FREE_PAGE_CLOCK` bigint(21) unsigned NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 CREATE TEMPORARY TABLE t1 LIKE INFORMATION_SCHEMA.INNODB_BUFFER_PAGE; DROP TEMPORARY TABLE t1; diff --git a/mysql-test/suite/innodb_i_s/innodb_buffer_page_lru.result b/mysql-test/suite/innodb_i_s/innodb_buffer_page_lru.result index 7954c593164..6ba8503a062 100644 --- a/mysql-test/suite/innodb_i_s/innodb_buffer_page_lru.result +++ b/mysql-test/suite/innodb_i_s/innodb_buffer_page_lru.result @@ -1,26 +1,26 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_BUFFER_PAGE_LRU; Table Create Table INNODB_BUFFER_PAGE_LRU CREATE TEMPORARY TABLE `INNODB_BUFFER_PAGE_LRU` ( - `POOL_ID` int(11) unsigned NOT NULL DEFAULT 0, - `LRU_POSITION` bigint(21) unsigned NOT NULL DEFAULT 0, - `SPACE` int(11) unsigned NOT NULL DEFAULT 0, - `PAGE_NUMBER` int(11) unsigned NOT NULL DEFAULT 0, - `PAGE_TYPE` varchar(64) DEFAULT NULL, - `FLUSH_TYPE` int(11) unsigned NOT NULL DEFAULT 0, - `FIX_COUNT` int(11) unsigned NOT NULL DEFAULT 0, - `IS_HASHED` int(1) NOT NULL DEFAULT 0, - `NEWEST_MODIFICATION` bigint(21) unsigned NOT NULL DEFAULT 0, - `OLDEST_MODIFICATION` bigint(21) unsigned NOT NULL DEFAULT 0, - `ACCESS_TIME` bigint(21) unsigned NOT NULL DEFAULT 0, - `TABLE_NAME` varchar(1024) DEFAULT NULL, - `INDEX_NAME` varchar(64) DEFAULT NULL, - `NUMBER_RECORDS` bigint(21) unsigned NOT NULL DEFAULT 0, - `DATA_SIZE` bigint(21) unsigned NOT NULL DEFAULT 0, - `COMPRESSED_SIZE` bigint(21) unsigned NOT NULL DEFAULT 0, - `COMPRESSED` int(1) NOT NULL DEFAULT 0, + `POOL_ID` int(11) unsigned NOT NULL, + `LRU_POSITION` bigint(21) unsigned NOT NULL, + `SPACE` int(11) unsigned NOT NULL, + `PAGE_NUMBER` int(11) unsigned NOT NULL, + `PAGE_TYPE` varchar(64), + `FLUSH_TYPE` int(11) unsigned NOT NULL, + `FIX_COUNT` int(11) unsigned NOT NULL, + `IS_HASHED` int(1) NOT NULL, + `NEWEST_MODIFICATION` bigint(21) unsigned NOT NULL, + `OLDEST_MODIFICATION` bigint(21) unsigned NOT NULL, + `ACCESS_TIME` bigint(21) unsigned NOT NULL, + `TABLE_NAME` varchar(1024), + `INDEX_NAME` varchar(64), + `NUMBER_RECORDS` bigint(21) unsigned NOT NULL, + `DATA_SIZE` bigint(21) unsigned NOT NULL, + `COMPRESSED_SIZE` bigint(21) unsigned NOT NULL, + `COMPRESSED` int(1) NOT NULL, `IO_FIX` enum('IO_NONE','IO_READ','IO_WRITE') NOT NULL, - `IS_OLD` int(1) DEFAULT NULL, - `FREE_PAGE_CLOCK` bigint(21) unsigned NOT NULL DEFAULT 0 + `IS_OLD` int(1), + `FREE_PAGE_CLOCK` bigint(21) unsigned NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 CREATE TEMPORARY TABLE t1 LIKE INFORMATION_SCHEMA.INNODB_BUFFER_PAGE_LRU; DROP TEMPORARY TABLE t1; diff --git a/mysql-test/suite/innodb_i_s/innodb_buffer_pool_stats.result b/mysql-test/suite/innodb_i_s/innodb_buffer_pool_stats.result index 5e0c2ae8e89..9313aefd6f9 100644 --- a/mysql-test/suite/innodb_i_s/innodb_buffer_pool_stats.result +++ b/mysql-test/suite/innodb_i_s/innodb_buffer_pool_stats.result @@ -1,36 +1,36 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS; Table Create Table INNODB_BUFFER_POOL_STATS CREATE TEMPORARY TABLE `INNODB_BUFFER_POOL_STATS` ( - `POOL_ID` int(11) unsigned NOT NULL DEFAULT 0, - `POOL_SIZE` bigint(21) unsigned NOT NULL DEFAULT 0, - `FREE_BUFFERS` bigint(21) unsigned NOT NULL DEFAULT 0, - `DATABASE_PAGES` bigint(21) unsigned NOT NULL DEFAULT 0, - `OLD_DATABASE_PAGES` bigint(21) unsigned NOT NULL DEFAULT 0, - `MODIFIED_DATABASE_PAGES` bigint(21) unsigned NOT NULL DEFAULT 0, - `PENDING_DECOMPRESS` bigint(21) unsigned NOT NULL DEFAULT 0, - `PENDING_READS` bigint(21) unsigned NOT NULL DEFAULT 0, - `PENDING_FLUSH_LRU` bigint(21) unsigned NOT NULL DEFAULT 0, - `PENDING_FLUSH_LIST` bigint(21) unsigned NOT NULL DEFAULT 0, - `PAGES_MADE_YOUNG` bigint(21) unsigned NOT NULL DEFAULT 0, - `PAGES_NOT_MADE_YOUNG` bigint(21) unsigned NOT NULL DEFAULT 0, - `PAGES_MADE_YOUNG_RATE` float NOT NULL DEFAULT 0, - `PAGES_MADE_NOT_YOUNG_RATE` float NOT NULL DEFAULT 0, - `NUMBER_PAGES_READ` bigint(21) unsigned NOT NULL DEFAULT 0, - `NUMBER_PAGES_CREATED` bigint(21) unsigned NOT NULL DEFAULT 0, - `NUMBER_PAGES_WRITTEN` bigint(21) unsigned NOT NULL DEFAULT 0, - `PAGES_READ_RATE` float NOT NULL DEFAULT 0, - `PAGES_CREATE_RATE` float NOT NULL DEFAULT 0, - `PAGES_WRITTEN_RATE` float NOT NULL DEFAULT 0, - `NUMBER_PAGES_GET` bigint(21) unsigned NOT NULL DEFAULT 0, - `HIT_RATE` bigint(21) unsigned NOT NULL DEFAULT 0, - `YOUNG_MAKE_PER_THOUSAND_GETS` bigint(21) unsigned NOT NULL DEFAULT 0, - `NOT_YOUNG_MAKE_PER_THOUSAND_GETS` bigint(21) unsigned NOT NULL DEFAULT 0, - `NUMBER_PAGES_READ_AHEAD` bigint(21) unsigned NOT NULL DEFAULT 0, - `NUMBER_READ_AHEAD_EVICTED` bigint(21) unsigned NOT NULL DEFAULT 0, - `READ_AHEAD_RATE` float NOT NULL DEFAULT 0, - `READ_AHEAD_EVICTED_RATE` float NOT NULL DEFAULT 0, - `LRU_IO_TOTAL` bigint(21) unsigned NOT NULL DEFAULT 0, - `LRU_IO_CURRENT` bigint(21) unsigned NOT NULL DEFAULT 0, - `UNCOMPRESS_TOTAL` bigint(21) unsigned NOT NULL DEFAULT 0, - `UNCOMPRESS_CURRENT` bigint(21) unsigned NOT NULL DEFAULT 0 + `POOL_ID` int(11) unsigned NOT NULL, + `POOL_SIZE` bigint(21) unsigned NOT NULL, + `FREE_BUFFERS` bigint(21) unsigned NOT NULL, + `DATABASE_PAGES` bigint(21) unsigned NOT NULL, + `OLD_DATABASE_PAGES` bigint(21) unsigned NOT NULL, + `MODIFIED_DATABASE_PAGES` bigint(21) unsigned NOT NULL, + `PENDING_DECOMPRESS` bigint(21) unsigned NOT NULL, + `PENDING_READS` bigint(21) unsigned NOT NULL, + `PENDING_FLUSH_LRU` bigint(21) unsigned NOT NULL, + `PENDING_FLUSH_LIST` bigint(21) unsigned NOT NULL, + `PAGES_MADE_YOUNG` bigint(21) unsigned NOT NULL, + `PAGES_NOT_MADE_YOUNG` bigint(21) unsigned NOT NULL, + `PAGES_MADE_YOUNG_RATE` float NOT NULL, + `PAGES_MADE_NOT_YOUNG_RATE` float NOT NULL, + `NUMBER_PAGES_READ` bigint(21) unsigned NOT NULL, + `NUMBER_PAGES_CREATED` bigint(21) unsigned NOT NULL, + `NUMBER_PAGES_WRITTEN` bigint(21) unsigned NOT NULL, + `PAGES_READ_RATE` float NOT NULL, + `PAGES_CREATE_RATE` float NOT NULL, + `PAGES_WRITTEN_RATE` float NOT NULL, + `NUMBER_PAGES_GET` bigint(21) unsigned NOT NULL, + `HIT_RATE` bigint(21) unsigned NOT NULL, + `YOUNG_MAKE_PER_THOUSAND_GETS` bigint(21) unsigned NOT NULL, + `NOT_YOUNG_MAKE_PER_THOUSAND_GETS` bigint(21) unsigned NOT NULL, + `NUMBER_PAGES_READ_AHEAD` bigint(21) unsigned NOT NULL, + `NUMBER_READ_AHEAD_EVICTED` bigint(21) unsigned NOT NULL, + `READ_AHEAD_RATE` float NOT NULL, + `READ_AHEAD_EVICTED_RATE` float NOT NULL, + `LRU_IO_TOTAL` bigint(21) unsigned NOT NULL, + `LRU_IO_CURRENT` bigint(21) unsigned NOT NULL, + `UNCOMPRESS_TOTAL` bigint(21) unsigned NOT NULL, + `UNCOMPRESS_CURRENT` bigint(21) unsigned NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_cmp.result b/mysql-test/suite/innodb_i_s/innodb_cmp.result index d06bdf1dbc4..6b196a1b993 100644 --- a/mysql-test/suite/innodb_i_s/innodb_cmp.result +++ b/mysql-test/suite/innodb_i_s/innodb_cmp.result @@ -1,10 +1,10 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_CMP; Table Create Table INNODB_CMP CREATE TEMPORARY TABLE `INNODB_CMP` ( - `page_size` int(5) NOT NULL DEFAULT 0, - `compress_ops` int(11) NOT NULL DEFAULT 0, - `compress_ops_ok` int(11) NOT NULL DEFAULT 0, - `compress_time` int(11) NOT NULL DEFAULT 0, - `uncompress_ops` int(11) NOT NULL DEFAULT 0, - `uncompress_time` int(11) NOT NULL DEFAULT 0 + `page_size` int(5) NOT NULL, + `compress_ops` int(11) NOT NULL, + `compress_ops_ok` int(11) NOT NULL, + `compress_time` int(11) NOT NULL, + `uncompress_ops` int(11) NOT NULL, + `uncompress_time` int(11) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_cmp_per_index.result b/mysql-test/suite/innodb_i_s/innodb_cmp_per_index.result index 5037957681a..b72dc1a1269 100644 --- a/mysql-test/suite/innodb_i_s/innodb_cmp_per_index.result +++ b/mysql-test/suite/innodb_i_s/innodb_cmp_per_index.result @@ -1,12 +1,12 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_CMP_PER_INDEX; Table Create Table INNODB_CMP_PER_INDEX CREATE TEMPORARY TABLE `INNODB_CMP_PER_INDEX` ( - `database_name` varchar(64) NOT NULL DEFAULT '', - `table_name` varchar(64) NOT NULL DEFAULT '', - `index_name` varchar(64) NOT NULL DEFAULT '', - `compress_ops` int(11) NOT NULL DEFAULT 0, - `compress_ops_ok` int(11) NOT NULL DEFAULT 0, - `compress_time` int(11) NOT NULL DEFAULT 0, - `uncompress_ops` int(11) NOT NULL DEFAULT 0, - `uncompress_time` int(11) NOT NULL DEFAULT 0 + `database_name` varchar(64) NOT NULL, + `table_name` varchar(64) NOT NULL, + `index_name` varchar(64) NOT NULL, + `compress_ops` int(11) NOT NULL, + `compress_ops_ok` int(11) NOT NULL, + `compress_time` int(11) NOT NULL, + `uncompress_ops` int(11) NOT NULL, + `uncompress_time` int(11) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_cmp_per_index_reset.result b/mysql-test/suite/innodb_i_s/innodb_cmp_per_index_reset.result index d044cf077ac..941c05d53d8 100644 --- a/mysql-test/suite/innodb_i_s/innodb_cmp_per_index_reset.result +++ b/mysql-test/suite/innodb_i_s/innodb_cmp_per_index_reset.result @@ -1,12 +1,12 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_CMP_PER_INDEX_RESET; Table Create Table INNODB_CMP_PER_INDEX_RESET CREATE TEMPORARY TABLE `INNODB_CMP_PER_INDEX_RESET` ( - `database_name` varchar(64) NOT NULL DEFAULT '', - `table_name` varchar(64) NOT NULL DEFAULT '', - `index_name` varchar(64) NOT NULL DEFAULT '', - `compress_ops` int(11) NOT NULL DEFAULT 0, - `compress_ops_ok` int(11) NOT NULL DEFAULT 0, - `compress_time` int(11) NOT NULL DEFAULT 0, - `uncompress_ops` int(11) NOT NULL DEFAULT 0, - `uncompress_time` int(11) NOT NULL DEFAULT 0 + `database_name` varchar(64) NOT NULL, + `table_name` varchar(64) NOT NULL, + `index_name` varchar(64) NOT NULL, + `compress_ops` int(11) NOT NULL, + `compress_ops_ok` int(11) NOT NULL, + `compress_time` int(11) NOT NULL, + `uncompress_ops` int(11) NOT NULL, + `uncompress_time` int(11) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_cmp_reset.result b/mysql-test/suite/innodb_i_s/innodb_cmp_reset.result index 4a6ef866932..02d26a5ccf5 100644 --- a/mysql-test/suite/innodb_i_s/innodb_cmp_reset.result +++ b/mysql-test/suite/innodb_i_s/innodb_cmp_reset.result @@ -1,10 +1,10 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_CMP_RESET; Table Create Table INNODB_CMP_RESET CREATE TEMPORARY TABLE `INNODB_CMP_RESET` ( - `page_size` int(5) NOT NULL DEFAULT 0, - `compress_ops` int(11) NOT NULL DEFAULT 0, - `compress_ops_ok` int(11) NOT NULL DEFAULT 0, - `compress_time` int(11) NOT NULL DEFAULT 0, - `uncompress_ops` int(11) NOT NULL DEFAULT 0, - `uncompress_time` int(11) NOT NULL DEFAULT 0 + `page_size` int(5) NOT NULL, + `compress_ops` int(11) NOT NULL, + `compress_ops_ok` int(11) NOT NULL, + `compress_time` int(11) NOT NULL, + `uncompress_ops` int(11) NOT NULL, + `uncompress_time` int(11) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_cmpmem.result b/mysql-test/suite/innodb_i_s/innodb_cmpmem.result index 4f66f491b6b..3be5e64421a 100644 --- a/mysql-test/suite/innodb_i_s/innodb_cmpmem.result +++ b/mysql-test/suite/innodb_i_s/innodb_cmpmem.result @@ -1,10 +1,10 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_CMPMEM; Table Create Table INNODB_CMPMEM CREATE TEMPORARY TABLE `INNODB_CMPMEM` ( - `page_size` int(5) NOT NULL DEFAULT 0, - `buffer_pool_instance` int(11) NOT NULL DEFAULT 0, - `pages_used` int(11) NOT NULL DEFAULT 0, - `pages_free` int(11) NOT NULL DEFAULT 0, - `relocation_ops` bigint(21) NOT NULL DEFAULT 0, - `relocation_time` int(11) NOT NULL DEFAULT 0 + `page_size` int(5) NOT NULL, + `buffer_pool_instance` int(11) NOT NULL, + `pages_used` int(11) NOT NULL, + `pages_free` int(11) NOT NULL, + `relocation_ops` bigint(21) NOT NULL, + `relocation_time` int(11) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_cmpmem_reset.result b/mysql-test/suite/innodb_i_s/innodb_cmpmem_reset.result index 0f7adfc0fce..9d11c8221f2 100644 --- a/mysql-test/suite/innodb_i_s/innodb_cmpmem_reset.result +++ b/mysql-test/suite/innodb_i_s/innodb_cmpmem_reset.result @@ -1,10 +1,10 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_CMPMEM_RESET; Table Create Table INNODB_CMPMEM_RESET CREATE TEMPORARY TABLE `INNODB_CMPMEM_RESET` ( - `page_size` int(5) NOT NULL DEFAULT 0, - `buffer_pool_instance` int(11) NOT NULL DEFAULT 0, - `pages_used` int(11) NOT NULL DEFAULT 0, - `pages_free` int(11) NOT NULL DEFAULT 0, - `relocation_ops` bigint(21) NOT NULL DEFAULT 0, - `relocation_time` int(11) NOT NULL DEFAULT 0 + `page_size` int(5) NOT NULL, + `buffer_pool_instance` int(11) NOT NULL, + `pages_used` int(11) NOT NULL, + `pages_free` int(11) NOT NULL, + `relocation_ops` bigint(21) NOT NULL, + `relocation_time` int(11) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_ft_being_deleted.result b/mysql-test/suite/innodb_i_s/innodb_ft_being_deleted.result index 7c2c2a4d183..b458d6b93eb 100644 --- a/mysql-test/suite/innodb_i_s/innodb_ft_being_deleted.result +++ b/mysql-test/suite/innodb_i_s/innodb_ft_being_deleted.result @@ -1,5 +1,5 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED; Table Create Table INNODB_FT_BEING_DELETED CREATE TEMPORARY TABLE `INNODB_FT_BEING_DELETED` ( - `DOC_ID` bigint(21) unsigned NOT NULL DEFAULT 0 + `DOC_ID` bigint(21) unsigned NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_ft_config.result b/mysql-test/suite/innodb_i_s/innodb_ft_config.result index 5d2f7ec87d5..e9a31cad3ad 100644 --- a/mysql-test/suite/innodb_i_s/innodb_ft_config.result +++ b/mysql-test/suite/innodb_i_s/innodb_ft_config.result @@ -1,6 +1,6 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_FT_CONFIG; Table Create Table INNODB_FT_CONFIG CREATE TEMPORARY TABLE `INNODB_FT_CONFIG` ( - `KEY` varchar(193) NOT NULL DEFAULT '', - `VALUE` varchar(193) NOT NULL DEFAULT '' + `KEY` varchar(193) NOT NULL, + `VALUE` varchar(193) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_ft_default_stopword.result b/mysql-test/suite/innodb_i_s/innodb_ft_default_stopword.result index 6f4e0012c5f..996594bb23c 100644 --- a/mysql-test/suite/innodb_i_s/innodb_ft_default_stopword.result +++ b/mysql-test/suite/innodb_i_s/innodb_ft_default_stopword.result @@ -1,5 +1,5 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_FT_DEFAULT_STOPWORD; Table Create Table INNODB_FT_DEFAULT_STOPWORD CREATE TEMPORARY TABLE `INNODB_FT_DEFAULT_STOPWORD` ( - `value` varchar(18) NOT NULL DEFAULT '' + `value` varchar(18) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_ft_deleted.result b/mysql-test/suite/innodb_i_s/innodb_ft_deleted.result index 6224ce747af..0824efd9301 100644 --- a/mysql-test/suite/innodb_i_s/innodb_ft_deleted.result +++ b/mysql-test/suite/innodb_i_s/innodb_ft_deleted.result @@ -1,5 +1,5 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_FT_DELETED; Table Create Table INNODB_FT_DELETED CREATE TEMPORARY TABLE `INNODB_FT_DELETED` ( - `DOC_ID` bigint(21) unsigned NOT NULL DEFAULT 0 + `DOC_ID` bigint(21) unsigned NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_ft_index_cache.result b/mysql-test/suite/innodb_i_s/innodb_ft_index_cache.result index a17b9446c9f..d4726d2f15a 100644 --- a/mysql-test/suite/innodb_i_s/innodb_ft_index_cache.result +++ b/mysql-test/suite/innodb_i_s/innodb_ft_index_cache.result @@ -1,10 +1,10 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE; Table Create Table INNODB_FT_INDEX_CACHE CREATE TEMPORARY TABLE `INNODB_FT_INDEX_CACHE` ( - `WORD` varchar(337) NOT NULL DEFAULT '', - `FIRST_DOC_ID` bigint(21) unsigned NOT NULL DEFAULT 0, - `LAST_DOC_ID` bigint(21) unsigned NOT NULL DEFAULT 0, - `DOC_COUNT` bigint(21) unsigned NOT NULL DEFAULT 0, - `DOC_ID` bigint(21) unsigned NOT NULL DEFAULT 0, - `POSITION` bigint(21) unsigned NOT NULL DEFAULT 0 + `WORD` varchar(337) NOT NULL, + `FIRST_DOC_ID` bigint(21) unsigned NOT NULL, + `LAST_DOC_ID` bigint(21) unsigned NOT NULL, + `DOC_COUNT` bigint(21) unsigned NOT NULL, + `DOC_ID` bigint(21) unsigned NOT NULL, + `POSITION` bigint(21) unsigned NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_ft_index_table.result b/mysql-test/suite/innodb_i_s/innodb_ft_index_table.result index 8ec767ce5d1..c8f44963fb1 100644 --- a/mysql-test/suite/innodb_i_s/innodb_ft_index_table.result +++ b/mysql-test/suite/innodb_i_s/innodb_ft_index_table.result @@ -1,10 +1,10 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE; Table Create Table INNODB_FT_INDEX_TABLE CREATE TEMPORARY TABLE `INNODB_FT_INDEX_TABLE` ( - `WORD` varchar(337) NOT NULL DEFAULT '', - `FIRST_DOC_ID` bigint(21) unsigned NOT NULL DEFAULT 0, - `LAST_DOC_ID` bigint(21) unsigned NOT NULL DEFAULT 0, - `DOC_COUNT` bigint(21) unsigned NOT NULL DEFAULT 0, - `DOC_ID` bigint(21) unsigned NOT NULL DEFAULT 0, - `POSITION` bigint(21) unsigned NOT NULL DEFAULT 0 + `WORD` varchar(337) NOT NULL, + `FIRST_DOC_ID` bigint(21) unsigned NOT NULL, + `LAST_DOC_ID` bigint(21) unsigned NOT NULL, + `DOC_COUNT` bigint(21) unsigned NOT NULL, + `DOC_ID` bigint(21) unsigned NOT NULL, + `POSITION` bigint(21) unsigned NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_lock_waits.result b/mysql-test/suite/innodb_i_s/innodb_lock_waits.result index 8d8c2d158a7..656107349b9 100644 --- a/mysql-test/suite/innodb_i_s/innodb_lock_waits.result +++ b/mysql-test/suite/innodb_i_s/innodb_lock_waits.result @@ -1,8 +1,8 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_LOCK_WAITS; Table Create Table INNODB_LOCK_WAITS CREATE TEMPORARY TABLE `INNODB_LOCK_WAITS` ( - `requesting_trx_id` bigint(21) unsigned NOT NULL DEFAULT 0, - `requested_lock_id` varchar(81) NOT NULL DEFAULT '', - `blocking_trx_id` bigint(21) unsigned NOT NULL DEFAULT 0, - `blocking_lock_id` varchar(81) NOT NULL DEFAULT '' + `requesting_trx_id` bigint(21) unsigned NOT NULL, + `requested_lock_id` varchar(81) NOT NULL, + `blocking_trx_id` bigint(21) unsigned NOT NULL, + `blocking_lock_id` varchar(81) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_locks.result b/mysql-test/suite/innodb_i_s/innodb_locks.result index 977776ae2ec..389486411bb 100644 --- a/mysql-test/suite/innodb_i_s/innodb_locks.result +++ b/mysql-test/suite/innodb_i_s/innodb_locks.result @@ -1,16 +1,16 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_LOCKS; Table Create Table INNODB_LOCKS CREATE TEMPORARY TABLE `INNODB_LOCKS` ( - `lock_id` varchar(81) NOT NULL DEFAULT '', - `lock_trx_id` bigint(21) unsigned NOT NULL DEFAULT 0, + `lock_id` varchar(81) NOT NULL, + `lock_trx_id` bigint(21) unsigned NOT NULL, `lock_mode` enum('S','S,GAP','X','X,GAP','IS','IS,GAP','IX','IX,GAP','AUTO_INC') NOT NULL, `lock_type` enum('RECORD','TABLE') NOT NULL, - `lock_table` varchar(1024) NOT NULL DEFAULT '', - `lock_index` varchar(1024) DEFAULT NULL, - `lock_space` int(11) unsigned DEFAULT NULL, - `lock_page` int(11) unsigned DEFAULT NULL, - `lock_rec` int(11) unsigned DEFAULT NULL, - `lock_data` varchar(8192) DEFAULT NULL + `lock_table` varchar(1024) NOT NULL, + `lock_index` varchar(1024), + `lock_space` int(11) unsigned, + `lock_page` int(11) unsigned, + `lock_rec` int(11) unsigned, + `lock_data` varchar(8192) ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 CREATE TEMPORARY TABLE t1 LIKE INFORMATION_SCHEMA.INNODB_LOCKS; DROP TEMPORARY TABLE t1; diff --git a/mysql-test/suite/innodb_i_s/innodb_metrics.result b/mysql-test/suite/innodb_i_s/innodb_metrics.result index 7687fa8fc20..313c9cf80be 100644 --- a/mysql-test/suite/innodb_i_s/innodb_metrics.result +++ b/mysql-test/suite/innodb_i_s/innodb_metrics.result @@ -1,23 +1,23 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_METRICS; Table Create Table INNODB_METRICS CREATE TEMPORARY TABLE `INNODB_METRICS` ( - `NAME` varchar(193) NOT NULL DEFAULT '', - `SUBSYSTEM` varchar(193) NOT NULL DEFAULT '', - `COUNT` bigint(21) NOT NULL DEFAULT 0, - `MAX_COUNT` bigint(21) DEFAULT NULL, - `MIN_COUNT` bigint(21) DEFAULT NULL, - `AVG_COUNT` float DEFAULT NULL, - `COUNT_RESET` bigint(21) NOT NULL DEFAULT 0, - `MAX_COUNT_RESET` bigint(21) DEFAULT NULL, - `MIN_COUNT_RESET` bigint(21) DEFAULT NULL, - `AVG_COUNT_RESET` float DEFAULT NULL, - `TIME_ENABLED` datetime DEFAULT NULL, - `TIME_DISABLED` datetime DEFAULT NULL, - `TIME_ELAPSED` bigint(21) DEFAULT NULL, - `TIME_RESET` datetime DEFAULT NULL, - `ENABLED` int(1) NOT NULL DEFAULT 0, + `NAME` varchar(193) NOT NULL, + `SUBSYSTEM` varchar(193) NOT NULL, + `COUNT` bigint(21) NOT NULL, + `MAX_COUNT` bigint(21), + `MIN_COUNT` bigint(21), + `AVG_COUNT` float, + `COUNT_RESET` bigint(21) NOT NULL, + `MAX_COUNT_RESET` bigint(21), + `MIN_COUNT_RESET` bigint(21), + `AVG_COUNT_RESET` float, + `TIME_ENABLED` datetime, + `TIME_DISABLED` datetime, + `TIME_ELAPSED` bigint(21), + `TIME_RESET` datetime, + `ENABLED` int(1) NOT NULL, `TYPE` enum('value','status_counter','set_owner','set_member','counter') NOT NULL, - `COMMENT` varchar(193) NOT NULL DEFAULT '' + `COMMENT` varchar(193) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 CREATE TEMPORARY TABLE t1 LIKE INFORMATION_SCHEMA.INNODB_METRICS; DROP TEMPORARY TABLE t1; diff --git a/mysql-test/suite/innodb_i_s/innodb_sys_columns.result b/mysql-test/suite/innodb_i_s/innodb_sys_columns.result index a4f13d19854..c51f4bb7e0a 100644 --- a/mysql-test/suite/innodb_i_s/innodb_sys_columns.result +++ b/mysql-test/suite/innodb_i_s/innodb_sys_columns.result @@ -1,10 +1,10 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_SYS_COLUMNS; Table Create Table INNODB_SYS_COLUMNS CREATE TEMPORARY TABLE `INNODB_SYS_COLUMNS` ( - `TABLE_ID` bigint(21) unsigned NOT NULL DEFAULT 0, - `NAME` varchar(64) NOT NULL DEFAULT '', - `POS` bigint(21) unsigned NOT NULL DEFAULT 0, - `MTYPE` int(11) NOT NULL DEFAULT 0, - `PRTYPE` int(11) NOT NULL DEFAULT 0, - `LEN` int(11) NOT NULL DEFAULT 0 + `TABLE_ID` bigint(21) unsigned NOT NULL, + `NAME` varchar(64) NOT NULL, + `POS` bigint(21) unsigned NOT NULL, + `MTYPE` int(11) NOT NULL, + `PRTYPE` int(11) NOT NULL, + `LEN` int(11) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_sys_fields.result b/mysql-test/suite/innodb_i_s/innodb_sys_fields.result index d69645e139a..decc27c3aca 100644 --- a/mysql-test/suite/innodb_i_s/innodb_sys_fields.result +++ b/mysql-test/suite/innodb_i_s/innodb_sys_fields.result @@ -1,7 +1,7 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_SYS_FIELDS; Table Create Table INNODB_SYS_FIELDS CREATE TEMPORARY TABLE `INNODB_SYS_FIELDS` ( - `INDEX_ID` bigint(21) unsigned NOT NULL DEFAULT 0, - `NAME` varchar(64) NOT NULL DEFAULT '', - `POS` int(11) unsigned NOT NULL DEFAULT 0 + `INDEX_ID` bigint(21) unsigned NOT NULL, + `NAME` varchar(64) NOT NULL, + `POS` int(11) unsigned NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_sys_foreign.result b/mysql-test/suite/innodb_i_s/innodb_sys_foreign.result index 1995db45f5d..27629871dd5 100644 --- a/mysql-test/suite/innodb_i_s/innodb_sys_foreign.result +++ b/mysql-test/suite/innodb_i_s/innodb_sys_foreign.result @@ -1,9 +1,9 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_SYS_FOREIGN; Table Create Table INNODB_SYS_FOREIGN CREATE TEMPORARY TABLE `INNODB_SYS_FOREIGN` ( - `ID` varchar(193) NOT NULL DEFAULT '', - `FOR_NAME` varchar(193) NOT NULL DEFAULT '', - `REF_NAME` varchar(193) NOT NULL DEFAULT '', - `N_COLS` int(11) unsigned NOT NULL DEFAULT 0, - `TYPE` int(11) unsigned NOT NULL DEFAULT 0 + `ID` varchar(193) NOT NULL, + `FOR_NAME` varchar(193) NOT NULL, + `REF_NAME` varchar(193) NOT NULL, + `N_COLS` int(11) unsigned NOT NULL, + `TYPE` int(11) unsigned NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_sys_foreign_cols.result b/mysql-test/suite/innodb_i_s/innodb_sys_foreign_cols.result index 48d98a371c0..9a17d5f2b3a 100644 --- a/mysql-test/suite/innodb_i_s/innodb_sys_foreign_cols.result +++ b/mysql-test/suite/innodb_i_s/innodb_sys_foreign_cols.result @@ -1,8 +1,8 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS; Table Create Table INNODB_SYS_FOREIGN_COLS CREATE TEMPORARY TABLE `INNODB_SYS_FOREIGN_COLS` ( - `ID` varchar(193) NOT NULL DEFAULT '', - `FOR_COL_NAME` varchar(64) NOT NULL DEFAULT '', - `REF_COL_NAME` varchar(64) NOT NULL DEFAULT '', - `POS` int(11) unsigned NOT NULL DEFAULT 0 + `ID` varchar(193) NOT NULL, + `FOR_COL_NAME` varchar(64) NOT NULL, + `REF_COL_NAME` varchar(64) NOT NULL, + `POS` int(11) unsigned NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_sys_indexes.result b/mysql-test/suite/innodb_i_s/innodb_sys_indexes.result index 81d1447e60d..d74f557cbf6 100644 --- a/mysql-test/suite/innodb_i_s/innodb_sys_indexes.result +++ b/mysql-test/suite/innodb_i_s/innodb_sys_indexes.result @@ -1,12 +1,12 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_SYS_INDEXES; Table Create Table INNODB_SYS_INDEXES CREATE TEMPORARY TABLE `INNODB_SYS_INDEXES` ( - `INDEX_ID` bigint(21) unsigned NOT NULL DEFAULT 0, - `NAME` varchar(64) NOT NULL DEFAULT '', - `TABLE_ID` bigint(21) unsigned NOT NULL DEFAULT 0, - `TYPE` int(11) NOT NULL DEFAULT 0, - `N_FIELDS` int(11) NOT NULL DEFAULT 0, - `PAGE_NO` int(11) NOT NULL DEFAULT 0, - `SPACE` int(11) NOT NULL DEFAULT 0, - `MERGE_THRESHOLD` int(11) NOT NULL DEFAULT 0 + `INDEX_ID` bigint(21) unsigned NOT NULL, + `NAME` varchar(64) NOT NULL, + `TABLE_ID` bigint(21) unsigned NOT NULL, + `TYPE` int(11) NOT NULL, + `N_FIELDS` int(11) NOT NULL, + `PAGE_NO` int(11) NOT NULL, + `SPACE` int(11) NOT NULL, + `MERGE_THRESHOLD` int(11) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_sys_tables.result b/mysql-test/suite/innodb_i_s/innodb_sys_tables.result index 49afc1cc4c8..5ccee563c21 100644 --- a/mysql-test/suite/innodb_i_s/innodb_sys_tables.result +++ b/mysql-test/suite/innodb_i_s/innodb_sys_tables.result @@ -1,12 +1,12 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_SYS_TABLES; Table Create Table INNODB_SYS_TABLES CREATE TEMPORARY TABLE `INNODB_SYS_TABLES` ( - `TABLE_ID` bigint(21) unsigned NOT NULL DEFAULT 0, - `NAME` varchar(655) NOT NULL DEFAULT '', - `FLAG` int(11) NOT NULL DEFAULT 0, - `N_COLS` int(11) unsigned NOT NULL DEFAULT 0, - `SPACE` int(11) unsigned NOT NULL DEFAULT 0, - `ROW_FORMAT` enum('Redundant','Compact','Compressed','Dynamic') DEFAULT NULL, - `ZIP_PAGE_SIZE` int(11) unsigned NOT NULL DEFAULT 0, - `SPACE_TYPE` enum('Single','System') DEFAULT NULL + `TABLE_ID` bigint(21) unsigned NOT NULL, + `NAME` varchar(655) NOT NULL, + `FLAG` int(11) NOT NULL, + `N_COLS` int(11) unsigned NOT NULL, + `SPACE` int(11) unsigned NOT NULL, + `ROW_FORMAT` enum('Redundant','Compact','Compressed','Dynamic'), + `ZIP_PAGE_SIZE` int(11) unsigned NOT NULL, + `SPACE_TYPE` enum('Single','System') ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_sys_tablespaces.result b/mysql-test/suite/innodb_i_s/innodb_sys_tablespaces.result index 830ec87130f..b2e4350cdfa 100644 --- a/mysql-test/suite/innodb_i_s/innodb_sys_tablespaces.result +++ b/mysql-test/suite/innodb_i_s/innodb_sys_tablespaces.result @@ -1,13 +1,13 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES; Table Create Table INNODB_SYS_TABLESPACES CREATE TEMPORARY TABLE `INNODB_SYS_TABLESPACES` ( - `SPACE` int(11) unsigned NOT NULL DEFAULT 0, - `NAME` varchar(655) NOT NULL DEFAULT '', - `FLAG` int(11) unsigned NOT NULL DEFAULT 0, - `ROW_FORMAT` varchar(22) DEFAULT NULL, - `PAGE_SIZE` int(11) unsigned NOT NULL DEFAULT 0, - `FILENAME` varchar(512) NOT NULL DEFAULT '', - `FS_BLOCK_SIZE` int(11) unsigned NOT NULL DEFAULT 0, - `FILE_SIZE` bigint(21) unsigned NOT NULL DEFAULT 0, - `ALLOCATED_SIZE` bigint(21) unsigned NOT NULL DEFAULT 0 + `SPACE` int(11) unsigned NOT NULL, + `NAME` varchar(655) NOT NULL, + `FLAG` int(11) unsigned NOT NULL, + `ROW_FORMAT` varchar(22), + `PAGE_SIZE` int(11) unsigned NOT NULL, + `FILENAME` varchar(512) NOT NULL, + `FS_BLOCK_SIZE` int(11) unsigned NOT NULL, + `FILE_SIZE` bigint(21) unsigned NOT NULL, + `ALLOCATED_SIZE` bigint(21) unsigned NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_sys_tablestats.result b/mysql-test/suite/innodb_i_s/innodb_sys_tablestats.result index eefe5ee83a1..19e676d34a1 100644 --- a/mysql-test/suite/innodb_i_s/innodb_sys_tablestats.result +++ b/mysql-test/suite/innodb_i_s/innodb_sys_tablestats.result @@ -1,13 +1,13 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS; Table Create Table INNODB_SYS_TABLESTATS CREATE TEMPORARY TABLE `INNODB_SYS_TABLESTATS` ( - `TABLE_ID` bigint(21) unsigned NOT NULL DEFAULT 0, - `NAME` varchar(64) NOT NULL DEFAULT '', - `STATS_INITIALIZED` int(1) NOT NULL DEFAULT 0, - `NUM_ROWS` bigint(21) unsigned NOT NULL DEFAULT 0, - `CLUST_INDEX_SIZE` bigint(21) unsigned NOT NULL DEFAULT 0, - `OTHER_INDEX_SIZE` bigint(21) unsigned NOT NULL DEFAULT 0, - `MODIFIED_COUNTER` bigint(21) unsigned NOT NULL DEFAULT 0, - `AUTOINC` bigint(21) unsigned NOT NULL DEFAULT 0, - `REF_COUNT` int(11) NOT NULL DEFAULT 0 + `TABLE_ID` bigint(21) unsigned NOT NULL, + `NAME` varchar(64) NOT NULL, + `STATS_INITIALIZED` int(1) NOT NULL, + `NUM_ROWS` bigint(21) unsigned NOT NULL, + `CLUST_INDEX_SIZE` bigint(21) unsigned NOT NULL, + `OTHER_INDEX_SIZE` bigint(21) unsigned NOT NULL, + `MODIFIED_COUNTER` bigint(21) unsigned NOT NULL, + `AUTOINC` bigint(21) unsigned NOT NULL, + `REF_COUNT` int(11) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_sys_virtual.result b/mysql-test/suite/innodb_i_s/innodb_sys_virtual.result index 831f29faa95..bc622c9ee4b 100644 --- a/mysql-test/suite/innodb_i_s/innodb_sys_virtual.result +++ b/mysql-test/suite/innodb_i_s/innodb_sys_virtual.result @@ -1,7 +1,7 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_SYS_VIRTUAL; Table Create Table INNODB_SYS_VIRTUAL CREATE TEMPORARY TABLE `INNODB_SYS_VIRTUAL` ( - `TABLE_ID` bigint(21) unsigned NOT NULL DEFAULT 0, - `POS` int(11) unsigned NOT NULL DEFAULT 0, - `BASE_POS` int(11) unsigned NOT NULL DEFAULT 0 + `TABLE_ID` bigint(21) unsigned NOT NULL, + `POS` int(11) unsigned NOT NULL, + `BASE_POS` int(11) unsigned NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_tablespaces_encryption.result b/mysql-test/suite/innodb_i_s/innodb_tablespaces_encryption.result index 31a4805b275..481b5c0e6fa 100644 --- a/mysql-test/suite/innodb_i_s/innodb_tablespaces_encryption.result +++ b/mysql-test/suite/innodb_i_s/innodb_tablespaces_encryption.result @@ -1,14 +1,14 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION; Table Create Table INNODB_TABLESPACES_ENCRYPTION CREATE TEMPORARY TABLE `INNODB_TABLESPACES_ENCRYPTION` ( - `SPACE` int(11) unsigned NOT NULL DEFAULT 0, - `NAME` varchar(655) DEFAULT NULL, - `ENCRYPTION_SCHEME` int(11) unsigned NOT NULL DEFAULT 0, - `KEYSERVER_REQUESTS` int(11) unsigned NOT NULL DEFAULT 0, - `MIN_KEY_VERSION` int(11) unsigned NOT NULL DEFAULT 0, - `CURRENT_KEY_VERSION` int(11) unsigned NOT NULL DEFAULT 0, - `KEY_ROTATION_PAGE_NUMBER` bigint(21) unsigned DEFAULT NULL, - `KEY_ROTATION_MAX_PAGE_NUMBER` bigint(21) unsigned DEFAULT NULL, - `CURRENT_KEY_ID` int(11) unsigned NOT NULL DEFAULT 0, - `ROTATING_OR_FLUSHING` int(1) NOT NULL DEFAULT 0 + `SPACE` int(11) unsigned NOT NULL, + `NAME` varchar(655), + `ENCRYPTION_SCHEME` int(11) unsigned NOT NULL, + `KEYSERVER_REQUESTS` int(11) unsigned NOT NULL, + `MIN_KEY_VERSION` int(11) unsigned NOT NULL, + `CURRENT_KEY_VERSION` int(11) unsigned NOT NULL, + `KEY_ROTATION_PAGE_NUMBER` bigint(21) unsigned, + `KEY_ROTATION_MAX_PAGE_NUMBER` bigint(21) unsigned, + `CURRENT_KEY_ID` int(11) unsigned NOT NULL, + `ROTATING_OR_FLUSHING` int(1) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/mysql-test/suite/innodb_i_s/innodb_trx.result b/mysql-test/suite/innodb_i_s/innodb_trx.result index d4e10a99ee8..912ae49b760 100644 --- a/mysql-test/suite/innodb_i_s/innodb_trx.result +++ b/mysql-test/suite/innodb_i_s/innodb_trx.result @@ -1,28 +1,28 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_TRX; Table Create Table INNODB_TRX CREATE TEMPORARY TABLE `INNODB_TRX` ( - `trx_id` bigint(21) unsigned NOT NULL DEFAULT 0, - `trx_state` varchar(13) NOT NULL DEFAULT '', - `trx_started` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `trx_requested_lock_id` varchar(81) DEFAULT NULL, - `trx_wait_started` datetime DEFAULT NULL, - `trx_weight` bigint(21) unsigned NOT NULL DEFAULT 0, - `trx_mysql_thread_id` bigint(21) unsigned NOT NULL DEFAULT 0, - `trx_query` varchar(1024) DEFAULT NULL, - `trx_operation_state` varchar(64) DEFAULT NULL, - `trx_tables_in_use` bigint(21) unsigned NOT NULL DEFAULT 0, - `trx_tables_locked` bigint(21) unsigned NOT NULL DEFAULT 0, - `trx_lock_structs` bigint(21) unsigned NOT NULL DEFAULT 0, - `trx_lock_memory_bytes` bigint(21) unsigned NOT NULL DEFAULT 0, - `trx_rows_locked` bigint(21) unsigned NOT NULL DEFAULT 0, - `trx_rows_modified` bigint(21) unsigned NOT NULL DEFAULT 0, - `trx_concurrency_tickets` bigint(21) unsigned NOT NULL DEFAULT 0, + `trx_id` bigint(21) unsigned NOT NULL, + `trx_state` varchar(13) NOT NULL, + `trx_started` datetime NOT NULL, + `trx_requested_lock_id` varchar(81), + `trx_wait_started` datetime, + `trx_weight` bigint(21) unsigned NOT NULL, + `trx_mysql_thread_id` bigint(21) unsigned NOT NULL, + `trx_query` varchar(1024), + `trx_operation_state` varchar(64), + `trx_tables_in_use` bigint(21) unsigned NOT NULL, + `trx_tables_locked` bigint(21) unsigned NOT NULL, + `trx_lock_structs` bigint(21) unsigned NOT NULL, + `trx_lock_memory_bytes` bigint(21) unsigned NOT NULL, + `trx_rows_locked` bigint(21) unsigned NOT NULL, + `trx_rows_modified` bigint(21) unsigned NOT NULL, + `trx_concurrency_tickets` bigint(21) unsigned NOT NULL, `trx_isolation_level` enum('READ UNCOMMITTED','READ COMMITTED','REPEATABLE READ','SERIALIZABLE') NOT NULL, - `trx_unique_checks` int(1) NOT NULL DEFAULT 0, - `trx_foreign_key_checks` int(1) NOT NULL DEFAULT 0, - `trx_last_foreign_key_error` varchar(256) DEFAULT NULL, - `trx_is_read_only` int(1) NOT NULL DEFAULT 0, - `trx_autocommit_non_locking` int(1) NOT NULL DEFAULT 0 + `trx_unique_checks` int(1) NOT NULL, + `trx_foreign_key_checks` int(1) NOT NULL, + `trx_last_foreign_key_error` varchar(256), + `trx_is_read_only` int(1) NOT NULL, + `trx_autocommit_non_locking` int(1) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 CREATE TEMPORARY TABLE t1 LIKE INFORMATION_SCHEMA.INNODB_TRX; DROP TEMPORARY TABLE t1; diff --git a/mysql-test/suite/innodb_zip/r/wl5522_zip.result b/mysql-test/suite/innodb_zip/r/wl5522_zip.result index 4d6d23a3bff..83e0058a727 100644 --- a/mysql-test/suite/innodb_zip/r/wl5522_zip.result +++ b/mysql-test/suite/innodb_zip/r/wl5522_zip.result @@ -320,7 +320,7 @@ SELECT * FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files ALTER TABLE t1 IMPORT TABLESPACE; -ERROR HY000: Schema mismatch (Number of columns don't match, table has 6 columns but the tablespace meta-data file has 5 columns) +ERROR HY000: Schema mismatch (Column c3 not found in tablespace.) unlink: t1.ibd unlink: t1.cfg DROP TABLE t1; diff --git a/mysql-test/suite/innodb_zip/t/restart.test b/mysql-test/suite/innodb_zip/t/restart.test index baef95a66d3..c442b919d71 100644 --- a/mysql-test/suite/innodb_zip/t/restart.test +++ b/mysql-test/suite/innodb_zip/t/restart.test @@ -5,6 +5,7 @@ --source include/have_partition.inc --source include/not_embedded.inc --source include/innodb_checksum_algorithm.inc +--source include/have_symlink.inc SET default_storage_engine=InnoDB; LET $MYSQLD_DATADIR = `select @@datadir`; diff --git a/mysql-test/suite/json/r/json_table.result b/mysql-test/suite/json/r/json_table.result index 6f017c34133..75a7e884633 100644 --- a/mysql-test/suite/json/r/json_table.result +++ b/mysql-test/suite/json/r/json_table.result @@ -954,5 +954,32 @@ Warnings: Warning 1264 Out of range value for column 'converted' at row 2 Warning 1366 Incorrect integer value: 'foo' for column ``.`(temporary)`.`converted` at row 3 # +# MDEV-27696 Json table columns accept redundant COLLATE syntax +# +SELECT * FROM json_table('[{"name":"str"}]', '$[*]' + COLUMNS ( +name BLOB COLLATE `binary` PATH '$.name' + ) +) AS jt; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COLLATE `binary` PATH '$.name' + ) +) AS jt' at line 3 +SELECT * FROM json_table('[{"name":"str"}]', '$[*]' + COLUMNS ( +name VARCHAR(10) COLLATE latin1_bin COLLATE latin1_swedish_ci PATH '$.name' + ) +) AS jt; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COLLATE latin1_swedish_ci PATH '$.name' + ) +) AS jt' at line 3 +SELECT * FROM json_table('[{"name":"str"}]', '$[*]' + COLUMNS ( +name VARCHAR(10) BINARY COLLATE utf8_czech_ci path '$.name' + ) +) AS jt; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COLLATE utf8_czech_ci path '$.name' + ) +) AS jt' at line 3 +# # End of 10.6 tests # diff --git a/mysql-test/suite/json/r/rpl_json_char.result b/mysql-test/suite/json/r/rpl_json_char.result new file mode 100644 index 00000000000..91da1cdd617 --- /dev/null +++ b/mysql-test/suite/json/r/rpl_json_char.result @@ -0,0 +1,22 @@ +include/master-slave.inc +[connection master] +# +# Start of 10.5 tests +# +# +# MDEV-27018 IF and COALESCE lose "json" property +# +CREATE TABLE t1 (a CHAR(100) CHECK(JSON_VALID(a))); +connection slave; +connection master; +INSERT INTO t1 VALUES (JSON_OBJECT('a','b')); +connection slave; +SELECT * FROM t1 ORDER BY a; +a +{"a": "b"} +connection master; +DROP TABLE t1; +# +# End of 10.5 tests +# +include/rpl_end.inc diff --git a/mysql-test/suite/json/r/rpl_json_longtext.result b/mysql-test/suite/json/r/rpl_json_longtext.result new file mode 100644 index 00000000000..8d7f2a546aa --- /dev/null +++ b/mysql-test/suite/json/r/rpl_json_longtext.result @@ -0,0 +1,22 @@ +include/master-slave.inc +[connection master] +# +# Start of 10.5 tests +# +# +# MDEV-27018 IF and COALESCE lose "json" property +# +CREATE TABLE t1 (a LONGTEXT CHECK(JSON_VALID(a))); +connection slave; +connection master; +INSERT INTO t1 VALUES (JSON_OBJECT('a','b')); +connection slave; +SELECT * FROM t1 ORDER BY a; +a +{"a": "b"} +connection master; +DROP TABLE t1; +# +# End of 10.5 tests +# +include/rpl_end.inc diff --git a/mysql-test/suite/json/r/rpl_json_mediumtext.result b/mysql-test/suite/json/r/rpl_json_mediumtext.result new file mode 100644 index 00000000000..4cb1a87f473 --- /dev/null +++ b/mysql-test/suite/json/r/rpl_json_mediumtext.result @@ -0,0 +1,22 @@ +include/master-slave.inc +[connection master] +# +# Start of 10.5 tests +# +# +# MDEV-27018 IF and COALESCE lose "json" property +# +CREATE TABLE t1 (a MEDIUMTEXT CHECK(JSON_VALID(a))); +connection slave; +connection master; +INSERT INTO t1 VALUES (JSON_OBJECT('a','b')); +connection slave; +SELECT * FROM t1 ORDER BY a; +a +{"a": "b"} +connection master; +DROP TABLE t1; +# +# End of 10.5 tests +# +include/rpl_end.inc diff --git a/mysql-test/suite/json/r/rpl_json_text.result b/mysql-test/suite/json/r/rpl_json_text.result new file mode 100644 index 00000000000..4c0bac87471 --- /dev/null +++ b/mysql-test/suite/json/r/rpl_json_text.result @@ -0,0 +1,22 @@ +include/master-slave.inc +[connection master] +# +# Start of 10.5 tests +# +# +# MDEV-27018 IF and COALESCE lose "json" property +# +CREATE TABLE t1 (a TEXT CHECK(JSON_VALID(a))); +connection slave; +connection master; +INSERT INTO t1 VALUES (JSON_OBJECT('a','b')); +connection slave; +SELECT * FROM t1 ORDER BY a; +a +{"a": "b"} +connection master; +DROP TABLE t1; +# +# End of 10.5 tests +# +include/rpl_end.inc diff --git a/mysql-test/suite/json/r/rpl_json_tinytext.result b/mysql-test/suite/json/r/rpl_json_tinytext.result new file mode 100644 index 00000000000..92b228c3438 --- /dev/null +++ b/mysql-test/suite/json/r/rpl_json_tinytext.result @@ -0,0 +1,22 @@ +include/master-slave.inc +[connection master] +# +# Start of 10.5 tests +# +# +# MDEV-27018 IF and COALESCE lose "json" property +# +CREATE TABLE t1 (a TINYTEXT CHECK(JSON_VALID(a))); +connection slave; +connection master; +INSERT INTO t1 VALUES (JSON_OBJECT('a','b')); +connection slave; +SELECT * FROM t1 ORDER BY a; +a +{"a": "b"} +connection master; +DROP TABLE t1; +# +# End of 10.5 tests +# +include/rpl_end.inc diff --git a/mysql-test/suite/json/r/rpl_json_varchar.result b/mysql-test/suite/json/r/rpl_json_varchar.result new file mode 100644 index 00000000000..3adbe3ebb48 --- /dev/null +++ b/mysql-test/suite/json/r/rpl_json_varchar.result @@ -0,0 +1,22 @@ +include/master-slave.inc +[connection master] +# +# Start of 10.5 tests +# +# +# MDEV-27018 IF and COALESCE lose "json" property +# +CREATE TABLE t1 (a VARCHAR(100) CHECK(JSON_VALID(a))); +connection slave; +connection master; +INSERT INTO t1 VALUES (JSON_OBJECT('a','b')); +connection slave; +SELECT * FROM t1 ORDER BY a; +a +{"a": "b"} +connection master; +DROP TABLE t1; +# +# End of 10.5 tests +# +include/rpl_end.inc diff --git a/mysql-test/suite/json/r/type_json.result b/mysql-test/suite/json/r/type_json.result new file mode 100644 index 00000000000..b9b70f24190 --- /dev/null +++ b/mysql-test/suite/json/r/type_json.result @@ -0,0 +1,2884 @@ +# +# Start of 10.5 tests +# +# +# MDEV-27361 Hybrid functions with JSON arguments do not send format metadata +# +CREATE PROCEDURE p1(tbl TEXT, expr TEXT) +BEGIN +DECLARE t1cols INT DEFAULT (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS +WHERE TABLE_NAME=tbl AND TABLE_SCHEMA='test'); +FOR a IN 0..(t1cols-1) DO +FOR b IN 0..(t1cols-1) DO +BEGIN +DECLARE query TEXT DEFAULT CONCAT('SELECT ', expr, ' FROM ', tbl); +SET query= REPLACE(query, 'olt1', a); +SET query= REPLACE(query, 'olt2', b); +EXECUTE IMMEDIATE query; +END; +END FOR; +END FOR; +END; +$$ +CREATE PROCEDURE p2(expr TEXT) +BEGIN +DECLARE t1cols INT DEFAULT (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS +WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +DECLARE t2cols INT DEFAULT (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS +WHERE TABLE_NAME='t2' AND TABLE_SCHEMA='test'); +FOR a IN 0..(t1cols-1) DO +FOR b IN 0..(t2cols-1) DO +BEGIN +DECLARE query TEXT DEFAULT CONCAT('SELECT ', expr, ' FROM t1, t2'); +SET query= REPLACE(query, 'olt1', a); +SET query= REPLACE(query, 'olt2', b); +EXECUTE IMMEDIATE query; +END; +END FOR; +END FOR; +END; +$$ +CREATE TABLE t1 +( +c0 CHAR(30) DEFAULT '1' CHECK(JSON_VALID(c0)), +c1 VARCHAR(30) DEFAULT '1' CHECK(JSON_VALID(c1)), +c2 TINYTEXT DEFAULT '1' CHECK(JSON_VALID(c2)), +c3 TEXT DEFAULT '1' CHECK(JSON_VALID(c3)), +c4 MEDIUMTEXT DEFAULT '1' CHECK(JSON_VALID(c4)), +c5 LONGTEXT DEFAULT '1' CHECK(JSON_VALID(c5)), +# The below data types do not have any special JSON properties. +# Just checking CHECK(JSON_VALID()) does not give any unexpected surprises. +c6 INT DEFAULT '1' CHECK(JSON_VALID(c6)), +c7 ENUM('1') DEFAULT '1' CHECK(JSON_VALID(c7)) +); +INSERT INTO t1 VALUES (); +CREATE TABLE t1c +( +c0 CHAR(30) DEFAULT '1' CHECK(JSON_VALID(c0)), +c1 VARCHAR(30) COMPRESSED DEFAULT '1' CHECK(JSON_VALID(c1)), +c2 TINYTEXT COMPRESSED DEFAULT '1' CHECK(JSON_VALID(c2)), +c3 TEXT COMPRESSED DEFAULT '1' CHECK(JSON_VALID(c3)), +c4 MEDIUMTEXT COMPRESSED DEFAULT '1' CHECK(JSON_VALID(c4)), +c5 LONGTEXT COMPRESSED DEFAULT '1' CHECK(JSON_VALID(c5)), +# The below data types do not have any special JSON properties. +# Just checking CHECK(JSON_VALID()) does not give any unexpected surprises. +c6 INT DEFAULT '1' CHECK(JSON_VALID(c6)), +c7 ENUM('1') DEFAULT '1' CHECK(JSON_VALID(c7)) +); +INSERT INTO t1c VALUES (); +CREATE TABLE t2 +( +c0 CHAR(30) DEFAULT '1', +c1 VARCHAR(30) DEFAULT '1', +c2 TINYTEXT DEFAULT '1', +c3 TEXT DEFAULT '1', +c4 MEDIUMTEXT DEFAULT '1', +c5 LONGTEXT DEFAULT '1', +c6 INT DEFAULT 1, +c7 DOUBLE DEFAULT 1, +c8 DECIMAL(10,2) DEFAULT 1.23, +c9 TIME DEFAULT '10:20:30', +c10 DATE DEFAULT '2001-01-01', +c11 DATETIME DEFAULT '2001-01-01 10:20:30', +c12 ENUM('1','2') DEFAULT '1' +); +INSERT INTO t2 VALUES (); +CALL p1('t1', 'COALESCE(colt1, colt2)'); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c0, c0) 254 (format=json) 30 1 Y 0 39 8 +COALESCE(c0, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c0, c1) 253 (format=json) 30 1 Y 0 39 8 +COALESCE(c0, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c0, c2) 249 (format=json) 255 1 Y 0 39 8 +COALESCE(c0, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c0, c3) 252 (format=json) 65535 1 Y 0 39 8 +COALESCE(c0, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c0, c4) 250 (format=json) 16777215 1 Y 0 39 8 +COALESCE(c0, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c0, c5) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c0, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c0, c6) 254 30 1 Y 0 39 8 +COALESCE(c0, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c0, c7) 254 30 1 Y 0 39 8 +COALESCE(c0, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c1, c0) 253 (format=json) 30 1 Y 0 39 8 +COALESCE(c1, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c1, c1) 253 (format=json) 30 1 Y 0 39 8 +COALESCE(c1, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c1, c2) 249 (format=json) 255 1 Y 0 39 8 +COALESCE(c1, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c1, c3) 252 (format=json) 65535 1 Y 0 39 8 +COALESCE(c1, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c1, c4) 250 (format=json) 16777215 1 Y 0 39 8 +COALESCE(c1, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c1, c5) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c1, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c1, c6) 253 30 1 Y 0 39 8 +COALESCE(c1, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c1, c7) 253 30 1 Y 0 39 8 +COALESCE(c1, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c2, c0) 249 (format=json) 255 1 Y 0 39 8 +COALESCE(c2, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c2, c1) 249 (format=json) 255 1 Y 0 39 8 +COALESCE(c2, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c2, c2) 249 (format=json) 255 1 Y 0 39 8 +COALESCE(c2, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c2, c3) 252 (format=json) 65535 1 Y 0 39 8 +COALESCE(c2, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c2, c4) 250 (format=json) 16777215 1 Y 0 39 8 +COALESCE(c2, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c2, c5) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c2, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c2, c6) 249 255 1 Y 0 39 8 +COALESCE(c2, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c2, c7) 249 255 1 Y 0 39 8 +COALESCE(c2, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c3, c0) 252 (format=json) 65535 1 Y 0 39 8 +COALESCE(c3, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c3, c1) 252 (format=json) 65535 1 Y 0 39 8 +COALESCE(c3, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c3, c2) 252 (format=json) 65535 1 Y 0 39 8 +COALESCE(c3, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c3, c3) 252 (format=json) 65535 1 Y 0 39 8 +COALESCE(c3, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c3, c4) 250 (format=json) 16777215 1 Y 0 39 8 +COALESCE(c3, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c3, c5) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c3, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c3, c6) 252 65535 1 Y 0 39 8 +COALESCE(c3, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c3, c7) 252 65535 1 Y 0 39 8 +COALESCE(c3, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c4, c0) 250 (format=json) 16777215 1 Y 0 39 8 +COALESCE(c4, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c4, c1) 250 (format=json) 16777215 1 Y 0 39 8 +COALESCE(c4, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c4, c2) 250 (format=json) 16777215 1 Y 0 39 8 +COALESCE(c4, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c4, c3) 250 (format=json) 16777215 1 Y 0 39 8 +COALESCE(c4, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c4, c4) 250 (format=json) 16777215 1 Y 0 39 8 +COALESCE(c4, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c4, c5) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c4, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c4, c6) 250 16777215 1 Y 0 39 8 +COALESCE(c4, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c4, c7) 250 16777215 1 Y 0 39 8 +COALESCE(c4, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c5, c0) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c5, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c5, c1) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c5, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c5, c2) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c5, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c5, c3) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c5, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c5, c4) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c5, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c5, c5) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c5, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c5, c6) 251 4294967295 1 Y 0 39 8 +COALESCE(c5, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c5, c7) 251 4294967295 1 Y 0 39 8 +COALESCE(c5, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c6, c0) 254 30 1 Y 0 39 8 +COALESCE(c6, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c6, c1) 253 30 1 Y 0 39 8 +COALESCE(c6, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c6, c2) 249 255 1 Y 0 39 8 +COALESCE(c6, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c6, c3) 252 65535 1 Y 0 39 8 +COALESCE(c6, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c6, c4) 250 16777215 1 Y 0 39 8 +COALESCE(c6, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c6, c5) 251 4294967295 1 Y 0 39 8 +COALESCE(c6, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c6, c6) 3 11 1 Y 32896 0 63 +COALESCE(c6, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c6, c7) 254 11 1 Y 0 39 8 +COALESCE(c6, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c7, c0) 254 30 1 Y 0 39 8 +COALESCE(c7, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c7, c1) 253 30 1 Y 0 39 8 +COALESCE(c7, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c7, c2) 249 255 1 Y 0 39 8 +COALESCE(c7, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c7, c3) 252 65535 1 Y 0 39 8 +COALESCE(c7, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c7, c4) 250 16777215 1 Y 0 39 8 +COALESCE(c7, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c7, c5) 251 4294967295 1 Y 0 39 8 +COALESCE(c7, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c7, c6) 254 11 1 Y 0 39 8 +COALESCE(c7, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c7, c7) 254 1 1 Y 0 39 8 +COALESCE(c7, c7) +1 +CALL p1('t1', 'LEAST(colt1, colt2)'); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c0, c0) 254 30 1 Y 0 39 8 +LEAST(c0, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c0, c1) 253 30 1 Y 0 39 8 +LEAST(c0, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c0, c2) 249 255 1 Y 0 39 8 +LEAST(c0, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c0, c3) 252 65535 1 Y 0 39 8 +LEAST(c0, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c0, c4) 250 16777215 1 Y 0 39 8 +LEAST(c0, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c0, c5) 251 4294967295 1 Y 0 39 8 +LEAST(c0, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c0, c6) 5 23 1 Y 32896 31 63 +LEAST(c0, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c0, c7) 254 30 1 Y 0 39 8 +LEAST(c0, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c1, c0) 253 30 1 Y 0 39 8 +LEAST(c1, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c1, c1) 253 30 1 Y 0 39 8 +LEAST(c1, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c1, c2) 249 255 1 Y 0 39 8 +LEAST(c1, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c1, c3) 252 65535 1 Y 0 39 8 +LEAST(c1, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c1, c4) 250 16777215 1 Y 0 39 8 +LEAST(c1, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c1, c5) 251 4294967295 1 Y 0 39 8 +LEAST(c1, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c1, c6) 5 23 1 Y 32896 31 63 +LEAST(c1, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c1, c7) 253 30 1 Y 0 39 8 +LEAST(c1, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c2, c0) 249 255 1 Y 0 39 8 +LEAST(c2, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c2, c1) 249 255 1 Y 0 39 8 +LEAST(c2, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c2, c2) 249 255 1 Y 0 39 8 +LEAST(c2, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c2, c3) 252 65535 1 Y 0 39 8 +LEAST(c2, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c2, c4) 250 16777215 1 Y 0 39 8 +LEAST(c2, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c2, c5) 251 4294967295 1 Y 0 39 8 +LEAST(c2, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c2, c6) 5 23 1 Y 32896 31 63 +LEAST(c2, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c2, c7) 249 255 1 Y 0 39 8 +LEAST(c2, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c3, c0) 252 65535 1 Y 0 39 8 +LEAST(c3, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c3, c1) 252 65535 1 Y 0 39 8 +LEAST(c3, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c3, c2) 252 65535 1 Y 0 39 8 +LEAST(c3, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c3, c3) 252 65535 1 Y 0 39 8 +LEAST(c3, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c3, c4) 250 16777215 1 Y 0 39 8 +LEAST(c3, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c3, c5) 251 4294967295 1 Y 0 39 8 +LEAST(c3, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c3, c6) 5 23 1 Y 32896 31 63 +LEAST(c3, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c3, c7) 252 65535 1 Y 0 39 8 +LEAST(c3, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c4, c0) 250 16777215 1 Y 0 39 8 +LEAST(c4, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c4, c1) 250 16777215 1 Y 0 39 8 +LEAST(c4, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c4, c2) 250 16777215 1 Y 0 39 8 +LEAST(c4, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c4, c3) 250 16777215 1 Y 0 39 8 +LEAST(c4, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c4, c4) 250 16777215 1 Y 0 39 8 +LEAST(c4, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c4, c5) 251 4294967295 1 Y 0 39 8 +LEAST(c4, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c4, c6) 5 23 1 Y 32896 31 63 +LEAST(c4, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c4, c7) 250 16777215 1 Y 0 39 8 +LEAST(c4, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c5, c0) 251 4294967295 1 Y 0 39 8 +LEAST(c5, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c5, c1) 251 4294967295 1 Y 0 39 8 +LEAST(c5, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c5, c2) 251 4294967295 1 Y 0 39 8 +LEAST(c5, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c5, c3) 251 4294967295 1 Y 0 39 8 +LEAST(c5, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c5, c4) 251 4294967295 1 Y 0 39 8 +LEAST(c5, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c5, c5) 251 4294967295 1 Y 0 39 8 +LEAST(c5, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c5, c6) 5 23 1 Y 32896 31 63 +LEAST(c5, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c5, c7) 251 4294967295 1 Y 0 39 8 +LEAST(c5, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c6, c0) 5 23 1 Y 32896 31 63 +LEAST(c6, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c6, c1) 5 23 1 Y 32896 31 63 +LEAST(c6, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c6, c2) 5 23 1 Y 32896 31 63 +LEAST(c6, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c6, c3) 5 23 1 Y 32896 31 63 +LEAST(c6, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c6, c4) 5 23 1 Y 32896 31 63 +LEAST(c6, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c6, c5) 5 23 1 Y 32896 31 63 +LEAST(c6, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c6, c6) 3 11 1 Y 32896 0 63 +LEAST(c6, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c6, c7) 5 17 1 Y 32896 0 63 +LEAST(c6, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c7, c0) 254 30 1 Y 0 39 8 +LEAST(c7, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c7, c1) 253 30 1 Y 0 39 8 +LEAST(c7, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c7, c2) 249 255 1 Y 0 39 8 +LEAST(c7, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c7, c3) 252 65535 1 Y 0 39 8 +LEAST(c7, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c7, c4) 250 16777215 1 Y 0 39 8 +LEAST(c7, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c7, c5) 251 4294967295 1 Y 0 39 8 +LEAST(c7, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c7, c6) 5 17 1 Y 32896 0 63 +LEAST(c7, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c7, c7) 254 1 1 Y 0 39 8 +LEAST(c7, c7) +1 +CALL p1('t1', 'colt1+colt2'); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c0+c0 5 23 1 Y 32896 31 63 +c0+c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c0+c1 5 23 1 Y 32896 31 63 +c0+c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c0+c2 5 23 1 Y 32896 31 63 +c0+c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c0+c3 5 23 1 Y 32896 31 63 +c0+c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c0+c4 5 23 1 Y 32896 31 63 +c0+c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c0+c5 5 23 1 Y 32896 31 63 +c0+c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c0+c6 5 23 1 Y 32896 31 63 +c0+c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c0+c7 5 23 1 Y 32896 31 63 +c0+c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c1+c0 5 23 1 Y 32896 31 63 +c1+c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c1+c1 5 23 1 Y 32896 31 63 +c1+c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c1+c2 5 23 1 Y 32896 31 63 +c1+c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c1+c3 5 23 1 Y 32896 31 63 +c1+c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c1+c4 5 23 1 Y 32896 31 63 +c1+c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c1+c5 5 23 1 Y 32896 31 63 +c1+c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c1+c6 5 23 1 Y 32896 31 63 +c1+c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c1+c7 5 23 1 Y 32896 31 63 +c1+c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c2+c0 5 23 1 Y 32896 31 63 +c2+c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c2+c1 5 23 1 Y 32896 31 63 +c2+c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c2+c2 5 23 1 Y 32896 31 63 +c2+c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c2+c3 5 23 1 Y 32896 31 63 +c2+c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c2+c4 5 23 1 Y 32896 31 63 +c2+c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c2+c5 5 23 1 Y 32896 31 63 +c2+c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c2+c6 5 23 1 Y 32896 31 63 +c2+c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c2+c7 5 23 1 Y 32896 31 63 +c2+c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c3+c0 5 23 1 Y 32896 31 63 +c3+c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c3+c1 5 23 1 Y 32896 31 63 +c3+c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c3+c2 5 23 1 Y 32896 31 63 +c3+c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c3+c3 5 23 1 Y 32896 31 63 +c3+c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c3+c4 5 23 1 Y 32896 31 63 +c3+c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c3+c5 5 23 1 Y 32896 31 63 +c3+c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c3+c6 5 23 1 Y 32896 31 63 +c3+c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c3+c7 5 23 1 Y 32896 31 63 +c3+c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c4+c0 5 23 1 Y 32896 31 63 +c4+c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c4+c1 5 23 1 Y 32896 31 63 +c4+c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c4+c2 5 23 1 Y 32896 31 63 +c4+c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c4+c3 5 23 1 Y 32896 31 63 +c4+c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c4+c4 5 23 1 Y 32896 31 63 +c4+c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c4+c5 5 23 1 Y 32896 31 63 +c4+c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c4+c6 5 23 1 Y 32896 31 63 +c4+c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c4+c7 5 23 1 Y 32896 31 63 +c4+c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c5+c0 5 23 1 Y 32896 31 63 +c5+c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c5+c1 5 23 1 Y 32896 31 63 +c5+c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c5+c2 5 23 1 Y 32896 31 63 +c5+c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c5+c3 5 23 1 Y 32896 31 63 +c5+c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c5+c4 5 23 1 Y 32896 31 63 +c5+c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c5+c5 5 23 1 Y 32896 31 63 +c5+c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c5+c6 5 23 1 Y 32896 31 63 +c5+c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c5+c7 5 23 1 Y 32896 31 63 +c5+c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c6+c0 5 23 1 Y 32896 31 63 +c6+c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c6+c1 5 23 1 Y 32896 31 63 +c6+c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c6+c2 5 23 1 Y 32896 31 63 +c6+c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c6+c3 5 23 1 Y 32896 31 63 +c6+c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c6+c4 5 23 1 Y 32896 31 63 +c6+c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c6+c5 5 23 1 Y 32896 31 63 +c6+c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c6+c6 8 12 1 Y 32896 0 63 +c6+c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c6+c7 8 12 1 Y 32896 0 63 +c6+c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c7+c0 5 23 1 Y 32896 31 63 +c7+c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c7+c1 5 23 1 Y 32896 31 63 +c7+c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c7+c2 5 23 1 Y 32896 31 63 +c7+c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c7+c3 5 23 1 Y 32896 31 63 +c7+c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c7+c4 5 23 1 Y 32896 31 63 +c7+c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c7+c5 5 23 1 Y 32896 31 63 +c7+c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c7+c6 8 12 1 Y 32896 0 63 +c7+c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c7+c7 3 3 1 Y 32896 0 63 +c7+c7 +2 +CALL p1('t1c', 'COALESCE(colt1, colt2)'); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c0, c0) 254 (format=json) 30 1 Y 0 39 8 +COALESCE(c0, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c0, c1) 253 (format=json) 31 1 Y 0 39 8 +COALESCE(c0, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c0, c2) 249 (format=json) 255 1 Y 0 39 8 +COALESCE(c0, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c0, c3) 252 (format=json) 65535 1 Y 0 39 8 +COALESCE(c0, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c0, c4) 250 (format=json) 16777215 1 Y 0 39 8 +COALESCE(c0, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c0, c5) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c0, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c0, c6) 254 30 1 Y 0 39 8 +COALESCE(c0, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c0, c7) 254 30 1 Y 0 39 8 +COALESCE(c0, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c1, c0) 253 (format=json) 31 1 Y 0 39 8 +COALESCE(c1, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c1, c1) 253 (format=json) 31 1 Y 0 39 8 +COALESCE(c1, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c1, c2) 249 (format=json) 255 1 Y 0 39 8 +COALESCE(c1, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c1, c3) 252 (format=json) 65535 1 Y 0 39 8 +COALESCE(c1, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c1, c4) 250 (format=json) 16777215 1 Y 0 39 8 +COALESCE(c1, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c1, c5) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c1, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c1, c6) 253 31 1 Y 0 39 8 +COALESCE(c1, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c1, c7) 253 31 1 Y 0 39 8 +COALESCE(c1, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c2, c0) 249 (format=json) 255 1 Y 0 39 8 +COALESCE(c2, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c2, c1) 249 (format=json) 255 1 Y 0 39 8 +COALESCE(c2, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c2, c2) 249 (format=json) 255 1 Y 0 39 8 +COALESCE(c2, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c2, c3) 252 (format=json) 65535 1 Y 0 39 8 +COALESCE(c2, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c2, c4) 250 (format=json) 16777215 1 Y 0 39 8 +COALESCE(c2, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c2, c5) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c2, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c2, c6) 249 255 1 Y 0 39 8 +COALESCE(c2, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c2, c7) 249 255 1 Y 0 39 8 +COALESCE(c2, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c3, c0) 252 (format=json) 65535 1 Y 0 39 8 +COALESCE(c3, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c3, c1) 252 (format=json) 65535 1 Y 0 39 8 +COALESCE(c3, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c3, c2) 252 (format=json) 65535 1 Y 0 39 8 +COALESCE(c3, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c3, c3) 252 (format=json) 65535 1 Y 0 39 8 +COALESCE(c3, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c3, c4) 250 (format=json) 16777215 1 Y 0 39 8 +COALESCE(c3, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c3, c5) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c3, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c3, c6) 252 65535 1 Y 0 39 8 +COALESCE(c3, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c3, c7) 252 65535 1 Y 0 39 8 +COALESCE(c3, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c4, c0) 250 (format=json) 16777215 1 Y 0 39 8 +COALESCE(c4, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c4, c1) 250 (format=json) 16777215 1 Y 0 39 8 +COALESCE(c4, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c4, c2) 250 (format=json) 16777215 1 Y 0 39 8 +COALESCE(c4, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c4, c3) 250 (format=json) 16777215 1 Y 0 39 8 +COALESCE(c4, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c4, c4) 250 (format=json) 16777215 1 Y 0 39 8 +COALESCE(c4, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c4, c5) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c4, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c4, c6) 250 16777215 1 Y 0 39 8 +COALESCE(c4, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c4, c7) 250 16777215 1 Y 0 39 8 +COALESCE(c4, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c5, c0) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c5, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c5, c1) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c5, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c5, c2) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c5, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c5, c3) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c5, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c5, c4) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c5, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c5, c5) 251 (format=json) 4294967295 1 Y 0 39 8 +COALESCE(c5, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c5, c6) 251 4294967295 1 Y 0 39 8 +COALESCE(c5, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c5, c7) 251 4294967295 1 Y 0 39 8 +COALESCE(c5, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c6, c0) 254 30 1 Y 0 39 8 +COALESCE(c6, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c6, c1) 253 31 1 Y 0 39 8 +COALESCE(c6, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c6, c2) 249 255 1 Y 0 39 8 +COALESCE(c6, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c6, c3) 252 65535 1 Y 0 39 8 +COALESCE(c6, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c6, c4) 250 16777215 1 Y 0 39 8 +COALESCE(c6, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c6, c5) 251 4294967295 1 Y 0 39 8 +COALESCE(c6, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c6, c6) 3 11 1 Y 32896 0 63 +COALESCE(c6, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c6, c7) 254 11 1 Y 0 39 8 +COALESCE(c6, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c7, c0) 254 30 1 Y 0 39 8 +COALESCE(c7, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c7, c1) 253 31 1 Y 0 39 8 +COALESCE(c7, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c7, c2) 249 255 1 Y 0 39 8 +COALESCE(c7, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c7, c3) 252 65535 1 Y 0 39 8 +COALESCE(c7, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c7, c4) 250 16777215 1 Y 0 39 8 +COALESCE(c7, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c7, c5) 251 4294967295 1 Y 0 39 8 +COALESCE(c7, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c7, c6) 254 11 1 Y 0 39 8 +COALESCE(c7, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(c7, c7) 254 1 1 Y 0 39 8 +COALESCE(c7, c7) +1 +CALL p1('t1c', 'LEAST(colt1, colt2)'); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c0, c0) 254 30 1 Y 0 39 8 +LEAST(c0, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c0, c1) 253 31 1 Y 0 39 8 +LEAST(c0, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c0, c2) 249 255 1 Y 0 39 8 +LEAST(c0, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c0, c3) 252 65535 1 Y 0 39 8 +LEAST(c0, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c0, c4) 250 16777215 1 Y 0 39 8 +LEAST(c0, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c0, c5) 251 4294967295 1 Y 0 39 8 +LEAST(c0, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c0, c6) 5 23 1 Y 32896 31 63 +LEAST(c0, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c0, c7) 254 30 1 Y 0 39 8 +LEAST(c0, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c1, c0) 253 31 1 Y 0 39 8 +LEAST(c1, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c1, c1) 253 31 1 Y 0 39 8 +LEAST(c1, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c1, c2) 249 255 1 Y 0 39 8 +LEAST(c1, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c1, c3) 252 65535 1 Y 0 39 8 +LEAST(c1, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c1, c4) 250 16777215 1 Y 0 39 8 +LEAST(c1, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c1, c5) 251 4294967295 1 Y 0 39 8 +LEAST(c1, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c1, c6) 5 23 1 Y 32896 31 63 +LEAST(c1, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c1, c7) 253 31 1 Y 0 39 8 +LEAST(c1, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c2, c0) 249 255 1 Y 0 39 8 +LEAST(c2, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c2, c1) 249 255 1 Y 0 39 8 +LEAST(c2, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c2, c2) 249 255 1 Y 0 39 8 +LEAST(c2, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c2, c3) 252 65535 1 Y 0 39 8 +LEAST(c2, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c2, c4) 250 16777215 1 Y 0 39 8 +LEAST(c2, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c2, c5) 251 4294967295 1 Y 0 39 8 +LEAST(c2, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c2, c6) 5 23 1 Y 32896 31 63 +LEAST(c2, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c2, c7) 249 255 1 Y 0 39 8 +LEAST(c2, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c3, c0) 252 65535 1 Y 0 39 8 +LEAST(c3, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c3, c1) 252 65535 1 Y 0 39 8 +LEAST(c3, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c3, c2) 252 65535 1 Y 0 39 8 +LEAST(c3, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c3, c3) 252 65535 1 Y 0 39 8 +LEAST(c3, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c3, c4) 250 16777215 1 Y 0 39 8 +LEAST(c3, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c3, c5) 251 4294967295 1 Y 0 39 8 +LEAST(c3, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c3, c6) 5 23 1 Y 32896 31 63 +LEAST(c3, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c3, c7) 252 65535 1 Y 0 39 8 +LEAST(c3, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c4, c0) 250 16777215 1 Y 0 39 8 +LEAST(c4, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c4, c1) 250 16777215 1 Y 0 39 8 +LEAST(c4, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c4, c2) 250 16777215 1 Y 0 39 8 +LEAST(c4, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c4, c3) 250 16777215 1 Y 0 39 8 +LEAST(c4, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c4, c4) 250 16777215 1 Y 0 39 8 +LEAST(c4, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c4, c5) 251 4294967295 1 Y 0 39 8 +LEAST(c4, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c4, c6) 5 23 1 Y 32896 31 63 +LEAST(c4, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c4, c7) 250 16777215 1 Y 0 39 8 +LEAST(c4, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c5, c0) 251 4294967295 1 Y 0 39 8 +LEAST(c5, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c5, c1) 251 4294967295 1 Y 0 39 8 +LEAST(c5, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c5, c2) 251 4294967295 1 Y 0 39 8 +LEAST(c5, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c5, c3) 251 4294967295 1 Y 0 39 8 +LEAST(c5, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c5, c4) 251 4294967295 1 Y 0 39 8 +LEAST(c5, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c5, c5) 251 4294967295 1 Y 0 39 8 +LEAST(c5, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c5, c6) 5 23 1 Y 32896 31 63 +LEAST(c5, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c5, c7) 251 4294967295 1 Y 0 39 8 +LEAST(c5, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c6, c0) 5 23 1 Y 32896 31 63 +LEAST(c6, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c6, c1) 5 23 1 Y 32896 31 63 +LEAST(c6, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c6, c2) 5 23 1 Y 32896 31 63 +LEAST(c6, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c6, c3) 5 23 1 Y 32896 31 63 +LEAST(c6, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c6, c4) 5 23 1 Y 32896 31 63 +LEAST(c6, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c6, c5) 5 23 1 Y 32896 31 63 +LEAST(c6, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c6, c6) 3 11 1 Y 32896 0 63 +LEAST(c6, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c6, c7) 5 17 1 Y 32896 0 63 +LEAST(c6, c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c7, c0) 254 30 1 Y 0 39 8 +LEAST(c7, c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c7, c1) 253 31 1 Y 0 39 8 +LEAST(c7, c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c7, c2) 249 255 1 Y 0 39 8 +LEAST(c7, c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c7, c3) 252 65535 1 Y 0 39 8 +LEAST(c7, c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c7, c4) 250 16777215 1 Y 0 39 8 +LEAST(c7, c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c7, c5) 251 4294967295 1 Y 0 39 8 +LEAST(c7, c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c7, c6) 5 17 1 Y 32896 0 63 +LEAST(c7, c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(c7, c7) 254 1 1 Y 0 39 8 +LEAST(c7, c7) +1 +CALL p1('t1c', 'colt1+colt2'); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c0+c0 5 23 1 Y 32896 31 63 +c0+c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c0+c1 5 23 1 Y 32896 31 63 +c0+c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c0+c2 5 23 1 Y 32896 31 63 +c0+c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c0+c3 5 23 1 Y 32896 31 63 +c0+c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c0+c4 5 23 1 Y 32896 31 63 +c0+c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c0+c5 5 23 1 Y 32896 31 63 +c0+c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c0+c6 5 23 1 Y 32896 31 63 +c0+c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c0+c7 5 23 1 Y 32896 31 63 +c0+c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c1+c0 5 23 1 Y 32896 31 63 +c1+c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c1+c1 5 23 1 Y 32896 31 63 +c1+c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c1+c2 5 23 1 Y 32896 31 63 +c1+c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c1+c3 5 23 1 Y 32896 31 63 +c1+c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c1+c4 5 23 1 Y 32896 31 63 +c1+c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c1+c5 5 23 1 Y 32896 31 63 +c1+c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c1+c6 5 23 1 Y 32896 31 63 +c1+c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c1+c7 5 23 1 Y 32896 31 63 +c1+c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c2+c0 5 23 1 Y 32896 31 63 +c2+c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c2+c1 5 23 1 Y 32896 31 63 +c2+c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c2+c2 5 23 1 Y 32896 31 63 +c2+c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c2+c3 5 23 1 Y 32896 31 63 +c2+c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c2+c4 5 23 1 Y 32896 31 63 +c2+c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c2+c5 5 23 1 Y 32896 31 63 +c2+c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c2+c6 5 23 1 Y 32896 31 63 +c2+c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c2+c7 5 23 1 Y 32896 31 63 +c2+c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c3+c0 5 23 1 Y 32896 31 63 +c3+c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c3+c1 5 23 1 Y 32896 31 63 +c3+c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c3+c2 5 23 1 Y 32896 31 63 +c3+c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c3+c3 5 23 1 Y 32896 31 63 +c3+c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c3+c4 5 23 1 Y 32896 31 63 +c3+c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c3+c5 5 23 1 Y 32896 31 63 +c3+c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c3+c6 5 23 1 Y 32896 31 63 +c3+c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c3+c7 5 23 1 Y 32896 31 63 +c3+c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c4+c0 5 23 1 Y 32896 31 63 +c4+c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c4+c1 5 23 1 Y 32896 31 63 +c4+c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c4+c2 5 23 1 Y 32896 31 63 +c4+c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c4+c3 5 23 1 Y 32896 31 63 +c4+c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c4+c4 5 23 1 Y 32896 31 63 +c4+c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c4+c5 5 23 1 Y 32896 31 63 +c4+c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c4+c6 5 23 1 Y 32896 31 63 +c4+c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c4+c7 5 23 1 Y 32896 31 63 +c4+c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c5+c0 5 23 1 Y 32896 31 63 +c5+c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c5+c1 5 23 1 Y 32896 31 63 +c5+c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c5+c2 5 23 1 Y 32896 31 63 +c5+c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c5+c3 5 23 1 Y 32896 31 63 +c5+c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c5+c4 5 23 1 Y 32896 31 63 +c5+c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c5+c5 5 23 1 Y 32896 31 63 +c5+c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c5+c6 5 23 1 Y 32896 31 63 +c5+c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c5+c7 5 23 1 Y 32896 31 63 +c5+c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c6+c0 5 23 1 Y 32896 31 63 +c6+c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c6+c1 5 23 1 Y 32896 31 63 +c6+c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c6+c2 5 23 1 Y 32896 31 63 +c6+c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c6+c3 5 23 1 Y 32896 31 63 +c6+c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c6+c4 5 23 1 Y 32896 31 63 +c6+c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c6+c5 5 23 1 Y 32896 31 63 +c6+c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c6+c6 8 12 1 Y 32896 0 63 +c6+c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c6+c7 8 12 1 Y 32896 0 63 +c6+c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c7+c0 5 23 1 Y 32896 31 63 +c7+c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c7+c1 5 23 1 Y 32896 31 63 +c7+c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c7+c2 5 23 1 Y 32896 31 63 +c7+c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c7+c3 5 23 1 Y 32896 31 63 +c7+c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c7+c4 5 23 1 Y 32896 31 63 +c7+c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c7+c5 5 23 1 Y 32896 31 63 +c7+c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c7+c6 8 12 1 Y 32896 0 63 +c7+c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def c7+c7 3 3 1 Y 32896 0 63 +c7+c7 +2 +CALL p2('COALESCE(t1.colt1, t2.colt2)'); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c0, t2.c0) 254 30 1 Y 0 39 8 +COALESCE(t1.c0, t2.c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c0, t2.c1) 253 30 1 Y 0 39 8 +COALESCE(t1.c0, t2.c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c0, t2.c2) 249 255 1 Y 0 39 8 +COALESCE(t1.c0, t2.c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c0, t2.c3) 252 65535 1 Y 0 39 8 +COALESCE(t1.c0, t2.c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c0, t2.c4) 250 16777215 1 Y 0 39 8 +COALESCE(t1.c0, t2.c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c0, t2.c5) 251 4294967295 1 Y 0 39 8 +COALESCE(t1.c0, t2.c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c0, t2.c6) 254 30 1 Y 0 39 8 +COALESCE(t1.c0, t2.c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c0, t2.c7) 254 30 1 Y 0 39 8 +COALESCE(t1.c0, t2.c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c0, t2.c8) 254 30 1 Y 0 39 8 +COALESCE(t1.c0, t2.c8) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c0, t2.c9) 254 30 1 Y 0 39 8 +COALESCE(t1.c0, t2.c9) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c0, t2.c10) 254 30 1 Y 0 39 8 +COALESCE(t1.c0, t2.c10) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c0, t2.c11) 254 30 1 Y 0 39 8 +COALESCE(t1.c0, t2.c11) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c0, t2.c12) 254 30 1 Y 0 39 8 +COALESCE(t1.c0, t2.c12) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c1, t2.c0) 253 30 1 Y 0 39 8 +COALESCE(t1.c1, t2.c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c1, t2.c1) 253 30 1 Y 0 39 8 +COALESCE(t1.c1, t2.c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c1, t2.c2) 249 255 1 Y 0 39 8 +COALESCE(t1.c1, t2.c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c1, t2.c3) 252 65535 1 Y 0 39 8 +COALESCE(t1.c1, t2.c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c1, t2.c4) 250 16777215 1 Y 0 39 8 +COALESCE(t1.c1, t2.c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c1, t2.c5) 251 4294967295 1 Y 0 39 8 +COALESCE(t1.c1, t2.c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c1, t2.c6) 253 30 1 Y 0 39 8 +COALESCE(t1.c1, t2.c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c1, t2.c7) 253 30 1 Y 0 39 8 +COALESCE(t1.c1, t2.c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c1, t2.c8) 253 30 1 Y 0 39 8 +COALESCE(t1.c1, t2.c8) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c1, t2.c9) 253 30 1 Y 0 39 8 +COALESCE(t1.c1, t2.c9) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c1, t2.c10) 253 30 1 Y 0 39 8 +COALESCE(t1.c1, t2.c10) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c1, t2.c11) 253 30 1 Y 0 39 8 +COALESCE(t1.c1, t2.c11) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c1, t2.c12) 253 30 1 Y 0 39 8 +COALESCE(t1.c1, t2.c12) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c2, t2.c0) 249 255 1 Y 0 39 8 +COALESCE(t1.c2, t2.c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c2, t2.c1) 249 255 1 Y 0 39 8 +COALESCE(t1.c2, t2.c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c2, t2.c2) 249 255 1 Y 0 39 8 +COALESCE(t1.c2, t2.c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c2, t2.c3) 252 65535 1 Y 0 39 8 +COALESCE(t1.c2, t2.c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c2, t2.c4) 250 16777215 1 Y 0 39 8 +COALESCE(t1.c2, t2.c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c2, t2.c5) 251 4294967295 1 Y 0 39 8 +COALESCE(t1.c2, t2.c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c2, t2.c6) 249 255 1 Y 0 39 8 +COALESCE(t1.c2, t2.c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c2, t2.c7) 249 255 1 Y 0 39 8 +COALESCE(t1.c2, t2.c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c2, t2.c8) 249 255 1 Y 0 39 8 +COALESCE(t1.c2, t2.c8) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c2, t2.c9) 249 255 1 Y 0 39 8 +COALESCE(t1.c2, t2.c9) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c2, t2.c10) 249 255 1 Y 0 39 8 +COALESCE(t1.c2, t2.c10) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c2, t2.c11) 249 255 1 Y 0 39 8 +COALESCE(t1.c2, t2.c11) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c2, t2.c12) 249 255 1 Y 0 39 8 +COALESCE(t1.c2, t2.c12) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c3, t2.c0) 252 65535 1 Y 0 39 8 +COALESCE(t1.c3, t2.c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c3, t2.c1) 252 65535 1 Y 0 39 8 +COALESCE(t1.c3, t2.c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c3, t2.c2) 252 65535 1 Y 0 39 8 +COALESCE(t1.c3, t2.c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c3, t2.c3) 252 65535 1 Y 0 39 8 +COALESCE(t1.c3, t2.c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c3, t2.c4) 250 16777215 1 Y 0 39 8 +COALESCE(t1.c3, t2.c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c3, t2.c5) 251 4294967295 1 Y 0 39 8 +COALESCE(t1.c3, t2.c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c3, t2.c6) 252 65535 1 Y 0 39 8 +COALESCE(t1.c3, t2.c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c3, t2.c7) 252 65535 1 Y 0 39 8 +COALESCE(t1.c3, t2.c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c3, t2.c8) 252 65535 1 Y 0 39 8 +COALESCE(t1.c3, t2.c8) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c3, t2.c9) 252 65535 1 Y 0 39 8 +COALESCE(t1.c3, t2.c9) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c3, t2.c10) 252 65535 1 Y 0 39 8 +COALESCE(t1.c3, t2.c10) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c3, t2.c11) 252 65535 1 Y 0 39 8 +COALESCE(t1.c3, t2.c11) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c3, t2.c12) 252 65535 1 Y 0 39 8 +COALESCE(t1.c3, t2.c12) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c4, t2.c0) 250 16777215 1 Y 0 39 8 +COALESCE(t1.c4, t2.c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c4, t2.c1) 250 16777215 1 Y 0 39 8 +COALESCE(t1.c4, t2.c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c4, t2.c2) 250 16777215 1 Y 0 39 8 +COALESCE(t1.c4, t2.c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c4, t2.c3) 250 16777215 1 Y 0 39 8 +COALESCE(t1.c4, t2.c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c4, t2.c4) 250 16777215 1 Y 0 39 8 +COALESCE(t1.c4, t2.c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c4, t2.c5) 251 4294967295 1 Y 0 39 8 +COALESCE(t1.c4, t2.c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c4, t2.c6) 250 16777215 1 Y 0 39 8 +COALESCE(t1.c4, t2.c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c4, t2.c7) 250 16777215 1 Y 0 39 8 +COALESCE(t1.c4, t2.c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c4, t2.c8) 250 16777215 1 Y 0 39 8 +COALESCE(t1.c4, t2.c8) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c4, t2.c9) 250 16777215 1 Y 0 39 8 +COALESCE(t1.c4, t2.c9) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c4, t2.c10) 250 16777215 1 Y 0 39 8 +COALESCE(t1.c4, t2.c10) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c4, t2.c11) 250 16777215 1 Y 0 39 8 +COALESCE(t1.c4, t2.c11) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c4, t2.c12) 250 16777215 1 Y 0 39 8 +COALESCE(t1.c4, t2.c12) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c5, t2.c0) 251 4294967295 1 Y 0 39 8 +COALESCE(t1.c5, t2.c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c5, t2.c1) 251 4294967295 1 Y 0 39 8 +COALESCE(t1.c5, t2.c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c5, t2.c2) 251 4294967295 1 Y 0 39 8 +COALESCE(t1.c5, t2.c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c5, t2.c3) 251 4294967295 1 Y 0 39 8 +COALESCE(t1.c5, t2.c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c5, t2.c4) 251 4294967295 1 Y 0 39 8 +COALESCE(t1.c5, t2.c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c5, t2.c5) 251 4294967295 1 Y 0 39 8 +COALESCE(t1.c5, t2.c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c5, t2.c6) 251 4294967295 1 Y 0 39 8 +COALESCE(t1.c5, t2.c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c5, t2.c7) 251 4294967295 1 Y 0 39 8 +COALESCE(t1.c5, t2.c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c5, t2.c8) 251 4294967295 1 Y 0 39 8 +COALESCE(t1.c5, t2.c8) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c5, t2.c9) 251 4294967295 1 Y 0 39 8 +COALESCE(t1.c5, t2.c9) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c5, t2.c10) 251 4294967295 1 Y 0 39 8 +COALESCE(t1.c5, t2.c10) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c5, t2.c11) 251 4294967295 1 Y 0 39 8 +COALESCE(t1.c5, t2.c11) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c5, t2.c12) 251 4294967295 1 Y 0 39 8 +COALESCE(t1.c5, t2.c12) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c6, t2.c0) 254 30 1 Y 0 39 8 +COALESCE(t1.c6, t2.c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c6, t2.c1) 253 30 1 Y 0 39 8 +COALESCE(t1.c6, t2.c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c6, t2.c2) 249 255 1 Y 0 39 8 +COALESCE(t1.c6, t2.c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c6, t2.c3) 252 65535 1 Y 0 39 8 +COALESCE(t1.c6, t2.c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c6, t2.c4) 250 16777215 1 Y 0 39 8 +COALESCE(t1.c6, t2.c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c6, t2.c5) 251 4294967295 1 Y 0 39 8 +COALESCE(t1.c6, t2.c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c6, t2.c6) 3 11 1 Y 32896 0 63 +COALESCE(t1.c6, t2.c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c6, t2.c7) 5 22 1 Y 32896 31 63 +COALESCE(t1.c6, t2.c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c6, t2.c8) 246 14 4 Y 32896 2 63 +COALESCE(t1.c6, t2.c8) +1.00 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c6, t2.c9) 253 11 1 Y 0 39 8 +COALESCE(t1.c6, t2.c9) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c6, t2.c10) 253 11 1 Y 0 39 8 +COALESCE(t1.c6, t2.c10) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c6, t2.c11) 253 19 1 Y 0 39 8 +COALESCE(t1.c6, t2.c11) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c6, t2.c12) 254 11 1 Y 0 39 8 +COALESCE(t1.c6, t2.c12) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c7, t2.c0) 254 30 1 Y 0 39 8 +COALESCE(t1.c7, t2.c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c7, t2.c1) 253 30 1 Y 0 39 8 +COALESCE(t1.c7, t2.c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c7, t2.c2) 249 255 1 Y 0 39 8 +COALESCE(t1.c7, t2.c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c7, t2.c3) 252 65535 1 Y 0 39 8 +COALESCE(t1.c7, t2.c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c7, t2.c4) 250 16777215 1 Y 0 39 8 +COALESCE(t1.c7, t2.c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c7, t2.c5) 251 4294967295 1 Y 0 39 8 +COALESCE(t1.c7, t2.c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c7, t2.c6) 254 11 1 Y 0 39 8 +COALESCE(t1.c7, t2.c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c7, t2.c7) 254 22 1 Y 0 39 8 +COALESCE(t1.c7, t2.c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c7, t2.c8) 254 12 1 Y 0 39 8 +COALESCE(t1.c7, t2.c8) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c7, t2.c9) 254 10 1 Y 0 39 8 +COALESCE(t1.c7, t2.c9) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c7, t2.c10) 254 10 1 Y 0 39 8 +COALESCE(t1.c7, t2.c10) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c7, t2.c11) 254 19 1 Y 0 39 8 +COALESCE(t1.c7, t2.c11) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(t1.c7, t2.c12) 254 1 1 Y 0 39 8 +COALESCE(t1.c7, t2.c12) +1 +CALL p2('LEAST(t1.colt1, t2.colt2)'); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c0, t2.c0) 254 30 1 Y 0 39 8 +LEAST(t1.c0, t2.c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c0, t2.c1) 253 30 1 Y 0 39 8 +LEAST(t1.c0, t2.c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c0, t2.c2) 249 255 1 Y 0 39 8 +LEAST(t1.c0, t2.c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c0, t2.c3) 252 65535 1 Y 0 39 8 +LEAST(t1.c0, t2.c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c0, t2.c4) 250 16777215 1 Y 0 39 8 +LEAST(t1.c0, t2.c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c0, t2.c5) 251 4294967295 1 Y 0 39 8 +LEAST(t1.c0, t2.c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c0, t2.c6) 5 23 1 Y 32896 31 63 +LEAST(t1.c0, t2.c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c0, t2.c7) 5 23 1 Y 32896 31 63 +LEAST(t1.c0, t2.c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c0, t2.c8) 5 23 1 Y 32896 31 63 +LEAST(t1.c0, t2.c8) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c0, t2.c9) 11 17 15 Y 128 6 63 +LEAST(t1.c0, t2.c9) +00:00:01.000000 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c0, t2.c10) 10 10 10 Y 128 0 63 +LEAST(t1.c0, t2.c10) +0000-00-00 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c0, t2.c11) 12 26 26 Y 128 6 63 +LEAST(t1.c0, t2.c11) +0000-00-00 00:00:00.000000 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c0, t2.c12) 254 30 1 Y 0 39 8 +LEAST(t1.c0, t2.c12) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c1, t2.c0) 253 30 1 Y 0 39 8 +LEAST(t1.c1, t2.c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c1, t2.c1) 253 30 1 Y 0 39 8 +LEAST(t1.c1, t2.c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c1, t2.c2) 249 255 1 Y 0 39 8 +LEAST(t1.c1, t2.c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c1, t2.c3) 252 65535 1 Y 0 39 8 +LEAST(t1.c1, t2.c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c1, t2.c4) 250 16777215 1 Y 0 39 8 +LEAST(t1.c1, t2.c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c1, t2.c5) 251 4294967295 1 Y 0 39 8 +LEAST(t1.c1, t2.c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c1, t2.c6) 5 23 1 Y 32896 31 63 +LEAST(t1.c1, t2.c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c1, t2.c7) 5 23 1 Y 32896 31 63 +LEAST(t1.c1, t2.c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c1, t2.c8) 5 23 1 Y 32896 31 63 +LEAST(t1.c1, t2.c8) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c1, t2.c9) 11 17 15 Y 128 6 63 +LEAST(t1.c1, t2.c9) +00:00:01.000000 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c1, t2.c10) 10 10 10 Y 128 0 63 +LEAST(t1.c1, t2.c10) +0000-00-00 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c1, t2.c11) 12 26 26 Y 128 6 63 +LEAST(t1.c1, t2.c11) +0000-00-00 00:00:00.000000 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c1, t2.c12) 253 30 1 Y 0 39 8 +LEAST(t1.c1, t2.c12) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c2, t2.c0) 249 255 1 Y 0 39 8 +LEAST(t1.c2, t2.c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c2, t2.c1) 249 255 1 Y 0 39 8 +LEAST(t1.c2, t2.c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c2, t2.c2) 249 255 1 Y 0 39 8 +LEAST(t1.c2, t2.c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c2, t2.c3) 252 65535 1 Y 0 39 8 +LEAST(t1.c2, t2.c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c2, t2.c4) 250 16777215 1 Y 0 39 8 +LEAST(t1.c2, t2.c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c2, t2.c5) 251 4294967295 1 Y 0 39 8 +LEAST(t1.c2, t2.c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c2, t2.c6) 5 23 1 Y 32896 31 63 +LEAST(t1.c2, t2.c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c2, t2.c7) 5 23 1 Y 32896 31 63 +LEAST(t1.c2, t2.c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c2, t2.c8) 5 23 1 Y 32896 31 63 +LEAST(t1.c2, t2.c8) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c2, t2.c9) 11 17 15 Y 128 6 63 +LEAST(t1.c2, t2.c9) +00:00:01.000000 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c2, t2.c10) 10 10 10 Y 128 0 63 +LEAST(t1.c2, t2.c10) +0000-00-00 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c2, t2.c11) 12 26 26 Y 128 6 63 +LEAST(t1.c2, t2.c11) +0000-00-00 00:00:00.000000 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c2, t2.c12) 249 255 1 Y 0 39 8 +LEAST(t1.c2, t2.c12) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c3, t2.c0) 252 65535 1 Y 0 39 8 +LEAST(t1.c3, t2.c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c3, t2.c1) 252 65535 1 Y 0 39 8 +LEAST(t1.c3, t2.c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c3, t2.c2) 252 65535 1 Y 0 39 8 +LEAST(t1.c3, t2.c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c3, t2.c3) 252 65535 1 Y 0 39 8 +LEAST(t1.c3, t2.c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c3, t2.c4) 250 16777215 1 Y 0 39 8 +LEAST(t1.c3, t2.c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c3, t2.c5) 251 4294967295 1 Y 0 39 8 +LEAST(t1.c3, t2.c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c3, t2.c6) 5 23 1 Y 32896 31 63 +LEAST(t1.c3, t2.c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c3, t2.c7) 5 23 1 Y 32896 31 63 +LEAST(t1.c3, t2.c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c3, t2.c8) 5 23 1 Y 32896 31 63 +LEAST(t1.c3, t2.c8) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c3, t2.c9) 11 17 15 Y 128 6 63 +LEAST(t1.c3, t2.c9) +00:00:01.000000 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c3, t2.c10) 10 10 10 Y 128 0 63 +LEAST(t1.c3, t2.c10) +0000-00-00 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c3, t2.c11) 12 26 26 Y 128 6 63 +LEAST(t1.c3, t2.c11) +0000-00-00 00:00:00.000000 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c3, t2.c12) 252 65535 1 Y 0 39 8 +LEAST(t1.c3, t2.c12) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c4, t2.c0) 250 16777215 1 Y 0 39 8 +LEAST(t1.c4, t2.c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c4, t2.c1) 250 16777215 1 Y 0 39 8 +LEAST(t1.c4, t2.c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c4, t2.c2) 250 16777215 1 Y 0 39 8 +LEAST(t1.c4, t2.c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c4, t2.c3) 250 16777215 1 Y 0 39 8 +LEAST(t1.c4, t2.c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c4, t2.c4) 250 16777215 1 Y 0 39 8 +LEAST(t1.c4, t2.c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c4, t2.c5) 251 4294967295 1 Y 0 39 8 +LEAST(t1.c4, t2.c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c4, t2.c6) 5 23 1 Y 32896 31 63 +LEAST(t1.c4, t2.c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c4, t2.c7) 5 23 1 Y 32896 31 63 +LEAST(t1.c4, t2.c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c4, t2.c8) 5 23 1 Y 32896 31 63 +LEAST(t1.c4, t2.c8) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c4, t2.c9) 11 17 15 Y 128 6 63 +LEAST(t1.c4, t2.c9) +00:00:01.000000 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c4, t2.c10) 10 10 10 Y 128 0 63 +LEAST(t1.c4, t2.c10) +0000-00-00 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c4, t2.c11) 12 26 26 Y 128 6 63 +LEAST(t1.c4, t2.c11) +0000-00-00 00:00:00.000000 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c4, t2.c12) 250 16777215 1 Y 0 39 8 +LEAST(t1.c4, t2.c12) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c5, t2.c0) 251 4294967295 1 Y 0 39 8 +LEAST(t1.c5, t2.c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c5, t2.c1) 251 4294967295 1 Y 0 39 8 +LEAST(t1.c5, t2.c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c5, t2.c2) 251 4294967295 1 Y 0 39 8 +LEAST(t1.c5, t2.c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c5, t2.c3) 251 4294967295 1 Y 0 39 8 +LEAST(t1.c5, t2.c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c5, t2.c4) 251 4294967295 1 Y 0 39 8 +LEAST(t1.c5, t2.c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c5, t2.c5) 251 4294967295 1 Y 0 39 8 +LEAST(t1.c5, t2.c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c5, t2.c6) 5 23 1 Y 32896 31 63 +LEAST(t1.c5, t2.c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c5, t2.c7) 5 23 1 Y 32896 31 63 +LEAST(t1.c5, t2.c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c5, t2.c8) 5 23 1 Y 32896 31 63 +LEAST(t1.c5, t2.c8) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c5, t2.c9) 11 17 15 Y 128 6 63 +LEAST(t1.c5, t2.c9) +00:00:01.000000 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c5, t2.c10) 10 10 10 Y 128 0 63 +LEAST(t1.c5, t2.c10) +0000-00-00 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c5, t2.c11) 12 26 26 Y 128 6 63 +LEAST(t1.c5, t2.c11) +0000-00-00 00:00:00.000000 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c5, t2.c12) 251 4294967295 1 Y 0 39 8 +LEAST(t1.c5, t2.c12) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c6, t2.c0) 5 23 1 Y 32896 31 63 +LEAST(t1.c6, t2.c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c6, t2.c1) 5 23 1 Y 32896 31 63 +LEAST(t1.c6, t2.c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c6, t2.c2) 5 23 1 Y 32896 31 63 +LEAST(t1.c6, t2.c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c6, t2.c3) 5 23 1 Y 32896 31 63 +LEAST(t1.c6, t2.c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c6, t2.c4) 5 23 1 Y 32896 31 63 +LEAST(t1.c6, t2.c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c6, t2.c5) 5 23 1 Y 32896 31 63 +LEAST(t1.c6, t2.c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c6, t2.c6) 3 11 1 Y 32896 0 63 +LEAST(t1.c6, t2.c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c6, t2.c7) 5 23 1 Y 32896 31 63 +LEAST(t1.c6, t2.c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c6, t2.c8) 246 14 4 Y 32896 2 63 +LEAST(t1.c6, t2.c8) +1.00 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c6, t2.c9) 11 10 8 Y 128 0 63 +LEAST(t1.c6, t2.c9) +00:00:01 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c6, t2.c10) 10 10 10 Y 128 0 63 +LEAST(t1.c6, t2.c10) +0000-00-00 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c6, t2.c11) 12 19 19 Y 128 0 63 +LEAST(t1.c6, t2.c11) +0000-00-00 00:00:00 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c6, t2.c12) 5 17 1 Y 32896 0 63 +LEAST(t1.c6, t2.c12) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c7, t2.c0) 254 30 1 Y 0 39 8 +LEAST(t1.c7, t2.c0) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c7, t2.c1) 253 30 1 Y 0 39 8 +LEAST(t1.c7, t2.c1) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c7, t2.c2) 249 255 1 Y 0 39 8 +LEAST(t1.c7, t2.c2) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c7, t2.c3) 252 65535 1 Y 0 39 8 +LEAST(t1.c7, t2.c3) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c7, t2.c4) 250 16777215 1 Y 0 39 8 +LEAST(t1.c7, t2.c4) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c7, t2.c5) 251 4294967295 1 Y 0 39 8 +LEAST(t1.c7, t2.c5) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c7, t2.c6) 5 17 1 Y 32896 0 63 +LEAST(t1.c7, t2.c6) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c7, t2.c7) 5 23 1 Y 32896 31 63 +LEAST(t1.c7, t2.c7) +1 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c7, t2.c8) 5 19 4 Y 32896 2 63 +LEAST(t1.c7, t2.c8) +1.00 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c7, t2.c9) 11 10 8 Y 128 0 63 +LEAST(t1.c7, t2.c9) +00:00:01 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c7, t2.c10) 10 10 10 Y 128 0 63 +LEAST(t1.c7, t2.c10) +0000-00-00 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c7, t2.c11) 12 19 19 Y 128 0 63 +LEAST(t1.c7, t2.c11) +0000-00-00 00:00:00 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def LEAST(t1.c7, t2.c12) 254 1 1 Y 0 39 8 +LEAST(t1.c7, t2.c12) +1 +CALL p2('t1.colt1+t2.colt2'); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c0+t2.c0 5 23 1 Y 32896 31 63 +t1.c0+t2.c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c0+t2.c1 5 23 1 Y 32896 31 63 +t1.c0+t2.c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c0+t2.c2 5 23 1 Y 32896 31 63 +t1.c0+t2.c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c0+t2.c3 5 23 1 Y 32896 31 63 +t1.c0+t2.c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c0+t2.c4 5 23 1 Y 32896 31 63 +t1.c0+t2.c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c0+t2.c5 5 23 1 Y 32896 31 63 +t1.c0+t2.c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c0+t2.c6 5 23 1 Y 32896 31 63 +t1.c0+t2.c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c0+t2.c7 5 23 1 Y 32896 31 63 +t1.c0+t2.c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c0+t2.c8 5 23 4 Y 32896 31 63 +t1.c0+t2.c8 +2.23 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c0+t2.c9 5 23 6 Y 32896 31 63 +t1.c0+t2.c9 +102031 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c0+t2.c10 5 23 8 Y 32896 31 63 +t1.c0+t2.c10 +20010102 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c0+t2.c11 5 23 14 Y 32896 31 63 +t1.c0+t2.c11 +20010101102031 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c0+t2.c12 5 23 1 Y 32896 31 63 +t1.c0+t2.c12 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c1+t2.c0 5 23 1 Y 32896 31 63 +t1.c1+t2.c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c1+t2.c1 5 23 1 Y 32896 31 63 +t1.c1+t2.c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c1+t2.c2 5 23 1 Y 32896 31 63 +t1.c1+t2.c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c1+t2.c3 5 23 1 Y 32896 31 63 +t1.c1+t2.c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c1+t2.c4 5 23 1 Y 32896 31 63 +t1.c1+t2.c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c1+t2.c5 5 23 1 Y 32896 31 63 +t1.c1+t2.c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c1+t2.c6 5 23 1 Y 32896 31 63 +t1.c1+t2.c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c1+t2.c7 5 23 1 Y 32896 31 63 +t1.c1+t2.c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c1+t2.c8 5 23 4 Y 32896 31 63 +t1.c1+t2.c8 +2.23 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c1+t2.c9 5 23 6 Y 32896 31 63 +t1.c1+t2.c9 +102031 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c1+t2.c10 5 23 8 Y 32896 31 63 +t1.c1+t2.c10 +20010102 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c1+t2.c11 5 23 14 Y 32896 31 63 +t1.c1+t2.c11 +20010101102031 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c1+t2.c12 5 23 1 Y 32896 31 63 +t1.c1+t2.c12 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c2+t2.c0 5 23 1 Y 32896 31 63 +t1.c2+t2.c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c2+t2.c1 5 23 1 Y 32896 31 63 +t1.c2+t2.c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c2+t2.c2 5 23 1 Y 32896 31 63 +t1.c2+t2.c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c2+t2.c3 5 23 1 Y 32896 31 63 +t1.c2+t2.c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c2+t2.c4 5 23 1 Y 32896 31 63 +t1.c2+t2.c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c2+t2.c5 5 23 1 Y 32896 31 63 +t1.c2+t2.c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c2+t2.c6 5 23 1 Y 32896 31 63 +t1.c2+t2.c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c2+t2.c7 5 23 1 Y 32896 31 63 +t1.c2+t2.c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c2+t2.c8 5 23 4 Y 32896 31 63 +t1.c2+t2.c8 +2.23 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c2+t2.c9 5 23 6 Y 32896 31 63 +t1.c2+t2.c9 +102031 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c2+t2.c10 5 23 8 Y 32896 31 63 +t1.c2+t2.c10 +20010102 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c2+t2.c11 5 23 14 Y 32896 31 63 +t1.c2+t2.c11 +20010101102031 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c2+t2.c12 5 23 1 Y 32896 31 63 +t1.c2+t2.c12 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c3+t2.c0 5 23 1 Y 32896 31 63 +t1.c3+t2.c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c3+t2.c1 5 23 1 Y 32896 31 63 +t1.c3+t2.c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c3+t2.c2 5 23 1 Y 32896 31 63 +t1.c3+t2.c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c3+t2.c3 5 23 1 Y 32896 31 63 +t1.c3+t2.c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c3+t2.c4 5 23 1 Y 32896 31 63 +t1.c3+t2.c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c3+t2.c5 5 23 1 Y 32896 31 63 +t1.c3+t2.c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c3+t2.c6 5 23 1 Y 32896 31 63 +t1.c3+t2.c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c3+t2.c7 5 23 1 Y 32896 31 63 +t1.c3+t2.c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c3+t2.c8 5 23 4 Y 32896 31 63 +t1.c3+t2.c8 +2.23 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c3+t2.c9 5 23 6 Y 32896 31 63 +t1.c3+t2.c9 +102031 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c3+t2.c10 5 23 8 Y 32896 31 63 +t1.c3+t2.c10 +20010102 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c3+t2.c11 5 23 14 Y 32896 31 63 +t1.c3+t2.c11 +20010101102031 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c3+t2.c12 5 23 1 Y 32896 31 63 +t1.c3+t2.c12 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c4+t2.c0 5 23 1 Y 32896 31 63 +t1.c4+t2.c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c4+t2.c1 5 23 1 Y 32896 31 63 +t1.c4+t2.c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c4+t2.c2 5 23 1 Y 32896 31 63 +t1.c4+t2.c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c4+t2.c3 5 23 1 Y 32896 31 63 +t1.c4+t2.c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c4+t2.c4 5 23 1 Y 32896 31 63 +t1.c4+t2.c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c4+t2.c5 5 23 1 Y 32896 31 63 +t1.c4+t2.c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c4+t2.c6 5 23 1 Y 32896 31 63 +t1.c4+t2.c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c4+t2.c7 5 23 1 Y 32896 31 63 +t1.c4+t2.c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c4+t2.c8 5 23 4 Y 32896 31 63 +t1.c4+t2.c8 +2.23 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c4+t2.c9 5 23 6 Y 32896 31 63 +t1.c4+t2.c9 +102031 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c4+t2.c10 5 23 8 Y 32896 31 63 +t1.c4+t2.c10 +20010102 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c4+t2.c11 5 23 14 Y 32896 31 63 +t1.c4+t2.c11 +20010101102031 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c4+t2.c12 5 23 1 Y 32896 31 63 +t1.c4+t2.c12 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c5+t2.c0 5 23 1 Y 32896 31 63 +t1.c5+t2.c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c5+t2.c1 5 23 1 Y 32896 31 63 +t1.c5+t2.c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c5+t2.c2 5 23 1 Y 32896 31 63 +t1.c5+t2.c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c5+t2.c3 5 23 1 Y 32896 31 63 +t1.c5+t2.c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c5+t2.c4 5 23 1 Y 32896 31 63 +t1.c5+t2.c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c5+t2.c5 5 23 1 Y 32896 31 63 +t1.c5+t2.c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c5+t2.c6 5 23 1 Y 32896 31 63 +t1.c5+t2.c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c5+t2.c7 5 23 1 Y 32896 31 63 +t1.c5+t2.c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c5+t2.c8 5 23 4 Y 32896 31 63 +t1.c5+t2.c8 +2.23 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c5+t2.c9 5 23 6 Y 32896 31 63 +t1.c5+t2.c9 +102031 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c5+t2.c10 5 23 8 Y 32896 31 63 +t1.c5+t2.c10 +20010102 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c5+t2.c11 5 23 14 Y 32896 31 63 +t1.c5+t2.c11 +20010101102031 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c5+t2.c12 5 23 1 Y 32896 31 63 +t1.c5+t2.c12 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c6+t2.c0 5 23 1 Y 32896 31 63 +t1.c6+t2.c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c6+t2.c1 5 23 1 Y 32896 31 63 +t1.c6+t2.c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c6+t2.c2 5 23 1 Y 32896 31 63 +t1.c6+t2.c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c6+t2.c3 5 23 1 Y 32896 31 63 +t1.c6+t2.c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c6+t2.c4 5 23 1 Y 32896 31 63 +t1.c6+t2.c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c6+t2.c5 5 23 1 Y 32896 31 63 +t1.c6+t2.c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c6+t2.c6 8 12 1 Y 32896 0 63 +t1.c6+t2.c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c6+t2.c7 5 23 1 Y 32896 31 63 +t1.c6+t2.c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c6+t2.c8 246 15 4 Y 32896 2 63 +t1.c6+t2.c8 +2.23 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c6+t2.c9 8 12 6 Y 32896 0 63 +t1.c6+t2.c9 +102031 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c6+t2.c10 8 12 8 Y 32896 0 63 +t1.c6+t2.c10 +20010102 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c6+t2.c11 8 16 14 Y 32896 0 63 +t1.c6+t2.c11 +20010101102031 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c6+t2.c12 8 12 1 Y 32896 0 63 +t1.c6+t2.c12 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c7+t2.c0 5 23 1 Y 32896 31 63 +t1.c7+t2.c0 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c7+t2.c1 5 23 1 Y 32896 31 63 +t1.c7+t2.c1 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c7+t2.c2 5 23 1 Y 32896 31 63 +t1.c7+t2.c2 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c7+t2.c3 5 23 1 Y 32896 31 63 +t1.c7+t2.c3 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c7+t2.c4 5 23 1 Y 32896 31 63 +t1.c7+t2.c4 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c7+t2.c5 5 23 1 Y 32896 31 63 +t1.c7+t2.c5 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c7+t2.c6 8 12 1 Y 32896 0 63 +t1.c7+t2.c6 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c7+t2.c7 5 23 1 Y 32896 31 63 +t1.c7+t2.c7 +2 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c7+t2.c8 246 13 4 Y 32896 2 63 +t1.c7+t2.c8 +2.23 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c7+t2.c9 3 9 6 Y 32896 0 63 +t1.c7+t2.c9 +102031 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c7+t2.c10 8 10 8 Y 32896 0 63 +t1.c7+t2.c10 +20010102 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c7+t2.c11 8 16 14 Y 32896 0 63 +t1.c7+t2.c11 +20010101102031 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1.c7+t2.c12 3 3 1 Y 32896 0 63 +t1.c7+t2.c12 +2 +DROP PROCEDURE p1; +DROP PROCEDURE p2; +DROP TABLE t1, t1c, t2; +# +# End of 10.5 tests +# diff --git a/mysql-test/suite/json/t/json_table.test b/mysql-test/suite/json/t/json_table.test index f250fcbf58a..2867c5f89d0 100644 --- a/mysql-test/suite/json/t/json_table.test +++ b/mysql-test/suite/json/t/json_table.test @@ -815,5 +815,33 @@ select * from json_table('{"a":"foo", "b":1, "c":1000}', '$.*' columns(converted select * from json_table('{"a":"foo", "b":1, "c":1000}', '$.*' columns(converted tinyint path '$', original text path '$')) as jt order by original; --echo # +--echo # MDEV-27696 Json table columns accept redundant COLLATE syntax +--echo # + +--error ER_PARSE_ERROR +SELECT * FROM json_table('[{"name":"str"}]', '$[*]' + COLUMNS ( + name BLOB COLLATE `binary` PATH '$.name' + ) +) AS jt; + + +--error ER_PARSE_ERROR +SELECT * FROM json_table('[{"name":"str"}]', '$[*]' + COLUMNS ( + name VARCHAR(10) COLLATE latin1_bin COLLATE latin1_swedish_ci PATH '$.name' + ) +) AS jt; + + +--error ER_PARSE_ERROR +SELECT * FROM json_table('[{"name":"str"}]', '$[*]' + COLUMNS ( + name VARCHAR(10) BINARY COLLATE utf8_czech_ci path '$.name' + ) +) AS jt; + + +--echo # --echo # End of 10.6 tests --echo # diff --git a/mysql-test/suite/json/t/rpl_json_char.test b/mysql-test/suite/json/t/rpl_json_char.test new file mode 100644 index 00000000000..51ad345a7ab --- /dev/null +++ b/mysql-test/suite/json/t/rpl_json_char.test @@ -0,0 +1,27 @@ +--source include/master-slave.inc + +--echo # +--echo # Start of 10.5 tests +--echo # + +--echo # +--echo # MDEV-27018 IF and COALESCE lose "json" property +--echo # + +CREATE TABLE t1 (a CHAR(100) CHECK(JSON_VALID(a))); + +--sync_slave_with_master + +--connection master +INSERT INTO t1 VALUES (JSON_OBJECT('a','b')); +--sync_slave_with_master +SELECT * FROM t1 ORDER BY a; + +--connection master +DROP TABLE t1; + +--echo # +--echo # End of 10.5 tests +--echo # + +--source include/rpl_end.inc diff --git a/mysql-test/suite/json/t/rpl_json_longtext.test b/mysql-test/suite/json/t/rpl_json_longtext.test new file mode 100644 index 00000000000..0155834458c --- /dev/null +++ b/mysql-test/suite/json/t/rpl_json_longtext.test @@ -0,0 +1,27 @@ +--source include/master-slave.inc + +--echo # +--echo # Start of 10.5 tests +--echo # + +--echo # +--echo # MDEV-27018 IF and COALESCE lose "json" property +--echo # + +CREATE TABLE t1 (a LONGTEXT CHECK(JSON_VALID(a))); + +--sync_slave_with_master + +--connection master +INSERT INTO t1 VALUES (JSON_OBJECT('a','b')); +--sync_slave_with_master +SELECT * FROM t1 ORDER BY a; + +--connection master +DROP TABLE t1; + +--echo # +--echo # End of 10.5 tests +--echo # + +--source include/rpl_end.inc diff --git a/mysql-test/suite/json/t/rpl_json_mediumtext.test b/mysql-test/suite/json/t/rpl_json_mediumtext.test new file mode 100644 index 00000000000..f4a52a19aa1 --- /dev/null +++ b/mysql-test/suite/json/t/rpl_json_mediumtext.test @@ -0,0 +1,27 @@ +--source include/master-slave.inc + +--echo # +--echo # Start of 10.5 tests +--echo # + +--echo # +--echo # MDEV-27018 IF and COALESCE lose "json" property +--echo # + +CREATE TABLE t1 (a MEDIUMTEXT CHECK(JSON_VALID(a))); + +--sync_slave_with_master + +--connection master +INSERT INTO t1 VALUES (JSON_OBJECT('a','b')); +--sync_slave_with_master +SELECT * FROM t1 ORDER BY a; + +--connection master +DROP TABLE t1; + +--echo # +--echo # End of 10.5 tests +--echo # + +--source include/rpl_end.inc diff --git a/mysql-test/suite/json/t/rpl_json_text.test b/mysql-test/suite/json/t/rpl_json_text.test new file mode 100644 index 00000000000..7c7def768e8 --- /dev/null +++ b/mysql-test/suite/json/t/rpl_json_text.test @@ -0,0 +1,27 @@ +--source include/master-slave.inc + +--echo # +--echo # Start of 10.5 tests +--echo # + +--echo # +--echo # MDEV-27018 IF and COALESCE lose "json" property +--echo # + +CREATE TABLE t1 (a TEXT CHECK(JSON_VALID(a))); + +--sync_slave_with_master + +--connection master +INSERT INTO t1 VALUES (JSON_OBJECT('a','b')); +--sync_slave_with_master +SELECT * FROM t1 ORDER BY a; + +--connection master +DROP TABLE t1; + +--echo # +--echo # End of 10.5 tests +--echo # + +--source include/rpl_end.inc diff --git a/mysql-test/suite/json/t/rpl_json_tinytext.test b/mysql-test/suite/json/t/rpl_json_tinytext.test new file mode 100644 index 00000000000..99a7c8c85b6 --- /dev/null +++ b/mysql-test/suite/json/t/rpl_json_tinytext.test @@ -0,0 +1,27 @@ +--source include/master-slave.inc + +--echo # +--echo # Start of 10.5 tests +--echo # + +--echo # +--echo # MDEV-27018 IF and COALESCE lose "json" property +--echo # + +CREATE TABLE t1 (a TINYTEXT CHECK(JSON_VALID(a))); + +--sync_slave_with_master + +--connection master +INSERT INTO t1 VALUES (JSON_OBJECT('a','b')); +--sync_slave_with_master +SELECT * FROM t1 ORDER BY a; + +--connection master +DROP TABLE t1; + +--echo # +--echo # End of 10.5 tests +--echo # + +--source include/rpl_end.inc diff --git a/mysql-test/suite/json/t/rpl_json_varchar.test b/mysql-test/suite/json/t/rpl_json_varchar.test new file mode 100644 index 00000000000..9464f670919 --- /dev/null +++ b/mysql-test/suite/json/t/rpl_json_varchar.test @@ -0,0 +1,27 @@ +--source include/master-slave.inc + +--echo # +--echo # Start of 10.5 tests +--echo # + +--echo # +--echo # MDEV-27018 IF and COALESCE lose "json" property +--echo # + +CREATE TABLE t1 (a VARCHAR(100) CHECK(JSON_VALID(a))); + +--sync_slave_with_master + +--connection master +INSERT INTO t1 VALUES (JSON_OBJECT('a','b')); +--sync_slave_with_master +SELECT * FROM t1 ORDER BY a; + +--connection master +DROP TABLE t1; + +--echo # +--echo # End of 10.5 tests +--echo # + +--source include/rpl_end.inc diff --git a/mysql-test/suite/json/t/type_json.test b/mysql-test/suite/json/t/type_json.test new file mode 100644 index 00000000000..f84bef780c3 --- /dev/null +++ b/mysql-test/suite/json/t/type_json.test @@ -0,0 +1,143 @@ +--echo # +--echo # Start of 10.5 tests +--echo # + + +--echo # +--echo # MDEV-27361 Hybrid functions with JSON arguments do not send format metadata +--echo # + +# Mix all columns in the given table tbl to each other and calculate expr. + +DELIMITER $$; +CREATE PROCEDURE p1(tbl TEXT, expr TEXT) +BEGIN + DECLARE t1cols INT DEFAULT (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS + WHERE TABLE_NAME=tbl AND TABLE_SCHEMA='test'); + FOR a IN 0..(t1cols-1) DO + FOR b IN 0..(t1cols-1) DO + BEGIN + DECLARE query TEXT DEFAULT CONCAT('SELECT ', expr, ' FROM ', tbl); + SET query= REPLACE(query, 'olt1', a); + SET query= REPLACE(query, 'olt2', b); + EXECUTE IMMEDIATE query; + END; + END FOR; + END FOR; +END; +$$ +DELIMITER ;$$ + + +# Mix all columns in table t1 to all columns in table t2 and calculate expr + +DELIMITER $$; +CREATE PROCEDURE p2(expr TEXT) +BEGIN + DECLARE t1cols INT DEFAULT (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS + WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test'); + DECLARE t2cols INT DEFAULT (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS + WHERE TABLE_NAME='t2' AND TABLE_SCHEMA='test'); + FOR a IN 0..(t1cols-1) DO + FOR b IN 0..(t2cols-1) DO + BEGIN + DECLARE query TEXT DEFAULT CONCAT('SELECT ', expr, ' FROM t1, t2'); + SET query= REPLACE(query, 'olt1', a); + SET query= REPLACE(query, 'olt2', b); + EXECUTE IMMEDIATE query; + END; + END FOR; + END FOR; +END; +$$ +DELIMITER ;$$ + + + +CREATE TABLE t1 +( + c0 CHAR(30) DEFAULT '1' CHECK(JSON_VALID(c0)), + c1 VARCHAR(30) DEFAULT '1' CHECK(JSON_VALID(c1)), + c2 TINYTEXT DEFAULT '1' CHECK(JSON_VALID(c2)), + c3 TEXT DEFAULT '1' CHECK(JSON_VALID(c3)), + c4 MEDIUMTEXT DEFAULT '1' CHECK(JSON_VALID(c4)), + c5 LONGTEXT DEFAULT '1' CHECK(JSON_VALID(c5)), +# The below data types do not have any special JSON properties. +# Just checking CHECK(JSON_VALID()) does not give any unexpected surprises. + c6 INT DEFAULT '1' CHECK(JSON_VALID(c6)), + c7 ENUM('1') DEFAULT '1' CHECK(JSON_VALID(c7)) +); +INSERT INTO t1 VALUES (); + + +CREATE TABLE t1c +( + c0 CHAR(30) DEFAULT '1' CHECK(JSON_VALID(c0)), + c1 VARCHAR(30) COMPRESSED DEFAULT '1' CHECK(JSON_VALID(c1)), + c2 TINYTEXT COMPRESSED DEFAULT '1' CHECK(JSON_VALID(c2)), + c3 TEXT COMPRESSED DEFAULT '1' CHECK(JSON_VALID(c3)), + c4 MEDIUMTEXT COMPRESSED DEFAULT '1' CHECK(JSON_VALID(c4)), + c5 LONGTEXT COMPRESSED DEFAULT '1' CHECK(JSON_VALID(c5)), +# The below data types do not have any special JSON properties. +# Just checking CHECK(JSON_VALID()) does not give any unexpected surprises. + c6 INT DEFAULT '1' CHECK(JSON_VALID(c6)), + c7 ENUM('1') DEFAULT '1' CHECK(JSON_VALID(c7)) +); +INSERT INTO t1c VALUES (); + + + +CREATE TABLE t2 +( + c0 CHAR(30) DEFAULT '1', + c1 VARCHAR(30) DEFAULT '1', + c2 TINYTEXT DEFAULT '1', + c3 TEXT DEFAULT '1', + c4 MEDIUMTEXT DEFAULT '1', + c5 LONGTEXT DEFAULT '1', + c6 INT DEFAULT 1, + c7 DOUBLE DEFAULT 1, + c8 DECIMAL(10,2) DEFAULT 1.23, + c9 TIME DEFAULT '10:20:30', + c10 DATE DEFAULT '2001-01-01', + c11 DATETIME DEFAULT '2001-01-01 10:20:30', + c12 ENUM('1','2') DEFAULT '1' +); +INSERT INTO t2 VALUES (); + + +--disable_ps_protocol +--enable_metadata +CALL p1('t1', 'COALESCE(colt1, colt2)'); +CALL p1('t1', 'LEAST(colt1, colt2)'); +CALL p1('t1', 'colt1+colt2'); +--disable_metadata +--disable_ps_protocol + + +--disable_ps_protocol +--enable_metadata +CALL p1('t1c', 'COALESCE(colt1, colt2)'); +CALL p1('t1c', 'LEAST(colt1, colt2)'); +CALL p1('t1c', 'colt1+colt2'); +--disable_metadata +--disable_ps_protocol + + +--disable_ps_protocol +--enable_metadata +CALL p2('COALESCE(t1.colt1, t2.colt2)'); +CALL p2('LEAST(t1.colt1, t2.colt2)'); +CALL p2('t1.colt1+t2.colt2'); +--disable_metadata +--disable_ps_protocol + + +DROP PROCEDURE p1; +DROP PROCEDURE p2; + +DROP TABLE t1, t1c, t2; + +--echo # +--echo # End of 10.5 tests +--echo # diff --git a/mysql-test/suite/maria/fulltext2.result b/mysql-test/suite/maria/fulltext2.result index 1e4e6636ef6..6cffc5cf404 100644 --- a/mysql-test/suite/maria/fulltext2.result +++ b/mysql-test/suite/maria/fulltext2.result @@ -84,3 +84,10 @@ select count(*) from t1 where match a against ('aaayyy' in boolean mode); count(*) 0 drop table t1; +set names utf8mb4; +create table t1 (a int, b text, fulltext (b)) charset=utf8mb4 collate=utf8mb4_unicode_ci engine=aria; +insert t1 values (1000, 'C͓̙̯͔̩ͅͅi̩̘̜̲a̯̲̬̳̜̖̤o͕͓̜͓̺̖̗,Ì Ì¬Íš ̺T͇̲h͈̱e ̬̜DÌ–o̦̖͔̗͖̩̘c̣̼tÌ͉̫̮̗o͉̫Ìr̙͎̗.͓̪̥'); +select a from t1 where match(b) against ('ciao' in boolean mode); +a +1000 +drop table t1; diff --git a/mysql-test/suite/maria/fulltext2.test b/mysql-test/suite/maria/fulltext2.test index 1fbece4fe95..7ebdff7bd53 100644 --- a/mysql-test/suite/maria/fulltext2.test +++ b/mysql-test/suite/maria/fulltext2.test @@ -75,3 +75,12 @@ select count(*) from t1 where match a against ('aaaxxx' in boolean mode); select count(*) from t1 where match a against ('aaayyy' in boolean mode); drop table t1; + +# +# MDEV-11241 Certain combining marks cause MariaDB to crash when doing Full-Text searches +# +set names utf8mb4; +create table t1 (a int, b text, fulltext (b)) charset=utf8mb4 collate=utf8mb4_unicode_ci engine=aria; +insert t1 values (1000, 'C͓̙̯͔̩ͅͅi̩̘̜̲a̯̲̬̳̜̖̤o͕͓̜͓̺̖̗,Ì Ì¬Íš ̺T͇̲h͈̱e ̬̜DÌ–o̦̖͔̗͖̩̘c̣̼tÌ͉̫̮̗o͉̫Ìr̙͎̗.͓̪̥'); +select a from t1 where match(b) against ('ciao' in boolean mode); +drop table t1; diff --git a/mysql-test/suite/mariabackup/create_with_data_directory_during_backup.test b/mysql-test/suite/mariabackup/create_with_data_directory_during_backup.test index d0cb83d069f..f01028b6494 100644 --- a/mysql-test/suite/mariabackup/create_with_data_directory_during_backup.test +++ b/mysql-test/suite/mariabackup/create_with_data_directory_during_backup.test @@ -1,4 +1,5 @@ --source include/have_debug.inc +--source include/have_symlink.inc let $table_data_dir=$MYSQLTEST_VARDIR/tmp/ddir; let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; mkdir $table_data_dir; diff --git a/mysql-test/suite/mariabackup/data_directory.test b/mysql-test/suite/mariabackup/data_directory.test index 50789a34c78..a89b7bdccc4 100644 --- a/mysql-test/suite/mariabackup/data_directory.test +++ b/mysql-test/suite/mariabackup/data_directory.test @@ -1,3 +1,4 @@ +--source include/have_symlink.inc let $table_data_dir=$MYSQLTEST_VARDIR/ddir; mkdir $table_data_dir; --replace_result $table_data_dir table_data_dir diff --git a/mysql-test/suite/mariabackup/defer_space.result b/mysql-test/suite/mariabackup/defer_space.result new file mode 100644 index 00000000000..41239c476e7 --- /dev/null +++ b/mysql-test/suite/mariabackup/defer_space.result @@ -0,0 +1,26 @@ +call mtr.add_suppression("InnoDB: Expected tablespace id .*"); +# Mariabackup --backup with page0 INIT_PAGE redo record +# and there is no FILE_CREATE for the tablespace t1 +SET DEBUG_DBUG="+d,checkpoint_after_file_create"; +CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB; +INSERT INTO t1 VALUES(1); +# xtrabackup backup +# xtrabackup prepare +# shutdown server +# remove datadir +# xtrabackup move back +# restart +SELECT * FROM t1; +f1 +1 +DROP TABLE t1; +SET DEBUG_DBUG="-d,checkpoint_after_file_create"; +# Mariabackup fails after corrupting the page0 in disk +# and there is no INIT_PAGE for page0 +CREATE TABLE t1(c INT) ENGINE=INNODB; +# Corrupt the table +# restart +# xtrabackup backup +FOUND 10 /Header page consists of zero bytes*/ in backup.log +UNLOCK TABLES; +DROP TABLE t1; diff --git a/mysql-test/suite/mariabackup/defer_space.test b/mysql-test/suite/mariabackup/defer_space.test new file mode 100644 index 00000000000..65f2262fd1d --- /dev/null +++ b/mysql-test/suite/mariabackup/defer_space.test @@ -0,0 +1,69 @@ +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/not_embedded.inc + +call mtr.add_suppression("InnoDB: Expected tablespace id .*"); +--echo # Mariabackup --backup with page0 INIT_PAGE redo record +--echo # and there is no FILE_CREATE for the tablespace t1 +SET DEBUG_DBUG="+d,checkpoint_after_file_create"; +CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB; +INSERT INTO t1 VALUES(1); + +echo # xtrabackup backup; +let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; + +--disable_result_log +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir; +--enable_result_log + +echo # xtrabackup prepare; +--disable_result_log +exec $XTRABACKUP --prepare --target-dir=$targetdir; +-- source include/restart_and_restore.inc +--enable_result_log + +SELECT * FROM t1; +DROP TABLE t1; +rmdir $targetdir; +SET DEBUG_DBUG="-d,checkpoint_after_file_create"; + +--echo # Mariabackup fails after corrupting the page0 in disk +--echo # and there is no INIT_PAGE for page0 + +CREATE TABLE t1(c INT) ENGINE=INNODB; +let MYSQLD_DATADIR=`select @@datadir`; +let INNODB_PAGE_SIZE=`select @@innodb_page_size`; +--source include/shutdown_mysqld.inc + +--echo # Corrupt the table + +perl; +use strict; +use warnings; +use Fcntl qw(:DEFAULT :seek); +my $page_size = $ENV{INNODB_PAGE_SIZE}; + +sysopen FILE, "$ENV{MYSQLD_DATADIR}/test/t1.ibd", O_RDWR +|| die "Cannot open t1.ibd\n"; +sysseek(FILE, 0, SEEK_SET) || die "Cannot seek t1.ibd\n"; +my $page=chr(0) x $page_size; +syswrite(FILE, $page, $page_size)==$page_size; +close FILE or die "close"; +EOF + +--source include/start_mysqld.inc +echo # xtrabackup backup; +let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; +let $backuplog=$MYSQLTEST_VARDIR/tmp/backup.log; +--disable_result_log +--error 1 +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --core-file > $backuplog; +--enable_result_log + +--let SEARCH_PATTERN=Header page consists of zero bytes* +--let SEARCH_FILE=$backuplog +--source include/search_pattern_in_file.inc +UNLOCK TABLES; +DROP TABLE t1; +rmdir $targetdir; +remove_file $backuplog; diff --git a/mysql-test/suite/mariabackup/partition_datadir.test b/mysql-test/suite/mariabackup/partition_datadir.test index c525d34a02c..36520d331bf 100644 --- a/mysql-test/suite/mariabackup/partition_datadir.test +++ b/mysql-test/suite/mariabackup/partition_datadir.test @@ -1,4 +1,5 @@ --source include/have_partition.inc +--source include/have_symlink.inc let $targetdir=$MYSQLTEST_VARDIR/backup; mkdir $targetdir; mkdir $MYSQLTEST_VARDIR/partitdata; diff --git a/mysql-test/suite/parts/t/alter_data_directory_innodb.test b/mysql-test/suite/parts/t/alter_data_directory_innodb.test index ac15e9bec6c..def04e14173 100644 --- a/mysql-test/suite/parts/t/alter_data_directory_innodb.test +++ b/mysql-test/suite/parts/t/alter_data_directory_innodb.test @@ -1,5 +1,6 @@ --source include/have_innodb.inc --source include/have_partition.inc +--source include/have_symlink.inc --echo # --echo # MDEV-15953 Alter InnoDB Partitioned Table Moves Files (which were originally not in the datadir) to the datadir diff --git a/mysql-test/suite/parts/t/reorganize_partition_innodb.test b/mysql-test/suite/parts/t/reorganize_partition_innodb.test index db73650c54b..77109c38c96 100644 --- a/mysql-test/suite/parts/t/reorganize_partition_innodb.test +++ b/mysql-test/suite/parts/t/reorganize_partition_innodb.test @@ -1,5 +1,6 @@ --source include/have_innodb.inc --source include/have_partition.inc +--source include/have_symlink.inc --echo # --echo # MDEV-15953 Alter InnoDB Partitioned Table Moves Files (which were originally not in the datadir) to the datadir diff --git a/mysql-test/suite/perfschema/r/digest_view.result b/mysql-test/suite/perfschema/r/digest_view.result index 43a8bdb1577..b2c908109e6 100644 --- a/mysql-test/suite/perfschema/r/digest_view.result +++ b/mysql-test/suite/perfschema/r/digest_view.result @@ -142,3 +142,125 @@ test SHOW WARNINGS 10 test TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1 DROP VIEW test.v1; DROP TABLE test.t1; +CREATE TABLE test.v1 (a int, b int); +INSERT INTO test.v1 VALUES (1, 100), (2, 200), (3, 300); +CREATE TABLE test.t1 (a int, b int); +INSERT INTO test.t1 VALUES (1, 100), (2, 200), (3, 300); +TRUNCATE TABLE performance_schema.events_statements_summary_by_digest; +EXPLAIN SELECT * from test.v1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE v1 ALL NULL NULL NULL NULL 3 +EXPLAIN SELECT * from test.v1 where a = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE v1 ALL NULL NULL NULL NULL 3 Using where +EXPLAIN SELECT * from test.v1 where b > 100; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE v1 ALL NULL NULL NULL NULL 3 Using where +EXPLAIN SELECT a, b from test.v1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE v1 ALL NULL NULL NULL NULL 3 +EXPLAIN SELECT b, a from test.v1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE v1 ALL NULL NULL NULL NULL 3 +SELECT * from test.v1; +a b +1 100 +2 200 +3 300 +SELECT * from test.v1 where a = 1; +a b +1 100 +SELECT * from test.v1 where b > 100; +a b +2 200 +3 300 +SELECT a, b from test.v1; +a b +1 100 +2 200 +3 300 +SELECT b, a from test.v1; +b a +100 1 +200 2 +300 3 +# +# DIGESTS SEEN ON TABLE +# +SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR +FROM performance_schema.events_statements_summary_by_digest +ORDER BY DIGEST_TEXT; +SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR +test 325a5266eeb07f609043730630a54f62 EXPLAIN SELECT * FROM `test` . `v1` 1 +test e860d6b0816b2b4854badd34fbbd6207 EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 1 +test d162188aba15f30fbad441adcd8d96af EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 1 +test b22e464e9cc580f0e67bfdd65f11402b EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 1 +test ccb1e6631108bba01e42d1755e32399d EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 1 +test ef05c6bd2efecfe1635b58ffc118cabd SELECT * FROM `test` . `v1` 1 +test 7755326c5700a225c95f470c1a909f21 SELECT * FROM `test` . `v1` WHERE `a` = ? 1 +test aa8bcfc412f56c41fbe6161b2a3a971c SELECT * FROM `test` . `v1` WHERE `b` > ? 1 +test 5ea7548b0f49730b2c419ff6a94a3f09 SELECT `a` , `b` FROM `test` . `v1` 1 +test 30756ef4e5a36c461ba9bdce676b9811 SELECT `b` , `a` FROM `test` . `v1` 1 +test 61e13f96828d862446f5e8ee1cade61d TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1 +DROP TABLE test.v1; +CREATE VIEW test.v1 AS SELECT * FROM test.t1; +EXPLAIN SELECT * from test.v1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 +EXPLAIN SELECT * from test.v1 where a = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where +EXPLAIN SELECT * from test.v1 where b > 100; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where +EXPLAIN SELECT a, b from test.v1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 +EXPLAIN SELECT b, a from test.v1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 +SELECT * from test.v1; +a b +1 100 +2 200 +3 300 +SELECT * from test.v1 where a = 1; +a b +1 100 +SELECT * from test.v1 where b > 100; +a b +2 200 +3 300 +SELECT a, b from test.v1; +a b +1 100 +2 200 +3 300 +SELECT b, a from test.v1; +b a +100 1 +200 2 +300 3 +# +# DIGESTS SEEN ON VIEW +# +SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR +FROM performance_schema.events_statements_summary_by_digest +ORDER BY DIGEST_TEXT; +SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR +test 04aae3c6f9b3d3394fbea32dd201320a CREATE VIEW `test` . `v1` AS SELECT * FROM `test` . `t1` 1 +test e551faf16ae3ffe7aeb6d923c8f97452 DROP TABLE `test` . `v1` 1 +test 325a5266eeb07f609043730630a54f62 EXPLAIN SELECT * FROM `test` . `v1` 2 +test e860d6b0816b2b4854badd34fbbd6207 EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 2 +test d162188aba15f30fbad441adcd8d96af EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 2 +test b22e464e9cc580f0e67bfdd65f11402b EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 2 +test ccb1e6631108bba01e42d1755e32399d EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 2 +test ef05c6bd2efecfe1635b58ffc118cabd SELECT * FROM `test` . `v1` 2 +test 7755326c5700a225c95f470c1a909f21 SELECT * FROM `test` . `v1` WHERE `a` = ? 2 +test aa8bcfc412f56c41fbe6161b2a3a971c SELECT * FROM `test` . `v1` WHERE `b` > ? 2 +test 9b3c3d8a2f8b2d9775f9d87d0932e5b5 SELECT SCHEMA_NAME , `DIGEST` , `DIGEST_TEXT` , `COUNT_STAR` FROM `performance_schema` . `events_statements_summary_by_digest` ORDER BY `DIGEST_TEXT` 1 +test 5ea7548b0f49730b2c419ff6a94a3f09 SELECT `a` , `b` FROM `test` . `v1` 2 +test 30756ef4e5a36c461ba9bdce676b9811 SELECT `b` , `a` FROM `test` . `v1` 2 +test 61e13f96828d862446f5e8ee1cade61d TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1 +DROP VIEW test.v1; +DROP TABLE test.t1; diff --git a/mysql-test/suite/perfschema/r/show_sanity.result b/mysql-test/suite/perfschema/r/show_sanity.result index 71bc92a2c2f..dc326dd7f64 100644 --- a/mysql-test/suite/perfschema/r/show_sanity.result +++ b/mysql-test/suite/perfschema/r/show_sanity.result @@ -414,6 +414,8 @@ SHOW_MODE SOURCE VARIABLE_NAME 5.6 I_S.SESSION_VARIABLES INNODB_STATS_INCLUDE_DELETE_MARKED 5.6 I_S.SESSION_VARIABLES KEYRING_OPERATIONS 5.6 I_S.SESSION_VARIABLES LOG_STATEMENTS_UNSAFE_FOR_BINLOG +5.6 I_S.SESSION_VARIABLES REPLICATION_OPTIMIZE_FOR_STATIC_PLUGIN_CONFIG +5.6 I_S.SESSION_VARIABLES REPLICATION_SENDER_OBSERVE_COMMIT_ONLY 5.6 I_S.SESSION_VARIABLES TLS_VERSION ================================================================================ @@ -442,6 +444,8 @@ SHOW_MODE SOURCE VARIABLE_NAME 5.6 I_S.SESSION_VARIABLES INNODB_STATS_INCLUDE_DELETE_MARKED 5.6 I_S.SESSION_VARIABLES KEYRING_OPERATIONS 5.6 I_S.SESSION_VARIABLES LOG_STATEMENTS_UNSAFE_FOR_BINLOG +5.6 I_S.SESSION_VARIABLES REPLICATION_OPTIMIZE_FOR_STATIC_PLUGIN_CONFIG +5.6 I_S.SESSION_VARIABLES REPLICATION_SENDER_OBSERVE_COMMIT_ONLY 5.6 I_S.SESSION_VARIABLES TLS_VERSION ================================================================================ diff --git a/mysql-test/suite/perfschema/t/digest_view.test b/mysql-test/suite/perfschema/t/digest_view.test index f718d7530e6..dd862aebd52 100644 --- a/mysql-test/suite/perfschema/t/digest_view.test +++ b/mysql-test/suite/perfschema/t/digest_view.test @@ -75,3 +75,79 @@ SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR DROP VIEW test.v1; DROP TABLE test.t1; +# ---------------------------------------------------- +# Tests for the performance schema statement Digests. +# ---------------------------------------------------- + +# Test case to show behavior of statements digest when +# using a view + +--source include/not_embedded.inc +--source include/have_perfschema.inc +--source include/no_protocol.inc + +CREATE TABLE test.v1 (a int, b int); +INSERT INTO test.v1 VALUES (1, 100), (2, 200), (3, 300); + +CREATE TABLE test.t1 (a int, b int); +INSERT INTO test.t1 VALUES (1, 100), (2, 200), (3, 300); + + +TRUNCATE TABLE performance_schema.events_statements_summary_by_digest; + +# +# test.v1 is a table. +# Every query here is different, and should have a different digest. +# + +EXPLAIN SELECT * from test.v1; +EXPLAIN SELECT * from test.v1 where a = 1; +EXPLAIN SELECT * from test.v1 where b > 100; +EXPLAIN SELECT a, b from test.v1; +EXPLAIN SELECT b, a from test.v1; + +SELECT * from test.v1; +SELECT * from test.v1 where a = 1; +SELECT * from test.v1 where b > 100; +SELECT a, b from test.v1; +SELECT b, a from test.v1; + +--echo # +--echo # DIGESTS SEEN ON TABLE +--echo # + +SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR + FROM performance_schema.events_statements_summary_by_digest + ORDER BY DIGEST_TEXT; + +DROP TABLE test.v1; +CREATE VIEW test.v1 AS SELECT * FROM test.t1; + +# +# test.v1 is now a view. +# the query digests should be unchanged. +# + +EXPLAIN SELECT * from test.v1; +EXPLAIN SELECT * from test.v1 where a = 1; +EXPLAIN SELECT * from test.v1 where b > 100; +EXPLAIN SELECT a, b from test.v1; +EXPLAIN SELECT b, a from test.v1; + +SELECT * from test.v1; +SELECT * from test.v1 where a = 1; +SELECT * from test.v1 where b > 100; +SELECT a, b from test.v1; +SELECT b, a from test.v1; + +--echo # +--echo # DIGESTS SEEN ON VIEW +--echo # + +SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR + FROM performance_schema.events_statements_summary_by_digest + ORDER BY DIGEST_TEXT; + +DROP VIEW test.v1; +DROP TABLE test.t1; + diff --git a/mysql-test/suite/plugins/r/locales.result b/mysql-test/suite/plugins/r/locales.result index 106bf22923c..2ea88493705 100644 --- a/mysql-test/suite/plugins/r/locales.result +++ b/mysql-test/suite/plugins/r/locales.result @@ -17,7 +17,7 @@ ID NAME DESCRIPTION MAX_MONTH_NAME_LENGTH MAX_DAY_NAME_LENGTH DECIMAL_POINT THOU 14 cs_CZ Czech - Czech Republic 8 7 , czech 15 da_DK Danish - Denmark 9 7 , . danish 16 de_AT German - Austria 9 10 , german -17 es_ES Spanish - Spain 10 9 , spanish +17 es_ES Spanish - Spain 10 9 , . spanish 18 et_EE Estonian - Estonia 9 9 , estonian 19 eu_ES Basque - Basque 9 10 , english 20 fi_FI Finnish - Finland 9 11 , english @@ -82,24 +82,24 @@ ID NAME DESCRIPTION MAX_MONTH_NAME_LENGTH MAX_DAY_NAME_LENGTH DECIMAL_POINT THOU 79 en_ZA English - South Africa 9 9 . , english 80 en_ZW English - Zimbabwe 9 9 . , english 81 es_AR Spanish - Argentina 10 9 , . spanish -82 es_BO Spanish - Bolivia 10 9 , spanish -83 es_CL Spanish - Chile 10 9 , spanish -84 es_CO Spanish - Columbia 10 9 , spanish -85 es_CR Spanish - Costa Rica 10 9 . spanish -86 es_DO Spanish - Dominican Republic 10 9 . spanish -87 es_EC Spanish - Ecuador 10 9 , spanish -88 es_GT Spanish - Guatemala 10 9 . spanish -89 es_HN Spanish - Honduras 10 9 . spanish -90 es_MX Spanish - Mexico 10 9 . spanish -91 es_NI Spanish - Nicaragua 10 9 . spanish -92 es_PA Spanish - Panama 10 9 . spanish -93 es_PE Spanish - Peru 10 9 . spanish -94 es_PR Spanish - Puerto Rico 10 9 . spanish -95 es_PY Spanish - Paraguay 10 9 , spanish -96 es_SV Spanish - El Salvador 10 9 . spanish +82 es_BO Spanish - Bolivia 10 9 , . spanish +83 es_CL Spanish - Chile 10 9 , . spanish +84 es_CO Spanish - Columbia 10 9 , . spanish +85 es_CR Spanish - Costa Rica 10 9 , spanish +86 es_DO Spanish - Dominican Republic 10 9 . , spanish +87 es_EC Spanish - Ecuador 10 9 , . spanish +88 es_GT Spanish - Guatemala 10 9 . , spanish +89 es_HN Spanish - Honduras 10 9 . , spanish +90 es_MX Spanish - Mexico 10 9 . , spanish +91 es_NI Spanish - Nicaragua 10 9 . , spanish +92 es_PA Spanish - Panama 10 9 . , spanish +93 es_PE Spanish - Peru 10 9 . , spanish +94 es_PR Spanish - Puerto Rico 10 9 . , spanish +95 es_PY Spanish - Paraguay 10 9 , . spanish +96 es_SV Spanish - El Salvador 10 9 . , spanish 97 es_US Spanish - United States 10 9 . , spanish -98 es_UY Spanish - Uruguay 10 9 , spanish -99 es_VE Spanish - Venezuela 10 9 , spanish +98 es_UY Spanish - Uruguay 10 9 , . spanish +99 es_VE Spanish - Venezuela 10 9 , . spanish 100 fr_BE French - Belgium 9 8 , . french 101 fr_CA French - Canada 9 8 , french 102 fr_CH French - Switzerland 9 8 , french diff --git a/mysql-test/suite/plugins/r/pam.result b/mysql-test/suite/plugins/r/pam.result index 40075245d0c..b8588916169 100644 --- a/mysql-test/suite/plugins/r/pam.result +++ b/mysql-test/suite/plugins/r/pam.result @@ -40,6 +40,35 @@ test_pam@localhost pam_test@% test # Now, the magic number! PIN: 9212 +# +# MDEV-26339 Account specifics to be handled before proxying +# +alter user pam_test account lock; +alter user pam_test require subject 'foobar'; +alter user pam_test password expire; +Now, the magic number! +PIN: 9212 +select user(), current_user(), database(); +user() current_user() database() +test_pam@localhost pam_test@% test +alter user pam_test account unlock; +alter user pam_test require none; +alter user pam_test identified by ''; +show create user pam_test; +CREATE USER for pam_test@% +CREATE USER `pam_test`@`%` +alter user test_pam account lock; +Now, the magic number! +PIN: 9212 +alter user test_pam account unlock; +alter user test_pam require subject 'foobar'; +Now, the magic number! +PIN: 9212 +alter user test_pam require none; +alter user test_pam password expire; +Now, the magic number! +PIN: 9212 +select user(), current_user(), database(); drop user test_pam; drop user pam_test; create user PAM_TEST identified via pam using 'mariadb_mtr'; @@ -62,4 +91,21 @@ select user(), current_user(), database(); user() current_user() database() PAM_TEST@localhost PAM_TEST@% test drop user PAM_TEST; +# +# MDEV-27341 Use SET PASSWORD to change PAM service +# +create user pam_test identified via pam using 'mariadb_mtr'; +Challenge input first. +Enter: ************************* +Now, the magic number! +PIN: 9225 +select user(), current_user(), database(); +user() current_user() database() +pam_test@localhost pam_test@% test +set password='foo'; +ERROR HY000: SET PASSWORD is ignored for users authenticating via pam plugin +show create user; +CREATE USER for pam_test@% +CREATE USER `pam_test`@`%` IDENTIFIED VIA pam USING 'mariadb_mtr' +drop user pam_test; uninstall plugin pam; diff --git a/mysql-test/suite/plugins/r/qc_info.result b/mysql-test/suite/plugins/r/qc_info.result index 41073359e93..afab7671b5c 100644 --- a/mysql-test/suite/plugins/r/qc_info.result +++ b/mysql-test/suite/plugins/r/qc_info.result @@ -27,9 +27,9 @@ set time_zone=@new_time_zone,default_week_format=4,character_set_client='binary' select * from t1; set time_zone= @time_zone, default_week_format= @default_week_format, character_set_client= @character_set_client,character_set_results= @character_set_results, sql_mode= @sql_mode, div_precision_increment= @div_precision_increment, lc_time_names= @lc_time_names, autocommit= @autocommit, group_concat_max_len= @group_concat_max_len, max_sort_length= @max_sort_length; select * from information_schema.query_cache_info; -STATEMENT_SCHEMA STATEMENT_TEXT RESULT_BLOCKS_COUNT RESULT_BLOCKS_SIZE RESULT_BLOCKS_SIZE_USED LIMIT MAX_SORT_LENGTH GROUP_CONCAT_MAX_LENGTH CHARACTER_SET_CLIENT CHARACTER_SET_RESULT COLLATION TIMEZONE DEFAULT_WEEK_FORMAT DIV_PRECISION_INCREMENT SQL_MODE LC_TIME_NAMES CLIENT_LONG_FLAG CLIENT_PROTOCOL_41 PROTOCOL_TYPE MORE_RESULTS_EXISTS IN_TRANS AUTOCOMMIT PACKET_NUMBER HITS -test select * from t1 1 512 # -1 1011 513 binary utf32 utf32_bin Europe/Moscow 4 7 STRICT_ALL_TABLES ar_SD 1 1 # 0 0 0 # 0 -test select * from t1 1 512 # -1 1024 1048576 latin1 latin1 latin1_swedish_ci SYSTEM 0 4 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION en_US 1 1 # 0 0 1 # 0 +STATEMENT_SCHEMA STATEMENT_TEXT RESULT_BLOCKS_COUNT RESULT_BLOCKS_SIZE RESULT_BLOCKS_SIZE_USED LIMIT MAX_SORT_LENGTH GROUP_CONCAT_MAX_LENGTH CHARACTER_SET_CLIENT CHARACTER_SET_RESULT COLLATION TIMEZONE DEFAULT_WEEK_FORMAT DIV_PRECISION_INCREMENT SQL_MODE LC_TIME_NAMES CLIENT_LONG_FLAG CLIENT_PROTOCOL_41 CLIENT_EXTENDED_METADATA PROTOCOL_TYPE MORE_RESULTS_EXISTS IN_TRANS AUTOCOMMIT PACKET_NUMBER HITS +test select * from t1 1 512 # -1 1011 513 binary utf32 utf32_bin Europe/Moscow 4 7 STRICT_ALL_TABLES ar_SD 1 1 1 # 0 0 0 # 0 +test select * from t1 1 512 # -1 1024 1048576 latin1 latin1 latin1_swedish_ci SYSTEM 0 4 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION en_US 1 1 1 # 0 0 1 # 0 reset query cache; select * from t1; a @@ -49,7 +49,7 @@ select statement_schema, statement_text, result_blocks_count, result_blocks_size statement_schema statement_text result_blocks_count result_blocks_size set global query_cache_size = 0; select * from information_schema.query_cache_info; -STATEMENT_SCHEMA STATEMENT_TEXT RESULT_BLOCKS_COUNT RESULT_BLOCKS_SIZE RESULT_BLOCKS_SIZE_USED LIMIT MAX_SORT_LENGTH GROUP_CONCAT_MAX_LENGTH CHARACTER_SET_CLIENT CHARACTER_SET_RESULT COLLATION TIMEZONE DEFAULT_WEEK_FORMAT DIV_PRECISION_INCREMENT SQL_MODE LC_TIME_NAMES CLIENT_LONG_FLAG CLIENT_PROTOCOL_41 PROTOCOL_TYPE MORE_RESULTS_EXISTS IN_TRANS AUTOCOMMIT PACKET_NUMBER HITS +STATEMENT_SCHEMA STATEMENT_TEXT RESULT_BLOCKS_COUNT RESULT_BLOCKS_SIZE RESULT_BLOCKS_SIZE_USED LIMIT MAX_SORT_LENGTH GROUP_CONCAT_MAX_LENGTH CHARACTER_SET_CLIENT CHARACTER_SET_RESULT COLLATION TIMEZONE DEFAULT_WEEK_FORMAT DIV_PRECISION_INCREMENT SQL_MODE LC_TIME_NAMES CLIENT_LONG_FLAG CLIENT_PROTOCOL_41 CLIENT_EXTENDED_METADATA PROTOCOL_TYPE MORE_RESULTS_EXISTS IN_TRANS AUTOCOMMIT PACKET_NUMBER HITS set global query_cache_size= default; set global query_cache_type=default; show query_cache_info; diff --git a/mysql-test/suite/plugins/r/qc_info_priv.result b/mysql-test/suite/plugins/r/qc_info_priv.result index 78ea78a33b8..9aa15885563 100644 --- a/mysql-test/suite/plugins/r/qc_info_priv.result +++ b/mysql-test/suite/plugins/r/qc_info_priv.result @@ -27,9 +27,9 @@ set time_zone=@new_time_zone,default_week_format=4,character_set_client='binary' select * from t1; set time_zone= @time_zone, default_week_format= @default_week_format, character_set_client= @character_set_client,character_set_results= @character_set_results, sql_mode= @sql_mode, div_precision_increment= @div_precision_increment, lc_time_names= @lc_time_names, autocommit= @autocommit, group_concat_max_len= @group_concat_max_len, max_sort_length= @max_sort_length; select * from information_schema.query_cache_info; -STATEMENT_SCHEMA STATEMENT_TEXT RESULT_BLOCKS_COUNT RESULT_BLOCKS_SIZE RESULT_BLOCKS_SIZE_USED LIMIT MAX_SORT_LENGTH GROUP_CONCAT_MAX_LENGTH CHARACTER_SET_CLIENT CHARACTER_SET_RESULT COLLATION TIMEZONE DEFAULT_WEEK_FORMAT DIV_PRECISION_INCREMENT SQL_MODE LC_TIME_NAMES CLIENT_LONG_FLAG CLIENT_PROTOCOL_41 PROTOCOL_TYPE MORE_RESULTS_EXISTS IN_TRANS AUTOCOMMIT PACKET_NUMBER HITS -test select * from t1 1 512 # -1 1011 513 binary utf32 utf32_bin Europe/Moscow 4 7 STRICT_ALL_TABLES ar_SD 1 1 # 0 0 0 # 0 -test select * from t1 1 512 # -1 1024 1048576 latin1 latin1 latin1_swedish_ci SYSTEM 0 4 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION en_US 1 1 # 0 0 1 # 0 +STATEMENT_SCHEMA STATEMENT_TEXT RESULT_BLOCKS_COUNT RESULT_BLOCKS_SIZE RESULT_BLOCKS_SIZE_USED LIMIT MAX_SORT_LENGTH GROUP_CONCAT_MAX_LENGTH CHARACTER_SET_CLIENT CHARACTER_SET_RESULT COLLATION TIMEZONE DEFAULT_WEEK_FORMAT DIV_PRECISION_INCREMENT SQL_MODE LC_TIME_NAMES CLIENT_LONG_FLAG CLIENT_PROTOCOL_41 CLIENT_EXTENDED_METADATA PROTOCOL_TYPE MORE_RESULTS_EXISTS IN_TRANS AUTOCOMMIT PACKET_NUMBER HITS +test select * from t1 1 512 # -1 1011 513 binary utf32 utf32_bin Europe/Moscow 4 7 STRICT_ALL_TABLES ar_SD 1 1 1 # 0 0 0 # 0 +test select * from t1 1 512 # -1 1024 1048576 latin1 latin1 latin1_swedish_ci SYSTEM 0 4 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION en_US 1 1 1 # 0 0 1 # 0 create user mysqltest; connect conn1,localhost,mysqltest,,; connection conn1; diff --git a/mysql-test/suite/plugins/t/pam.test b/mysql-test/suite/plugins/t/pam.test index 2611f25ee63..dbe108d1efa 100644 --- a/mysql-test/suite/plugins/t/pam.test +++ b/mysql-test/suite/plugins/t/pam.test @@ -45,7 +45,6 @@ EOF --echo # --echo # athentication is successful --echo # ---error 0 --exec $MYSQL_TEST -u test_pam -pgoodpassword < $MYSQLTEST_VARDIR/tmp/pam_good2.txt --echo # @@ -54,6 +53,36 @@ EOF --error 1 --exec $MYSQL_TEST -u test_pam -pbadpassword < $MYSQLTEST_VARDIR/tmp/pam_good2.txt +--echo # +--echo # MDEV-26339 Account specifics to be handled before proxying +--echo # + +# one can connect if the proxy account is locked +alter user pam_test account lock; +alter user pam_test require subject 'foobar'; +alter user pam_test password expire; +--error 0 +--exec $MYSQL_TEST -u test_pam -pgoodpassword < $MYSQLTEST_VARDIR/tmp/pam_good2.txt +alter user pam_test account unlock; +alter user pam_test require none; +alter user pam_test identified by ''; +show create user pam_test; + +#one cannot connect if the proxied account is locked +alter user test_pam account lock; +--error 1 +--exec $MYSQL_TEST -u test_pam -pgoodpassword < $MYSQLTEST_VARDIR/tmp/pam_good2.txt +alter user test_pam account unlock; + +alter user test_pam require subject 'foobar'; +--error 1 +--exec $MYSQL_TEST -u test_pam -pgoodpassword < $MYSQLTEST_VARDIR/tmp/pam_good2.txt +alter user test_pam require none; + +alter user test_pam password expire; +--error 1 +--exec $MYSQL_TEST -u test_pam -pgoodpassword < $MYSQLTEST_VARDIR/tmp/pam_good2.txt + drop user test_pam; drop user pam_test; create user PAM_TEST identified via pam using 'mariadb_mtr'; @@ -76,6 +105,22 @@ set global pam_winbind_workaround=1; --remove_file $MYSQLTEST_VARDIR/tmp/pam_ugly.txt drop user PAM_TEST; +--echo # +--echo # MDEV-27341 Use SET PASSWORD to change PAM service +--echo # +create user pam_test identified via pam using 'mariadb_mtr'; +--write_file $MYSQLTEST_VARDIR/tmp/setpwd.txt +not very secret challenge +9225 +select user(), current_user(), database(); +error ER_SET_PASSWORD_AUTH_PLUGIN; +set password='foo'; +show create user; +EOF +--exec $MYSQL_TEST -u pam_test < $MYSQLTEST_VARDIR/tmp/setpwd.txt +--remove_file $MYSQLTEST_VARDIR/tmp/setpwd.txt +drop user pam_test; + let $count_sessions= 1; --source include/wait_until_count_sessions.inc uninstall plugin pam; diff --git a/mysql-test/suite/plugins/t/qc_info_init.inc b/mysql-test/suite/plugins/t/qc_info_init.inc index c3f700f08d0..ad93e5c1547 100644 --- a/mysql-test/suite/plugins/t/qc_info_init.inc +++ b/mysql-test/suite/plugins/t/qc_info_init.inc @@ -30,5 +30,5 @@ select * from t1; set time_zone= @time_zone, default_week_format= @default_week_format, character_set_client= @character_set_client,character_set_results= @character_set_results, sql_mode= @sql_mode, div_precision_increment= @div_precision_increment, lc_time_names= @lc_time_names, autocommit= @autocommit, group_concat_max_len= @group_concat_max_len, max_sort_length= @max_sort_length; --sorted_result ---replace_column 5 # 19 # 23 # +--replace_column 5 # 20 # 24 # select * from information_schema.query_cache_info; diff --git a/mysql-test/suite/rpl/r/rpl_empty_string_is_null.result b/mysql-test/suite/rpl/r/rpl_empty_string_is_null.result new file mode 100644 index 00000000000..15b75bccb5d --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_empty_string_is_null.result @@ -0,0 +1,16 @@ +include/master-slave.inc +[connection master] +# +# MDEV-18918 SQL mode EMPTY_STRING_IS_NULL breaks RBR upon CREATE TABLE .. SELECT +# +SET SQL_MODE= 'EMPTY_STRING_IS_NULL'; +CREATE TABLE t1 AS SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE 1 = 0; +connection slave; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `TABLE_NAME` varchar(64) CHARACTER SET utf8mb3 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +connection master; +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_seconds_behind_master_spike.result b/mysql-test/suite/rpl/r/rpl_seconds_behind_master_spike.result new file mode 100644 index 00000000000..be18f95c2c0 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_seconds_behind_master_spike.result @@ -0,0 +1,40 @@ +include/master-slave.inc +[connection master] +connection slave; +include/stop_slave.inc +SET @save_dbug= @@GLOBAL.debug_dbug; +SET @@global.debug_dbug="+d,pause_sql_thread_on_fde"; +include/start_slave.inc +# Future events must be logged at least 2 seconds after +# the slave starts +connection master; +# Write events to ensure slave will be consistent with master +create table t1 (a int); +insert into t1 values (1); +# Flush logs on master forces slave to generate a Format description +# event in its relay log +flush logs; +connection slave; +# Ignore FDEs that happen before the CREATE/INSERT commands +SET DEBUG_SYNC='now WAIT_FOR paused_on_fde'; +SET DEBUG_SYNC='now SIGNAL sql_thread_continue'; +SET DEBUG_SYNC='now WAIT_FOR paused_on_fde'; +SET DEBUG_SYNC='now SIGNAL sql_thread_continue'; +# On the next FDE, the slave should have the master CREATE/INSERT events +SET DEBUG_SYNC='now WAIT_FOR paused_on_fde'; +select count(*)=1 from t1; +count(*)=1 +1 +# The relay log FDE has been processed - here we check to ensure it was +# not considered in Seconds_Behind_Master calculation +connection slave1; +# Safely resume slave SQL thread +SET @@global.debug_dbug=''; +SET DEBUG_SYNC='pause_sql_thread_on_fde CLEAR'; +SET DEBUG_SYNC='now SIGNAL sql_thread_continue'; +SET DEBUG_SYNC='RESET'; +connection master; +DROP TABLE t1; +connection slave; +SET @@global.debug_dbug=$save_dbug; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result index 650d9e5c326..639b107abd6 100644 --- a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result +++ b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result @@ -26,7 +26,8 @@ connection slave; include/rpl_reset.inc connection master; CREATE TABLE t1 (a int) engine=innodb; -CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) ); +CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) ) +engine=innodb; CREATE TABLE t3 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) ); CREATE TRIGGER tr1 AFTER DELETE ON t2 FOR EACH ROW INSERT INTO t3 () VALUES (); CREATE TEMPORARY TABLE t1_tmp (i1 int); @@ -59,6 +60,7 @@ slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) engine=innodb slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) ) +engine=innodb slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; CREATE TABLE t3 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) ) slave-bin.000001 # Gtid # # GTID #-#-# @@ -74,7 +76,7 @@ slave-bin.000001 # Gtid # # BEGIN GTID #-#-# slave-bin.000001 # Annotate_rows # # INSERT INTO t2 (i1) select * from t1 slave-bin.000001 # Table_map # # table_id: # (test.t2) slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F -slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Xid # # COMMIT /* XID */ slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t1_tmp` /* generated by server */ slave-bin.000001 # Gtid # # GTID #-#-# diff --git a/mysql-test/suite/rpl/t/rpl_empty_string_is_null.test b/mysql-test/suite/rpl/t/rpl_empty_string_is_null.test new file mode 100644 index 00000000000..a0fecbb54ac --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_empty_string_is_null.test @@ -0,0 +1,15 @@ +--source include/master-slave.inc +--source include/have_binlog_format_row.inc + +--echo # +--echo # MDEV-18918 SQL mode EMPTY_STRING_IS_NULL breaks RBR upon CREATE TABLE .. SELECT +--echo # + +SET SQL_MODE= 'EMPTY_STRING_IS_NULL'; +CREATE TABLE t1 AS SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE 1 = 0; +--sync_slave_with_master +SHOW CREATE TABLE t1; +--connection master +DROP TABLE t1; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_seconds_behind_master_spike.test b/mysql-test/suite/rpl/t/rpl_seconds_behind_master_spike.test new file mode 100644 index 00000000000..029625a09ad --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_seconds_behind_master_spike.test @@ -0,0 +1,88 @@ +# +# Purpose: +# This test validates that a slave's relay log format description event is +# not used to calculate the Seconds_Behind_Master time displayed by +# SHOW SLAVE STATUS. +# +# Methodology: +# Ensure that a slave's reported Seconds_Behind_Master does not point before +# a time in which we can prove that it has progressed beyond. The slave's +# relay log events are created using the timestamp at which the IO thread was +# created. Therefore, after starting the slave's IO thread, we sleep so any +# proceeding events are forced to have later timestamps. After sleeping, we run +# MDL statements on the master and save the time at which they are binlogged. +# Once the slave executes these MDL commands, we have proven that the slave has +# caught up to this saved timestamp. At this point, if the value of +# Seconds_Behind_Master points before the time in which the MDL events were +# logged, it is invalid. +# +# References: +# MDEV-16091: Seconds_Behind_Master spikes to millions of seconds +# +--source include/have_debug.inc +--source include/have_innodb.inc +--source include/master-slave.inc + +--connection slave +--source include/stop_slave.inc +SET @save_dbug= @@GLOBAL.debug_dbug; +SET @@global.debug_dbug="+d,pause_sql_thread_on_fde"; +--source include/start_slave.inc + +--let $sleep_time=2 +--echo # Future events must be logged at least $sleep_time seconds after +--echo # the slave starts +--sleep $sleep_time + +--connection master +--echo # Write events to ensure slave will be consistent with master +create table t1 (a int); +insert into t1 values (1); +--let $t_master_events_logged= `SELECT UNIX_TIMESTAMP()` + +--echo # Flush logs on master forces slave to generate a Format description +--echo # event in its relay log +flush logs; + +--connection slave +--echo # Ignore FDEs that happen before the CREATE/INSERT commands +SET DEBUG_SYNC='now WAIT_FOR paused_on_fde'; +SET DEBUG_SYNC='now SIGNAL sql_thread_continue'; +SET DEBUG_SYNC='now WAIT_FOR paused_on_fde'; +SET DEBUG_SYNC='now SIGNAL sql_thread_continue'; + +--echo # On the next FDE, the slave should have the master CREATE/INSERT events +SET DEBUG_SYNC='now WAIT_FOR paused_on_fde'; +select count(*)=1 from t1; + +--echo # The relay log FDE has been processed - here we check to ensure it was +--echo # not considered in Seconds_Behind_Master calculation +--connection slave1 +let $sbm= query_get_value(SHOW SLAVE STATUS, Seconds_Behind_Master, 1); +--let $t_now= `SELECT UNIX_TIMESTAMP()` + +# Ensure Seconds_Behind_Master does not point beyond when we have proven the +# events we have proven to have executed. The extra second is needed as a +# buffer because the recorded times are not exact with when the events were +# recorded on the master. +if(`select $sbm > $t_now - $t_master_events_logged + 1`) +{ + die "A relay log event was incorrectly used to set Seconds_Behind_Master"; +} + +--echo # Safely resume slave SQL thread +SET @@global.debug_dbug=''; +SET DEBUG_SYNC='pause_sql_thread_on_fde CLEAR'; +SET DEBUG_SYNC='now SIGNAL sql_thread_continue'; + +# Reset last sql_thread_continue signal +SET DEBUG_SYNC='RESET'; + +# Cleanup +--connection master +DROP TABLE t1; + +--connection slave +SET @@global.debug_dbug=$save_dbug; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test b/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test index ca7be98e50c..766acb14c3d 100644 --- a/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test +++ b/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test @@ -91,7 +91,8 @@ sync_slave_with_master; # action: setup environment CREATE TABLE t1 (a int) engine=innodb; -CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) ); +CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) ) + engine=innodb; CREATE TABLE t3 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) ); CREATE TRIGGER tr1 AFTER DELETE ON t2 FOR EACH ROW INSERT INTO t3 () VALUES (); diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index 177a27925e6..3795c9ab6a6 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -195,7 +195,7 @@ DEFAULT_VALUE 134217728 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the memory buffer InnoDB uses to cache data and indexes of its tables. -NUMERIC_MIN_VALUE 5242880 +NUMERIC_MIN_VALUE 2097152 NUMERIC_MAX_VALUE 9223372036854775807 NUMERIC_BLOCK_SIZE 1048576 ENUM_VALUE_LIST NULL @@ -1379,10 +1379,10 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_READ_ONLY_COMPRESSED SESSION_VALUE NULL -DEFAULT_VALUE ON +DEFAULT_VALUE OFF VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BOOLEAN -VARIABLE_COMMENT Make ROW_FORMAT=COMPRESSED tables read-only (ON by default) +VARIABLE_COMMENT Make ROW_FORMAT=COMPRESSED tables read-only NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff index 6da30c14c7e..a6bf0fb606a 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff @@ -1,5 +1,3 @@ ---- ../../mysql-test/suite/sys_vars/r/sysvars_server_embedded.result 2021-05-11 19:44:57.048781628 +0530 -+++ ../../mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.reject 2021-05-12 15:26:31.616449925 +0530 @@ -34,7 +34,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME ARIA_BLOCK_SIZE diff --git a/mysql-test/suite/sysschema/r/v_innodb_lock_waits.result b/mysql-test/suite/sysschema/r/v_innodb_lock_waits.result index 29cf21d50a3..7e44c334283 100644 --- a/mysql-test/suite/sysschema/r/v_innodb_lock_waits.result +++ b/mysql-test/suite/sysschema/r/v_innodb_lock_waits.result @@ -3,27 +3,27 @@ Field Type Null Key Default Extra wait_started datetime YES NULL wait_age time /* mariadb-5.3 */ YES NULL wait_age_secs bigint(21) YES NULL -locked_table varchar(1024) NO +locked_table varchar(1024) NO NULL locked_index varchar(1024) YES NULL locked_type enum('RECORD','TABLE') NO NULL -waiting_trx_id bigint(21) unsigned NO 0 -waiting_trx_started datetime NO 0000-00-00 00:00:00 +waiting_trx_id bigint(21) unsigned NO NULL +waiting_trx_started datetime NO NULL waiting_trx_age time /* mariadb-5.3 */ YES NULL -waiting_trx_rows_locked bigint(21) unsigned NO 0 -waiting_trx_rows_modified bigint(21) unsigned NO 0 -waiting_pid bigint(21) unsigned NO 0 +waiting_trx_rows_locked bigint(21) unsigned NO NULL +waiting_trx_rows_modified bigint(21) unsigned NO NULL +waiting_pid bigint(21) unsigned NO NULL waiting_query longtext YES NULL -waiting_lock_id varchar(81) NO +waiting_lock_id varchar(81) NO NULL waiting_lock_mode enum('S','S,GAP','X','X,GAP','IS','IS,GAP','IX','IX,GAP','AUTO_INC') NO NULL -blocking_trx_id bigint(21) unsigned NO 0 -blocking_pid bigint(21) unsigned NO 0 +blocking_trx_id bigint(21) unsigned NO NULL +blocking_pid bigint(21) unsigned NO NULL blocking_query longtext YES NULL -blocking_lock_id varchar(81) NO +blocking_lock_id varchar(81) NO NULL blocking_lock_mode enum('S','S,GAP','X','X,GAP','IS','IS,GAP','IX','IX,GAP','AUTO_INC') NO NULL -blocking_trx_started datetime NO 0000-00-00 00:00:00 +blocking_trx_started datetime NO NULL blocking_trx_age time /* mariadb-5.3 */ YES NULL -blocking_trx_rows_locked bigint(21) unsigned NO 0 -blocking_trx_rows_modified bigint(21) unsigned NO 0 +blocking_trx_rows_locked bigint(21) unsigned NO NULL +blocking_trx_rows_modified bigint(21) unsigned NO NULL sql_kill_blocking_query varchar(32) YES NULL sql_kill_blocking_connection varchar(26) YES NULL SELECT * FROM sys.innodb_lock_waits; @@ -32,27 +32,27 @@ Field Type Null Key Default Extra wait_started datetime YES NULL wait_age time /* mariadb-5.3 */ YES NULL wait_age_secs bigint(21) YES NULL -locked_table varchar(1024) NO +locked_table varchar(1024) NO NULL locked_index varchar(1024) YES NULL locked_type enum('RECORD','TABLE') NO NULL -waiting_trx_id bigint(21) unsigned NO 0 -waiting_trx_started datetime NO 0000-00-00 00:00:00 +waiting_trx_id bigint(21) unsigned NO NULL +waiting_trx_started datetime NO NULL waiting_trx_age time /* mariadb-5.3 */ YES NULL -waiting_trx_rows_locked bigint(21) unsigned NO 0 -waiting_trx_rows_modified bigint(21) unsigned NO 0 -waiting_pid bigint(21) unsigned NO 0 +waiting_trx_rows_locked bigint(21) unsigned NO NULL +waiting_trx_rows_modified bigint(21) unsigned NO NULL +waiting_pid bigint(21) unsigned NO NULL waiting_query varchar(1024) YES NULL -waiting_lock_id varchar(81) NO +waiting_lock_id varchar(81) NO NULL waiting_lock_mode enum('S','S,GAP','X','X,GAP','IS','IS,GAP','IX','IX,GAP','AUTO_INC') NO NULL -blocking_trx_id bigint(21) unsigned NO 0 -blocking_pid bigint(21) unsigned NO 0 +blocking_trx_id bigint(21) unsigned NO NULL +blocking_pid bigint(21) unsigned NO NULL blocking_query varchar(1024) YES NULL -blocking_lock_id varchar(81) NO +blocking_lock_id varchar(81) NO NULL blocking_lock_mode enum('S','S,GAP','X','X,GAP','IS','IS,GAP','IX','IX,GAP','AUTO_INC') NO NULL -blocking_trx_started datetime NO 0000-00-00 00:00:00 +blocking_trx_started datetime NO NULL blocking_trx_age time /* mariadb-5.3 */ YES NULL -blocking_trx_rows_locked bigint(21) unsigned NO 0 -blocking_trx_rows_modified bigint(21) unsigned NO 0 +blocking_trx_rows_locked bigint(21) unsigned NO NULL +blocking_trx_rows_modified bigint(21) unsigned NO NULL sql_kill_blocking_query varchar(32) YES NULL sql_kill_blocking_connection varchar(26) YES NULL SELECT * FROM sys.x$innodb_lock_waits; diff --git a/mysql-test/suite/sysschema/r/v_schema_auto_increment_columns.result b/mysql-test/suite/sysschema/r/v_schema_auto_increment_columns.result index 5eb259d3e8d..ef2ad76b600 100644 --- a/mysql-test/suite/sysschema/r/v_schema_auto_increment_columns.result +++ b/mysql-test/suite/sysschema/r/v_schema_auto_increment_columns.result @@ -1,10 +1,10 @@ DESC sys.schema_auto_increment_columns; Field Type Null Key Default Extra -table_schema varchar(64) NO -table_name varchar(64) NO -column_name varchar(64) NO -data_type varchar(64) NO -column_type longtext NO +table_schema varchar(64) NO NULL +table_name varchar(64) NO NULL +column_name varchar(64) NO NULL +data_type varchar(64) NO NULL +column_type longtext NO NULL is_signed int(1) NO 0 is_unsigned int(1) NO 0 max_value bigint(21) unsigned YES NULL diff --git a/mysql-test/suite/sysschema/r/v_schema_redundant_indexes.result b/mysql-test/suite/sysschema/r/v_schema_redundant_indexes.result index 10c04ffb69c..2199c959cd0 100644 --- a/mysql-test/suite/sysschema/r/v_schema_redundant_indexes.result +++ b/mysql-test/suite/sysschema/r/v_schema_redundant_indexes.result @@ -1,11 +1,11 @@ DESC sys.schema_redundant_indexes; Field Type Null Key Default Extra -table_schema varchar(64) NO -table_name varchar(64) NO -redundant_index_name varchar(64) NO +table_schema varchar(64) NO NULL +table_name varchar(64) NO NULL +redundant_index_name varchar(64) NO NULL redundant_index_columns mediumtext YES NULL redundant_index_non_unique bigint(1) YES NULL -dominant_index_name varchar(64) NO +dominant_index_name varchar(64) NO NULL dominant_index_columns mediumtext YES NULL dominant_index_non_unique bigint(1) YES NULL subpart_exists int(1) YES NULL @@ -13,9 +13,9 @@ sql_drop_index varchar(223) YES NULL SELECT * FROM sys.schema_redundant_indexes; DESC sys.x$schema_flattened_keys; Field Type Null Key Default Extra -table_schema varchar(64) NO -table_name varchar(64) NO -index_name varchar(64) NO +table_schema varchar(64) NO NULL +table_name varchar(64) NO NULL +index_name varchar(64) NO NULL non_unique bigint(1) YES NULL subpart_exists bigint(1) YES NULL index_columns mediumtext YES NULL diff --git a/mysql-test/suite/vcol/r/not_supported.result b/mysql-test/suite/vcol/r/not_supported.result index c804cf220d2..d8703f755da 100644 --- a/mysql-test/suite/vcol/r/not_supported.result +++ b/mysql-test/suite/vcol/r/not_supported.result @@ -34,3 +34,11 @@ select * from t8; a b v 1234567890 2 2009-02-14 00:31:30 drop table t1, t3_ok, t8; +# +# Bug#33141966 - INCONSISTENT BEHAVIOR IF A COLUMN OF TYPE SERIAL IS SET AS GENERATED +# +create table t1 (a int, b serial as (a+1)); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'as (a+1))' at line 1 +# +# End of 10.2 tests +# diff --git a/mysql-test/suite/vcol/t/not_supported.test b/mysql-test/suite/vcol/t/not_supported.test index 1ea7970523a..2b5baf4ff4b 100644 --- a/mysql-test/suite/vcol/t/not_supported.test +++ b/mysql-test/suite/vcol/t/not_supported.test @@ -39,3 +39,13 @@ select * from t1; select * from t8; drop table t1, t3_ok, t8; + +--echo # +--echo # Bug#33141966 - INCONSISTENT BEHAVIOR IF A COLUMN OF TYPE SERIAL IS SET AS GENERATED +--echo # +--error ER_PARSE_ERROR +create table t1 (a int, b serial as (a+1)); + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/suite/versioning/r/create.result b/mysql-test/suite/versioning/r/create.result index cd0551abf98..caed619cbf5 100644 --- a/mysql-test/suite/versioning/r/create.result +++ b/mysql-test/suite/versioning/r/create.result @@ -631,8 +631,32 @@ Table Create Table t1 CREATE TABLE `t1` ( `x` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING, `y` int(11) DEFAULT NULL, - `row_start` timestamp(6) GENERATED ALWAYS AS ROW START WITHOUT SYSTEM VERSIONING, - `row_end` timestamp(6) GENERATED ALWAYS AS ROW END WITHOUT SYSTEM VERSIONING, + `row_start` timestamp(6) GENERATED ALWAYS AS ROW START, + `row_end` timestamp(6) GENERATED ALWAYS AS ROW END, PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`) ) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING drop table t1; +# +# MDEV-27452 TIMESTAMP(0) system field is allowed for certain creation of system-versioned table +# +create or replace table t ( +a int, +s timestamp as row start, +e timestamp as row end, +period for system_time (s, e)) +with system versioning; +ERROR HY000: `s` must be of type TIMESTAMP(6) for system-versioned table `t` +create or replace table t ( +a int with system versioning, +s timestamp as row start, +e timestamp as row end, +period for system_time (s, e)); +ERROR HY000: `s` must be of type TIMESTAMP(6) for system-versioned table `t` +create or replace table t ( +a int with system versioning, +b int with system versioning, +s timestamp(6) as row start, +e timestamp(6) as row end, +period for system_time (s, e)); +insert into t () values (),(); +drop table t; diff --git a/mysql-test/suite/versioning/r/truncate_privilege.result b/mysql-test/suite/versioning/r/not_embedded.result index e2b48c494be..f17ab18349c 100644 --- a/mysql-test/suite/versioning/r/truncate_privilege.result +++ b/mysql-test/suite/versioning/r/not_embedded.result @@ -1,3 +1,39 @@ +# +# SYSTEM_VERSIONING_ASOF sysvar +# +create table t (a int) with system versioning; +set @before= UNIX_TIMESTAMP(now(6)); +insert into t values (1); +set @after= UNIX_TIMESTAMP(now(6)); +update t set a= 2; +set global system_versioning_asof= FROM_UNIXTIME(@after); +set system_versioning_asof= FROM_UNIXTIME(@after); +select * from t as nonempty; +a +1 +connect subcon,127.0.0.1,root,,,$SERVER_MYPORT_1; +connection subcon; +select * from t as nonempty; +a +1 +disconnect subcon; +connection default; +set global system_versioning_asof= FROM_UNIXTIME(@before); +select * from t as nonempty; +a +1 +connect subcon,127.0.0.1,root,,,$SERVER_MYPORT_1; +connection subcon; +select * from t as empty; +a +disconnect subcon; +connection default; +drop table t; +set global system_versioning_asof= DEFAULT; +set system_versioning_asof= DEFAULT; +# +# DELETE HISTORY and privileges +# connect root,localhost,root,,test; connection root; create database mysqltest; @@ -31,3 +67,6 @@ GRANT DELETE HISTORY ON `mysqltest`.* TO `mysqltest_1`@`localhost` GRANT DELETE HISTORY ON `mysqltest`.`t` TO `mysqltest_1`@`localhost` drop user mysqltest_1@localhost; drop database mysqltest; +disconnect user1; +disconnect root; +connection default; diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result index 210b194d4e9..d25227a4ce7 100644 --- a/mysql-test/suite/versioning/r/partition.result +++ b/mysql-test/suite/versioning/r/partition.result @@ -914,6 +914,18 @@ t1 CREATE TABLE `t1` ( PARTITION `ver_pn` CURRENT ENGINE = DEFAULT_ENGINE) set timestamp= default; # +# MDEV-18794 Assertion `!m_innodb' failed in ha_partition::cmp_ref upon SELECT from partitioned table +# +create or replace table t1 (pk int auto_increment, i int, c char(1), primary key (pk), key(i)) +engine=innodb with system versioning partition by key() partitions 2; +insert into t1 (i, c) values (1, 'a'), (2, 'b'), (null, 'c'), (null, 'b'); +alter table t1 drop system versioning; +replace into t1 select * from t1; +select * from t1 where i > 0 or pk = 1000 limit 1; +pk i c +1 1 a +drop table t1; +# # MDEV-19175 Server crashes in ha_partition::vers_can_native upon INSERT DELAYED into versioned partitioned table # create or replace table t1 (f int) with system versioning partition by hash(f); @@ -1150,6 +1162,38 @@ alter table t1 add x serial; alter table t1 add partition (partition p1 history); alter table t1 add partition (partition p2 history); drop table t1; +# +# MDEV-27217 DELETE partition selection doesn't work for history partitions +# +create table t1 (f char) with system versioning +partition by system_time limit 10 ( +partition p0 history, +partition p1 history, +partition p2 history, +partition pn current); +delete from t1 partition (p1); +ERROR HY000: Not allowed for system-versioned table `test`.`t1` +delete from t1 partition (p0, pn); +ERROR HY000: Not allowed for system-versioned table `test`.`t1` +delete from t1 partition (p0, p1); +ERROR HY000: Not allowed for system-versioned table `test`.`t1` +delete from t1 partition (p0, p1, pn); +ERROR HY000: Not allowed for system-versioned table `test`.`t1` +drop table t1; +set timestamp=unix_timestamp('2000-01-01 00:00:00'); +create or replace table t1 (i int) with system versioning +partition by system_time interval 1 day ( +partition p0 history, +partition p1 history, +partition pn current); +set timestamp=unix_timestamp('2000-01-02 00:00:00'); +insert t1 values (1); +delete from t1 partition (p0, pn); +ERROR HY000: Not allowed for system-versioned table `test`.`t1` +delete from t1 partition (p0, p1, pn); +ERROR HY000: Not allowed for system-versioned table `test`.`t1` +drop table t1; +set timestamp= default; # End of 10.3 tests # # MDEV-22283 Server crashes in key_copy or unexpected error 156: The table already existed in the storage engine diff --git a/mysql-test/suite/versioning/r/sysvars-notembedded.result b/mysql-test/suite/versioning/r/sysvars-notembedded.result deleted file mode 100644 index 8b1ad6cfc58..00000000000 --- a/mysql-test/suite/versioning/r/sysvars-notembedded.result +++ /dev/null @@ -1,30 +0,0 @@ -create table t (a int) with system versioning; -set @before= UNIX_TIMESTAMP(now(6)); -insert into t values (1); -set @after= UNIX_TIMESTAMP(now(6)); -update t set a= 2; -set global system_versioning_asof= FROM_UNIXTIME(@after); -set system_versioning_asof= FROM_UNIXTIME(@after); -select * from t as nonempty; -a -1 -connect subcon,127.0.0.1,root,,,$SERVER_MYPORT_1; -connection subcon; -select * from t as nonempty; -a -1 -disconnect subcon; -connection default; -set global system_versioning_asof= FROM_UNIXTIME(@before); -select * from t as nonempty; -a -1 -connect subcon,127.0.0.1,root,,,$SERVER_MYPORT_1; -connection subcon; -select * from t as empty; -a -disconnect subcon; -connection default; -drop table t; -set global system_versioning_asof= DEFAULT; -set system_versioning_asof= DEFAULT; diff --git a/mysql-test/suite/versioning/r/trx_id.result b/mysql-test/suite/versioning/r/trx_id.result index 1b59fc8b3fc..6c337863790 100644 --- a/mysql-test/suite/versioning/r/trx_id.result +++ b/mysql-test/suite/versioning/r/trx_id.result @@ -182,7 +182,78 @@ select x, row_start < row_end from t1 for system_time all; x row_start < row_end 4 1 2 1 +# +# MDEV-15951 system versioning by trx id doesn't work with partitioning +# currently trx_id does not support partitioning by system_time +# +create or replace table t1( +i int, +row_start bigint unsigned generated always as row start, +row_end bigint unsigned generated always as row end, +period for system_time(row_start, row_end) +) engine=InnoDB with system versioning partition by system_time ( +partition p0 history, +partition pn current +); +ERROR HY000: `row_start` must be of type TIMESTAMP(6) for system-versioned table `t1` +create or replace table t1( +i int, +row_start bigint unsigned generated always as row start, +row_end bigint unsigned generated always as row end, +period for system_time(row_start, row_end) +) engine=InnoDB with system versioning; +alter table t1 partition by system_time ( +partition p0 history, +partition pn current +); +ERROR HY000: `row_start` must be of type TIMESTAMP(6) for system-versioned table `t1` +drop table t1; +create or replace table t ( +a int primary key, +row_start bigint unsigned as row start invisible, +row_end bigint unsigned as row end invisible, +period for system_time(row_start, row_end) +) engine=innodb with system versioning +partition by key() ( +partition p1, +partition p2 +); +ERROR HY000: Transaction-precise system-versioned tables do not support partitioning by ROW START or ROW END +create or replace table t ( +a int primary key, +row_start bigint unsigned as row start invisible, +row_end bigint unsigned as row end invisible, +period for system_time(row_start, row_end) +) engine=innodb with system versioning +partition by key(a, row_start) ( +partition p1, +partition p2 +); +ERROR HY000: Transaction-precise system-versioned tables do not support partitioning by ROW START or ROW END +create or replace table t ( +a int primary key, +row_start bigint unsigned as row start invisible, +row_end bigint unsigned as row end invisible, +period for system_time(row_start, row_end) +) engine=innodb with system versioning +partition by hash(a + row_end * 2) ( +partition p1, +partition p2 +); +ERROR HY000: Transaction-precise system-versioned tables do not support partitioning by ROW START or ROW END +create or replace table t ( +a int primary key, +row_start bigint unsigned as row start invisible, +row_end bigint unsigned as row end invisible, +period for system_time(row_start, row_end) +) engine=innodb with system versioning +partition by range columns (a, row_start) ( +partition p1 values less than (100, 100) +); +ERROR HY000: Transaction-precise system-versioned tables do not support partitioning by ROW START or ROW END +# # MDEV-16010 Too many rows with AS OF point_in_the_past_or_NULL +# create or replace table t1 ( x int, row_start bigint unsigned as row start invisible, @@ -512,3 +583,31 @@ drop table t; uninstall plugin test_versioning; select trt_begin_ts(0); ERROR 42000: FUNCTION test.trt_begin_ts does not exist +# +# MDEV-21650 Non-empty statement transaction on global rollback after TRT update error +# +create table t1 (s date, e date, period for app(s,e)) engine=innodb; +alter table t1 +add row_start bigint unsigned as row start, +add row_end bigint unsigned as row end, +add period for system_time(row_start,row_end), +with system versioning, +add period if not exists for app(x,y); +Warnings: +Note 1060 Duplicate column name 'app' +set transaction isolation level serializable; +start transaction; +insert into t1 (s,e) values ('2021-07-04','2024-08-18'); +connect con1,localhost,root,,test; +start transaction; +insert into t1 (s,e) values ('2018-06-01','2021-09-15'); +connection default; +select * from t1 for system_time as of now(); +ERROR HY000: TRX_ID ... not found in `mysql.transaction_registry` +connection con1; +set innodb_lock_wait_timeout= 1, lock_wait_timeout= 1; +alter table xx; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +disconnect con1; +connection default; +drop table t1; diff --git a/mysql-test/suite/versioning/r/update.result b/mysql-test/suite/versioning/r/update.result index 41058969801..b899969d1d1 100644 --- a/mysql-test/suite/versioning/r/update.result +++ b/mysql-test/suite/versioning/r/update.result @@ -399,8 +399,19 @@ a check_row(row_start, row_end) 1 CURRENT ROW drop tables t1, t2, t3; # +# MDEV-26778 row_start is not updated in current row for InnoDB +# +create or replace table t1 (x int) with system versioning; +insert t1 values (1); +update t1 set x= 1; +select row_start into @r from t1; +select check_row_ts(row_start, row_end) from t1 for system_time all where row_start = @r; +check_row_ts(row_start, row_end) +CURRENT ROW +drop table t1; +# # MDEV-24522 Assertion `inited==NONE' fails upon UPDATE on versioned table with unique blob - +# create table t1 (a int, b int, c text, unique(c), key (b)) engine=myisam with system versioning; insert into t1 values (1, 1, 'foo'), (2, 11, 'bar'); update t1 set a = 3 where b <= 9; diff --git a/mysql-test/suite/versioning/t/create.test b/mysql-test/suite/versioning/t/create.test index f79d38d029b..6f5153b4ec1 100644 --- a/mysql-test/suite/versioning/t/create.test +++ b/mysql-test/suite/versioning/t/create.test @@ -471,3 +471,32 @@ create or replace table t1 ( show create table t1; drop table t1; + +--echo # +--echo # MDEV-27452 TIMESTAMP(0) system field is allowed for certain creation of system-versioned table +--echo # +--error ER_VERS_FIELD_WRONG_TYPE +create or replace table t ( + a int, + s timestamp as row start, + e timestamp as row end, + period for system_time (s, e)) +with system versioning; + +--error ER_VERS_FIELD_WRONG_TYPE +create or replace table t ( + a int with system versioning, + s timestamp as row start, + e timestamp as row end, + period for system_time (s, e)); + +create or replace table t ( + a int with system versioning, + b int with system versioning, + s timestamp(6) as row start, + e timestamp(6) as row end, + period for system_time (s, e)); +insert into t () values (),(); + +# cleanup +drop table t; diff --git a/mysql-test/suite/versioning/t/not_embedded.test b/mysql-test/suite/versioning/t/not_embedded.test new file mode 100644 index 00000000000..2afae013e70 --- /dev/null +++ b/mysql-test/suite/versioning/t/not_embedded.test @@ -0,0 +1,79 @@ +--source include/not_embedded.inc +--source include/have_innodb.inc + +--echo # +--echo # SYSTEM_VERSIONING_ASOF sysvar +--echo # +create table t (a int) with system versioning; +set @before= UNIX_TIMESTAMP(now(6)); +insert into t values (1); +set @after= UNIX_TIMESTAMP(now(6)); +update t set a= 2; + +set global system_versioning_asof= FROM_UNIXTIME(@after); +set system_versioning_asof= FROM_UNIXTIME(@after); +select * from t as nonempty; + +--connect (subcon,127.0.0.1,root,,,$SERVER_MYPORT_1) +--connection subcon +select * from t as nonempty; +--disconnect subcon +--connection default + +set global system_versioning_asof= FROM_UNIXTIME(@before); +select * from t as nonempty; + +--connect (subcon,127.0.0.1,root,,,$SERVER_MYPORT_1) +--connection subcon +select * from t as empty; +--disconnect subcon +--connection default + +drop table t; + +set global system_versioning_asof= DEFAULT; +set system_versioning_asof= DEFAULT; + +--echo # +--echo # DELETE HISTORY and privileges +--echo # + +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + +connect (root,localhost,root,,test); +connection root; + +--disable_warnings +create database mysqltest; +--enable_warnings + +create user mysqltest_1@localhost; +connect (user1,localhost,mysqltest_1,,test); +connection user1; + +connection root; +create table mysqltest.t (a int) with system versioning; + +connection user1; +show grants; +--error ER_TABLEACCESS_DENIED_ERROR +delete history from mysqltest.t before system_time now(); + +connection root; +grant delete history on mysqltest.* to mysqltest_1@localhost; +grant delete history on mysqltest.t to mysqltest_1@localhost; + +connection user1; +show grants; +delete history from mysqltest.t before system_time now(); + +connection root; +grant all on *.* to mysqltest_1@localhost; +show grants for mysqltest_1@localhost; + +drop user mysqltest_1@localhost; +drop database mysqltest; +--disconnect user1 +--disconnect root +--connection default diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test index 9aae8412d65..d940f3e75e8 100644 --- a/mysql-test/suite/versioning/t/partition.test +++ b/mysql-test/suite/versioning/t/partition.test @@ -777,6 +777,17 @@ show create table t1; set timestamp= default; --echo # +--echo # MDEV-18794 Assertion `!m_innodb' failed in ha_partition::cmp_ref upon SELECT from partitioned table +--echo # +create or replace table t1 (pk int auto_increment, i int, c char(1), primary key (pk), key(i)) +engine=innodb with system versioning partition by key() partitions 2; +insert into t1 (i, c) values (1, 'a'), (2, 'b'), (null, 'c'), (null, 'b'); +alter table t1 drop system versioning; +replace into t1 select * from t1; +select * from t1 where i > 0 or pk = 1000 limit 1; +drop table t1; + +--echo # --echo # MDEV-19175 Server crashes in ha_partition::vers_can_native upon INSERT DELAYED into versioned partitioned table --echo # create or replace table t1 (f int) with system versioning partition by hash(f); @@ -1029,6 +1040,40 @@ alter table t1 add partition (partition p1 history); alter table t1 add partition (partition p2 history); drop table t1; +--echo # +--echo # MDEV-27217 DELETE partition selection doesn't work for history partitions +--echo # +create table t1 (f char) with system versioning +partition by system_time limit 10 ( + partition p0 history, + partition p1 history, + partition p2 history, + partition pn current); + +--error ER_VERS_NOT_ALLOWED +delete from t1 partition (p1); +--error ER_VERS_NOT_ALLOWED +delete from t1 partition (p0, pn); +--error ER_VERS_NOT_ALLOWED +delete from t1 partition (p0, p1); +--error ER_VERS_NOT_ALLOWED +delete from t1 partition (p0, p1, pn); +drop table t1; + +set timestamp=unix_timestamp('2000-01-01 00:00:00'); +create or replace table t1 (i int) with system versioning +partition by system_time interval 1 day ( + partition p0 history, + partition p1 history, + partition pn current); +set timestamp=unix_timestamp('2000-01-02 00:00:00'); +insert t1 values (1); +--error ER_VERS_NOT_ALLOWED +delete from t1 partition (p0, pn); +--error ER_VERS_NOT_ALLOWED +delete from t1 partition (p0, p1, pn); +drop table t1; +set timestamp= default; --echo # End of 10.3 tests --echo # diff --git a/mysql-test/suite/versioning/t/sysvars-notembedded.test b/mysql-test/suite/versioning/t/sysvars-notembedded.test deleted file mode 100644 index 314972bc375..00000000000 --- a/mysql-test/suite/versioning/t/sysvars-notembedded.test +++ /dev/null @@ -1,31 +0,0 @@ -source include/not_embedded.inc; - -create table t (a int) with system versioning; -set @before= UNIX_TIMESTAMP(now(6)); -insert into t values (1); -set @after= UNIX_TIMESTAMP(now(6)); -update t set a= 2; - -set global system_versioning_asof= FROM_UNIXTIME(@after); -set system_versioning_asof= FROM_UNIXTIME(@after); -select * from t as nonempty; - ---connect (subcon,127.0.0.1,root,,,$SERVER_MYPORT_1) ---connection subcon -select * from t as nonempty; ---disconnect subcon ---connection default - -set global system_versioning_asof= FROM_UNIXTIME(@before); -select * from t as nonempty; - ---connect (subcon,127.0.0.1,root,,,$SERVER_MYPORT_1) ---connection subcon -select * from t as empty; ---disconnect subcon ---connection default - -drop table t; - -set global system_versioning_asof= DEFAULT; -set system_versioning_asof= DEFAULT; diff --git a/mysql-test/suite/versioning/t/truncate_privilege.test b/mysql-test/suite/versioning/t/truncate_privilege.test deleted file mode 100644 index dcdad59039a..00000000000 --- a/mysql-test/suite/versioning/t/truncate_privilege.test +++ /dev/null @@ -1,41 +0,0 @@ -# Can't test with embedded server --- source include/not_embedded.inc - ---source include/have_innodb.inc - -# Save the initial number of concurrent sessions ---source include/count_sessions.inc - -connect (root,localhost,root,,test); -connection root; - ---disable_warnings -create database mysqltest; ---enable_warnings - -create user mysqltest_1@localhost; -connect (user1,localhost,mysqltest_1,,test); -connection user1; - -connection root; -create table mysqltest.t (a int) with system versioning; - -connection user1; -show grants; ---error ER_TABLEACCESS_DENIED_ERROR -delete history from mysqltest.t before system_time now(); - -connection root; -grant delete history on mysqltest.* to mysqltest_1@localhost; -grant delete history on mysqltest.t to mysqltest_1@localhost; - -connection user1; -show grants; -delete history from mysqltest.t before system_time now(); - -connection root; -grant all on *.* to mysqltest_1@localhost; -show grants for mysqltest_1@localhost; - -drop user mysqltest_1@localhost; -drop database mysqltest; diff --git a/mysql-test/suite/versioning/t/trx_id.test b/mysql-test/suite/versioning/t/trx_id.test index 4728ce9b2d0..60836279f52 100644 --- a/mysql-test/suite/versioning/t/trx_id.test +++ b/mysql-test/suite/versioning/t/trx_id.test @@ -3,6 +3,7 @@ if (!$TEST_VERSIONING_SO) --skip needs test_versioning plugin } --source include/have_innodb.inc +--source include/have_partition.inc --source include/default_charset.inc --disable_query_log @@ -161,7 +162,87 @@ update t1 set x= 4; commit; select x, row_start < row_end from t1 for system_time all; +--echo # +--echo # MDEV-15951 system versioning by trx id doesn't work with partitioning +--echo # currently trx_id does not support partitioning by system_time +--echo # +--error ER_VERS_FIELD_WRONG_TYPE +create or replace table t1( + i int, + row_start bigint unsigned generated always as row start, + row_end bigint unsigned generated always as row end, + period for system_time(row_start, row_end) +) engine=InnoDB with system versioning partition by system_time ( + partition p0 history, + partition pn current +); + +create or replace table t1( + i int, + row_start bigint unsigned generated always as row start, + row_end bigint unsigned generated always as row end, + period for system_time(row_start, row_end) +) engine=InnoDB with system versioning; + +--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/ +--error ER_VERS_FIELD_WRONG_TYPE +alter table t1 partition by system_time ( + partition p0 history, + partition pn current +); + +drop table t1; + +--error ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED +create or replace table t ( + a int primary key, + row_start bigint unsigned as row start invisible, + row_end bigint unsigned as row end invisible, + period for system_time(row_start, row_end) +) engine=innodb with system versioning +partition by key() ( + partition p1, + partition p2 +); + +--error ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED +create or replace table t ( + a int primary key, + row_start bigint unsigned as row start invisible, + row_end bigint unsigned as row end invisible, + period for system_time(row_start, row_end) +) engine=innodb with system versioning +partition by key(a, row_start) ( + partition p1, + partition p2 +); + +--error ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED +create or replace table t ( + a int primary key, + row_start bigint unsigned as row start invisible, + row_end bigint unsigned as row end invisible, + period for system_time(row_start, row_end) +) engine=innodb with system versioning +partition by hash(a + row_end * 2) ( + partition p1, + partition p2 +); + +--error ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED +create or replace table t ( + a int primary key, + row_start bigint unsigned as row start invisible, + row_end bigint unsigned as row end invisible, + period for system_time(row_start, row_end) +) engine=innodb with system versioning +partition by range columns (a, row_start) ( + partition p1 values less than (100, 100) +); + +--echo # --echo # MDEV-16010 Too many rows with AS OF point_in_the_past_or_NULL +--echo # create or replace table t1 ( x int, row_start bigint unsigned as row start invisible, @@ -515,3 +596,38 @@ uninstall plugin test_versioning; select trt_begin_ts(0); --disable_prepare_warnings + +--echo # +--echo # MDEV-21650 Non-empty statement transaction on global rollback after TRT update error +--echo # +create table t1 (s date, e date, period for app(s,e)) engine=innodb; +alter table t1 + add row_start bigint unsigned as row start, + add row_end bigint unsigned as row end, + add period for system_time(row_start,row_end), + with system versioning, + add period if not exists for app(x,y); + +set transaction isolation level serializable; +start transaction; +insert into t1 (s,e) values ('2021-07-04','2024-08-18'); + +--connect (con1,localhost,root,,test) +start transaction; +insert into t1 (s,e) values ('2018-06-01','2021-09-15'); + +--connection default +--replace_regex /TRX_ID \d+/TRX_ID .../ +--error ER_VERS_NO_TRX_ID +select * from t1 for system_time as of now(); + +--connection con1 +set innodb_lock_wait_timeout= 1, lock_wait_timeout= 1; +# can be existing or non-existing table, does not matter +--error ER_LOCK_WAIT_TIMEOUT +alter table xx; + +# cleanup +--disconnect con1 +--connection default +drop table t1; diff --git a/mysql-test/suite/versioning/t/update.test b/mysql-test/suite/versioning/t/update.test index df07cec33cb..a80a8a7b714 100644 --- a/mysql-test/suite/versioning/t/update.test +++ b/mysql-test/suite/versioning/t/update.test @@ -329,8 +329,18 @@ select *, check_row(row_start, row_end) from t2 for system_time all order by row drop tables t1, t2, t3; --echo # +--echo # MDEV-26778 row_start is not updated in current row for InnoDB +--echo # +create or replace table t1 (x int) with system versioning; +insert t1 values (1); +update t1 set x= 1; +select row_start into @r from t1; +select check_row_ts(row_start, row_end) from t1 for system_time all where row_start = @r; +drop table t1; + +--echo # --echo # MDEV-24522 Assertion `inited==NONE' fails upon UPDATE on versioned table with unique blob ---echo +--echo # create table t1 (a int, b int, c text, unique(c), key (b)) engine=myisam with system versioning; insert into t1 values (1, 1, 'foo'), (2, 11, 'bar'); diff --git a/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result b/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result index 262c75f862e..aaeabff9663 100644 --- a/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result +++ b/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result @@ -9,13 +9,18 @@ ALTER TABLE time_zone ENGINE=InnoDB; ALTER TABLE time_zone_name ENGINE=InnoDB; ALTER TABLE time_zone_transition ENGINE=InnoDB; ALTER TABLE time_zone_transition_type ENGINE=InnoDB; -END IF| -\d ; TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition_type; START TRANSACTION; +ELSE +TRUNCATE TABLE time_zone; +TRUNCATE TABLE time_zone_name; +TRUNCATE TABLE time_zone_transition; +TRUNCATE TABLE time_zone_transition_type; +END IF| +\d ; INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); SET @time_zone_id= LAST_INSERT_ID(); INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id); @@ -33,6 +38,7 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, `Offset Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/garbage' as time zone. Skipping it. Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/ignored.tab' as time zone. Skipping it. Warning: Skipping directory 'MYSQLTEST_VARDIR/zoneinfo/posix/posix': to avoid infinite symlink recursion. +UNLOCK TABLES; COMMIT; ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; @@ -41,8 +47,8 @@ IF (select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=Aria; ALTER TABLE time_zone_name ENGINE=Aria; -ALTER TABLE time_zone_transition ENGINE=Aria; -ALTER TABLE time_zone_transition_type ENGINE=Aria; +ALTER TABLE time_zone_transition ENGINE=Aria, ORDER BY Time_zone_id, Transition_time; +ALTER TABLE time_zone_transition_type ENGINE=Aria, ORDER BY Time_zone_id, Transition_type_id; END IF| \d ; # Silent run @@ -53,13 +59,18 @@ ALTER TABLE time_zone ENGINE=InnoDB; ALTER TABLE time_zone_name ENGINE=InnoDB; ALTER TABLE time_zone_transition ENGINE=InnoDB; ALTER TABLE time_zone_transition_type ENGINE=InnoDB; -END IF| -\d ; TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition_type; START TRANSACTION; +ELSE +TRUNCATE TABLE time_zone; +TRUNCATE TABLE time_zone_name; +TRUNCATE TABLE time_zone_transition; +TRUNCATE TABLE time_zone_transition_type; +END IF| +\d ; INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); SET @time_zone_id= LAST_INSERT_ID(); INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id); @@ -74,6 +85,7 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, `Offset (@time_zone_id, 0, 0, 0, 'GMT') ; Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/garbage' as time zone. Skipping it. +UNLOCK TABLES; COMMIT; ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; @@ -82,8 +94,8 @@ IF (select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=Aria; ALTER TABLE time_zone_name ENGINE=Aria; -ALTER TABLE time_zone_transition ENGINE=Aria; -ALTER TABLE time_zone_transition_type ENGINE=Aria; +ALTER TABLE time_zone_transition ENGINE=Aria, ORDER BY Time_zone_id, Transition_time; +ALTER TABLE time_zone_transition_type ENGINE=Aria, ORDER BY Time_zone_id, Transition_type_id; END IF| \d ; # @@ -96,6 +108,10 @@ ALTER TABLE time_zone ENGINE=InnoDB; ALTER TABLE time_zone_name ENGINE=InnoDB; ALTER TABLE time_zone_transition ENGINE=InnoDB; ALTER TABLE time_zone_transition_type ENGINE=InnoDB; +SELECT 'skip truncate tables'; +START TRANSACTION; +ELSE +SELECT 'skip truncate tables'; END IF| \d ; INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); @@ -104,13 +120,15 @@ INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('XXX', @time_zone_id); INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, `Offset`, Is_DST, Abbreviation) VALUES (@time_zone_id, 0, 0, 0, 'GMT') ; +UNLOCK TABLES; +COMMIT; \d | IF (select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=Aria; ALTER TABLE time_zone_name ENGINE=Aria; -ALTER TABLE time_zone_transition ENGINE=Aria; -ALTER TABLE time_zone_transition_type ENGINE=Aria; +ALTER TABLE time_zone_transition ENGINE=Aria, ORDER BY Time_zone_id, Transition_time; +ALTER TABLE time_zone_transition_type ENGINE=Aria, ORDER BY Time_zone_id, Transition_type_id; END IF| \d ; # @@ -123,6 +141,10 @@ ALTER TABLE time_zone ENGINE=InnoDB; ALTER TABLE time_zone_name ENGINE=InnoDB; ALTER TABLE time_zone_transition ENGINE=InnoDB; ALTER TABLE time_zone_transition_type ENGINE=InnoDB; +SELECT 'skip truncate tables'; +START TRANSACTION; +ELSE +SELECT 'skip truncate tables'; END IF| \d ; \d | @@ -139,12 +161,14 @@ ALTER TABLE time_zone_leap_second ENGINE=Aria; END IF| \d ; ALTER TABLE time_zone_leap_second ORDER BY Transition_time; +UNLOCK TABLES; +COMMIT; \d | IF (select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=Aria; ALTER TABLE time_zone_name ENGINE=Aria; -ALTER TABLE time_zone_transition ENGINE=Aria; -ALTER TABLE time_zone_transition_type ENGINE=Aria; +ALTER TABLE time_zone_transition ENGINE=Aria, ORDER BY Time_zone_id, Transition_time; +ALTER TABLE time_zone_transition_type ENGINE=Aria, ORDER BY Time_zone_id, Transition_type_id; END IF| \d ; diff --git a/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink_skip.result b/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink_skip.result index e77afe0df75..1b1785347f3 100644 --- a/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink_skip.result +++ b/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink_skip.result @@ -9,7 +9,11 @@ TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition_type; -START TRANSACTION; +LOCK TABLES time_zone WRITE, + time_zone_leap_second WRITE, + time_zone_name WRITE, + time_zone_transition WRITE, + time_zone_transition_type WRITE; INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); SET @time_zone_id= LAST_INSERT_ID(); INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id); @@ -27,6 +31,7 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, `Offset Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/garbage' as time zone. Skipping it. Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/ignored.tab' as time zone. Skipping it. Warning: Skipping directory 'MYSQLTEST_VARDIR/zoneinfo/posix/posix': to avoid infinite symlink recursion. +UNLOCK TABLES; COMMIT; ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; @@ -38,7 +43,11 @@ TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition_type; -START TRANSACTION; +LOCK TABLES time_zone WRITE, + time_zone_leap_second WRITE, + time_zone_name WRITE, + time_zone_transition WRITE, + time_zone_transition_type WRITE; INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); SET @time_zone_id= LAST_INSERT_ID(); INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id); @@ -53,6 +62,7 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, `Offset (@time_zone_id, 0, 0, 0, 'GMT') ; Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/garbage' as time zone. Skipping it. +UNLOCK TABLES; COMMIT; ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; @@ -62,17 +72,33 @@ ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?'); prepare set_wsrep_write_binlog from @prep1; set @toggle=0; execute set_wsrep_write_binlog using @toggle; +SELECT 'skip truncate tables'; +LOCK TABLES time_zone WRITE, + time_zone_leap_second WRITE, + time_zone_name WRITE, + time_zone_transition WRITE, + time_zone_transition_type WRITE; INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); SET @time_zone_id= LAST_INSERT_ID(); INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('XXX', @time_zone_id); INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, `Offset`, Is_DST, Abbreviation) VALUES (@time_zone_id, 0, 0, 0, 'GMT') ; +UNLOCK TABLES; +COMMIT; # # Testing --leap # set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?'); prepare set_wsrep_write_binlog from @prep1; set @toggle=0; execute set_wsrep_write_binlog using @toggle; +SELECT 'skip truncate tables'; +LOCK TABLES time_zone WRITE, + time_zone_leap_second WRITE, + time_zone_name WRITE, + time_zone_transition WRITE, + time_zone_transition_type WRITE; TRUNCATE TABLE time_zone_leap_second; ALTER TABLE time_zone_leap_second ORDER BY Transition_time; +UNLOCK TABLES; +COMMIT; diff --git a/mysys_ssl/my_sha.ic b/mysys_ssl/my_sha.inl index 6bba614765e..6bba614765e 100644 --- a/mysys_ssl/my_sha.ic +++ b/mysys_ssl/my_sha.inl diff --git a/mysys_ssl/my_sha1.cc b/mysys_ssl/my_sha1.cc index b53e214468d..29563742e6b 100644 --- a/mysys_ssl/my_sha1.cc +++ b/mysys_ssl/my_sha1.cc @@ -15,4 +15,4 @@ #define NUM 1 -#include "my_sha.ic" +#include "my_sha.inl" diff --git a/mysys_ssl/my_sha224.cc b/mysys_ssl/my_sha224.cc index 200b6ed161c..5fffdce7794 100644 --- a/mysys_ssl/my_sha224.cc +++ b/mysys_ssl/my_sha224.cc @@ -15,4 +15,4 @@ #define NUM 224 -#include "my_sha.ic" +#include "my_sha.inl" diff --git a/mysys_ssl/my_sha256.cc b/mysys_ssl/my_sha256.cc index 1562809f91a..59e871de121 100644 --- a/mysys_ssl/my_sha256.cc +++ b/mysys_ssl/my_sha256.cc @@ -15,4 +15,4 @@ #define NUM 256 -#include "my_sha.ic" +#include "my_sha.inl" diff --git a/mysys_ssl/my_sha384.cc b/mysys_ssl/my_sha384.cc index 6bb64470105..40707de0a8d 100644 --- a/mysys_ssl/my_sha384.cc +++ b/mysys_ssl/my_sha384.cc @@ -15,4 +15,4 @@ #define NUM 384 -#include "my_sha.ic" +#include "my_sha.inl" diff --git a/mysys_ssl/my_sha512.cc b/mysys_ssl/my_sha512.cc index 1047d0dbe46..6a5a04d72f0 100644 --- a/mysys_ssl/my_sha512.cc +++ b/mysys_ssl/my_sha512.cc @@ -15,4 +15,4 @@ #define NUM 512 -#include "my_sha.ic" +#include "my_sha.inl" diff --git a/plugin/disks/mysql-test/disks/disks.result b/plugin/disks/mysql-test/disks/disks.result index 9beab2f30d1..eb78d4073df 100644 --- a/plugin/disks/mysql-test/disks/disks.result +++ b/plugin/disks/mysql-test/disks/disks.result @@ -1,11 +1,11 @@ show create table information_schema.disks; Table Create Table DISKS CREATE TEMPORARY TABLE `DISKS` ( - `Disk` varchar(4096) NOT NULL DEFAULT '', - `Path` varchar(4096) NOT NULL DEFAULT '', - `Total` bigint(32) NOT NULL DEFAULT 0, - `Used` bigint(32) NOT NULL DEFAULT 0, - `Available` bigint(32) NOT NULL DEFAULT 0 + `Disk` varchar(4096) NOT NULL, + `Path` varchar(4096) NOT NULL, + `Total` bigint(32) NOT NULL, + `Used` bigint(32) NOT NULL, + `Available` bigint(32) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 select sum(Total) > sum(Available), sum(Total)>sum(Used) from information_schema.disks; sum(Total) > sum(Available) sum(Total)>sum(Used) diff --git a/plugin/qc_info/qc_info.cc b/plugin/qc_info/qc_info.cc index baaa3519261..a46e2d9fbf2 100644 --- a/plugin/qc_info/qc_info.cc +++ b/plugin/qc_info/qc_info.cc @@ -72,12 +72,13 @@ bool schema_table_store_record(THD *thd, TABLE *table); #define COLUMN_CLIENT_LONG_FLAG 16 #define COLUMN_CLIENT_PROTOCOL_41 17 -#define COLUMN_PROTOCOL_TYPE 18 -#define COLUMN_MORE_RESULTS_EXISTS 19 -#define COLUMN_IN_TRANS 20 -#define COLUMN_AUTOCOMMIT 21 -#define COLUMN_PKT_NR 22 -#define COLUMN_HITS 23 +#define COLUMN_CLIENT_EXTENDED_METADATA 18 +#define COLUMN_PROTOCOL_TYPE 19 +#define COLUMN_MORE_RESULTS_EXISTS 20 +#define COLUMN_IN_TRANS 21 +#define COLUMN_AUTOCOMMIT 22 +#define COLUMN_PKT_NR 23 +#define COLUMN_HITS 24 namespace Show { @@ -103,6 +104,7 @@ static ST_FIELD_INFO qc_info_fields[]= Column("LC_TIME_NAMES", Varchar(100), NOT_NULL), Column("CLIENT_LONG_FLAG", STiny(MY_INT32_NUM_DECIMAL_DIGITS), NOT_NULL), Column("CLIENT_PROTOCOL_41", STiny(MY_INT32_NUM_DECIMAL_DIGITS), NOT_NULL), + Column("CLIENT_EXTENDED_METADATA",STiny(MY_INT32_NUM_DECIMAL_DIGITS), NOT_NULL), Column("PROTOCOL_TYPE", STiny(MY_INT32_NUM_DECIMAL_DIGITS), NOT_NULL), Column("MORE_RESULTS_EXISTS", STiny(MY_INT32_NUM_DECIMAL_DIGITS), NOT_NULL), Column("IN_TRANS", STiny(MY_INT32_NUM_DECIMAL_DIGITS), NOT_NULL), @@ -216,6 +218,8 @@ static int qc_info_fill_table(THD *thd, TABLE_LIST *tables, table->field[COLUMN_CLIENT_LONG_FLAG]->store(flags.client_long_flag, 0); table->field[COLUMN_CLIENT_PROTOCOL_41]->store(flags.client_protocol_41, 0); + table->field[COLUMN_CLIENT_EXTENDED_METADATA]-> + store(flags.client_extended_metadata, 0); table->field[COLUMN_PROTOCOL_TYPE]->store(flags.protocol_type, 0); table->field[COLUMN_MORE_RESULTS_EXISTS]->store(flags.more_results_exists, 0); table->field[COLUMN_IN_TRANS]->store(flags.in_trans, 0); diff --git a/plugin/query_response_time/mysql-test/query_response_time/basic.result b/plugin/query_response_time/mysql-test/query_response_time/basic.result index 5bf357375b9..8f25804e253 100644 --- a/plugin/query_response_time/mysql-test/query_response_time/basic.result +++ b/plugin/query_response_time/mysql-test/query_response_time/basic.result @@ -6,9 +6,9 @@ query_response_time_stats OFF SHOW CREATE TABLE INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; Table Create Table QUERY_RESPONSE_TIME CREATE TEMPORARY TABLE `QUERY_RESPONSE_TIME` ( - `TIME` varchar(14) NOT NULL DEFAULT '', - `COUNT` int(11) unsigned NOT NULL DEFAULT 0, - `TOTAL` varchar(14) NOT NULL DEFAULT '' + `TIME` varchar(14) NOT NULL, + `COUNT` int(11) unsigned NOT NULL, + `TOTAL` varchar(14) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SELECT PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_TYPE, PLUGIN_AUTHOR, PLUGIN_DESCRIPTION, PLUGIN_LICENSE, PLUGIN_MATURITY FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'query_response_time%';; PLUGIN_NAME QUERY_RESPONSE_TIME diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_json.result b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_json.result new file mode 100644 index 00000000000..2b6603a51c3 --- /dev/null +++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_json.result @@ -0,0 +1,63 @@ +# +# MDEV-27018 IF and COALESCE lose "json" property +# +CREATE TABLE t1 (a INET6, b JSON, c LONGTEXT); +INSERT INTO t1 VALUES ('::', '{"b": "b"}', '{"c": "c"}'); +SELECT +COALESCE(a,b), COALESCE(a,c), +LEAST(a,b), LEAST(a,c) +FROM t1 LIMIT 0; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(a,b) 254 (type=inet6) 39 0 Y 32 0 8 +def COALESCE(a,c) 254 (type=inet6) 39 0 Y 32 0 8 +def LEAST(a,b) 254 (type=inet6) 39 0 Y 32 0 8 +def LEAST(a,c) 254 (type=inet6) 39 0 Y 32 0 8 +COALESCE(a,b) COALESCE(a,c) LEAST(a,b) LEAST(a,c) +CREATE TABLE t2 AS +SELECT +COALESCE(a,b), COALESCE(a,c), +LEAST(a,b), LEAST(a,c) +FROM t1 LIMIT 0; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `COALESCE(a,b)` inet6 DEFAULT NULL, + `COALESCE(a,c)` inet6 DEFAULT NULL, + `LEAST(a,b)` inet6 DEFAULT NULL, + `LEAST(a,c)` inet6 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +SELECT * FROM t1 WHERE a=b; +a b c +Warnings: +Warning 1292 Incorrect inet6 value: '{"b": "b"}' +SELECT * FROM t1 WHERE a=c; +a b c +Warnings: +Warning 1292 Incorrect inet6 value: '{"c": "c"}' +SELECT a+b FROM t1; +ERROR HY000: Illegal parameter data types inet6 and longblob/json for operation '+' +SELECT a+c FROM t1; +ERROR HY000: Illegal parameter data types inet6 and longblob for operation '+' +DROP TABLE t1; +# +# MDEV-27668 Assertion `item->type_handler()->is_traditional_scalar_type() || item->type_handler() == type_handler()' failed in Field_inet6::can_optimize_keypart_ref +# +CREATE TABLE t1 (i INET6 PRIMARY KEY); +CREATE TABLE t2 (a VARCHAR(40) CHECK (JSON_VALID(a))); +SELECT * FROM t1 JOIN t2 ON (i = a); +i a +INSERT INTO t1 VALUES ('::'),('ffff::ffff'); +INSERT INTO t2 VALUES ('{}'),('[]'); +SELECT * FROM t1 JOIN t2 ON (i = a); +i a +DROP TABLE t1, t2; +CREATE TABLE t1 (i INET6 PRIMARY KEY); +SELECT * FROM t1 WHERE i<JSON_OBJECT('c','b'); +i +INSERT INTO t1 VALUES ('::'),('ffff::ffff'); +SELECT * FROM t1 WHERE i<JSON_OBJECT('c','b'); +i +Warnings: +Warning 1292 Incorrect inet6 value: '{"c": "b"}' +DROP TABLE t1; diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_json.test b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_json.test new file mode 100644 index 00000000000..74a91ff9a05 --- /dev/null +++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_json.test @@ -0,0 +1,68 @@ +--echo # +--echo # MDEV-27018 IF and COALESCE lose "json" property +--echo # + +# +# Testing that JSON data types inherit properties +# from their non-JSON counterparts when mixed to INET6. +# +# E.g. JSON acts exactly like LONGTEXT when mixed to INET6: +# +# - COALESCE(inet6,json) returns inet6 (type aggregation for result) +# - LEAST(inet6,json) returns inet6 (type aggregation for min/max) +# - inet6=json is compared as inet6 (type aggregation for comparison) +# - inet6+json returns an error (type aggregation for numeric op) +# +# Mixing INET6 and JSON is actually meaningless: +# Non of valid JSON values are valid INET6. +# +# Some queries below intentionally use LIMIT 0 to avoid errors. +# + +CREATE TABLE t1 (a INET6, b JSON, c LONGTEXT); +INSERT INTO t1 VALUES ('::', '{"b": "b"}', '{"c": "c"}'); + +--disable_ps_protocol +--enable_metadata +SELECT + COALESCE(a,b), COALESCE(a,c), + LEAST(a,b), LEAST(a,c) +FROM t1 LIMIT 0; +--disable_metadata +--enable_ps_protocol + +CREATE TABLE t2 AS +SELECT + COALESCE(a,b), COALESCE(a,c), + LEAST(a,b), LEAST(a,c) +FROM t1 LIMIT 0; +SHOW CREATE TABLE t2; +DROP TABLE t2; + +SELECT * FROM t1 WHERE a=b; +SELECT * FROM t1 WHERE a=c; + +--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION +SELECT a+b FROM t1; +--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION +SELECT a+c FROM t1; + +DROP TABLE t1; + +--echo # +--echo # MDEV-27668 Assertion `item->type_handler()->is_traditional_scalar_type() || item->type_handler() == type_handler()' failed in Field_inet6::can_optimize_keypart_ref +--echo # + +CREATE TABLE t1 (i INET6 PRIMARY KEY); +CREATE TABLE t2 (a VARCHAR(40) CHECK (JSON_VALID(a))); +SELECT * FROM t1 JOIN t2 ON (i = a); +INSERT INTO t1 VALUES ('::'),('ffff::ffff'); +INSERT INTO t2 VALUES ('{}'),('[]'); +SELECT * FROM t1 JOIN t2 ON (i = a); +DROP TABLE t1, t2; + +CREATE TABLE t1 (i INET6 PRIMARY KEY); +SELECT * FROM t1 WHERE i<JSON_OBJECT('c','b'); +INSERT INTO t1 VALUES ('::'),('ffff::ffff'); +SELECT * FROM t1 WHERE i<JSON_OBJECT('c','b'); +DROP TABLE t1; diff --git a/plugin/user_variables/mysql-test/user_variables/basic.result b/plugin/user_variables/mysql-test/user_variables/basic.result index 3acfb525ba5..a47c9301c21 100644 --- a/plugin/user_variables/mysql-test/user_variables/basic.result +++ b/plugin/user_variables/mysql-test/user_variables/basic.result @@ -11,10 +11,10 @@ PLUGIN_MATURITY Stable SHOW CREATE TABLE INFORMATION_SCHEMA.USER_VARIABLES; Table Create Table user_variables CREATE TEMPORARY TABLE `user_variables` ( - `VARIABLE_NAME` varchar(64) NOT NULL DEFAULT '', - `VARIABLE_VALUE` varchar(2048) DEFAULT NULL, - `VARIABLE_TYPE` varchar(64) NOT NULL DEFAULT '', - `CHARACTER_SET_NAME` varchar(32) DEFAULT NULL + `VARIABLE_NAME` varchar(64) NOT NULL, + `VARIABLE_VALUE` varchar(2048), + `VARIABLE_TYPE` varchar(64) NOT NULL, + `CHARACTER_SET_NAME` varchar(32) ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 FLUSH USER_VARIABLES; SELECT COUNT(*) FROM INFORMATION_SCHEMA.USER_VARIABLES; diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index e861eb70d20..92611b18267 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -179,6 +179,7 @@ ENDIF() SET(HOSTNAME "uname -n") SET(MYSQLD_USER "mysql") +SET(MYSQLD_GROUP "mysql") ENDIF(UNIX) # Really ugly, one script, "mysql_install_db", needs prefix set to ".", diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index f32002f996e..ead30962376 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -31,6 +31,7 @@ defaults="" defaults_group_suffix="" mysqld_opt="" user="" +group="" silent_startup="--silent-startup" force=0 @@ -95,6 +96,11 @@ Usage: $0 [OPTIONS] user. You must be root to use this option. By default mysqld runs using your current login name and files and directories that it creates will be owned by you. + --group=group_name The login group to use for running mysqld. Files and + directories created by mysqld will be owned by this + group. You must be root to use this option. By default + mysqld runs using your current group and files and + directories that it creates will be owned by you. All other options are passed to the mysqld program @@ -144,11 +150,11 @@ parse_arguments() --ldata=*|--datadir=*|--data=*) ldata=`parse_arg "$arg"` ;; --log-error=*) log_error=`parse_arg "$arg"` ;; - --user=*) # Note that the user will be passed to mysqld so that it runs # as 'user' (crucial e.g. if log-bin=/some_other_path/ # where a chown of datadir won't help) - user=`parse_arg "$arg"` ;; + --user=*) user=`parse_arg "$arg"` ;; + --group=*) group=`parse_arg "$arg"` ;; --skip-name-resolve) ip_only=1 ;; --verbose) verbose=1 ; silent_startup="" ;; --rpm) in_rpm=1 ;; @@ -468,7 +474,12 @@ do fi if test -n "$user" then - chown $user "$dir" + if test -z "$group" + then + chown $user $dir + else + chown $user:$group $dir + fi if test $? -ne 0 then echo "Cannot change ownership of the database directories to the '$user'" @@ -502,6 +513,11 @@ then args="$args --user=$user" fi +if test -n "$group" +then + args="$args --group=$group" +fi + if test -f "$ldata/mysql/user.frm" then echo "mysql.user table already exists!" @@ -525,7 +541,7 @@ mysqld_install_cmd_line() { "$mysqld_bootstrap" $defaults $defaults_group_suffix "$mysqld_opt" --bootstrap $silent_startup\ "--basedir=$basedir" "--datadir=$ldata" --log-warnings=0 --enforce-storage-engine="" \ - "--plugin-dir=${plugindir}" \ + "--plugin-dir=${plugindir}" --loose-disable-plugin-file-key-management \ $args --max_allowed_packet=8M \ --net_buffer_length=16K } @@ -560,6 +576,7 @@ cat_sql() s_echo "Installing MariaDB/MySQL system tables in '$ldata' ..." if cat_sql | eval "$filter_cmd_line" | mysqld_install_cmd_line > /dev/null then + printf "@VERSION@-MariaDB" > "$ldata/mysql_upgrade_info" s_echo "OK" else log_file_place=$ldata diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 51cb052bde0..28c39090d03 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -20,9 +20,10 @@ use Getopt::Long; use POSIX qw(strftime getcwd); +use File::Path qw(mkpath); $|=1; -$VER="2.20"; +$VER="3.0"; my @defaults_options; # Leading --no-defaults, --defaults-file, etc. @@ -147,6 +148,7 @@ sub main usage() if (!defined($ARGV[0]) || (!($ARGV[0] =~ m/^start$/i) && !($ARGV[0] =~ m/^stop$/i) && + !($ARGV[0] =~ m/^reload$/i) && !($ARGV[0] =~ m/^report$/i))); if (!$opt_no_log) @@ -160,7 +162,7 @@ sub main print strftime "%a %b %e %H:%M:%S %Y", localtime; print "\n"; } - if ($ARGV[0] =~ m/^start$/i) + if (($ARGV[0] =~ m/^start$/i) || ($ARGV[0] =~ m/^reload$/i)) { if (!defined(($mysqld= my_which($opt_mysqld))) && $opt_verbose) { @@ -169,7 +171,11 @@ sub main print "This is OK, if you are using option \"mysqld=...\" in "; print "groups [mysqldN] separately for each.\n\n"; } - start_mysqlds(); + if ($ARGV[0] =~ m/^start$/i) { + start_mysqlds(); + } elsif ($ARGV[0] =~ m/^reload$/i) { + reload_mysqlds(); + } } else { @@ -332,6 +338,39 @@ sub start_mysqlds() for ($j = 0, $tmp= ""; defined($options[$j]); $j++) { + if ("--datadir=" eq substr($options[$j], 0, 10)) { + $datadir = $options[$j]; + $datadir =~ s/\-\-datadir\=//; + eval { mkpath($datadir) }; + if ($@) { + print "FATAL ERROR: Cannot create data directory $datadir: $!\n"; + exit(1); + } + if (! -d $datadir."/mysql") { + if (-w $datadir) { + print "\n\nInstalling new database in $datadir\n\n"; + $install_cmd="@bindir@/mysql_install_db "; + $install_cmd.="--user=mysql "; + $install_cmd.="--datadir=$datadir"; + system($install_cmd); + } else { + print "\n"; + print "FATAL ERROR: Tried to create mysqld under group [$groups[$i]],\n"; + print "but the data directory is not writable.\n"; + print "data directory used: $datadir\n"; + exit(1); + } + } + + if (! -d $datadir."/mysql") { + print "\n"; + print "FATAL ERROR: Tried to start mysqld under group [$groups[$i]],\n"; + print "but no data directory was found or could be created.\n"; + print "data directory used: $datadir\n"; + exit(1); + } + } + if ("--mysqladmin=" eq substr($options[$j], 0, 13)) { # catch this and ignore @@ -412,6 +451,58 @@ sub start_mysqlds() } #### +#### reload multiple servers +#### + +sub reload_mysqlds() +{ + my (@groups, $com, $tmp, $i, @options, $j); + + if (!$opt_no_log) + { + w2log("\nReloading MySQL servers\n","$opt_log",0,0); + } + else + { + print "\nReloading MySQL servers\n"; + } + @groups = &find_groups($groupids); + for ($i = 0; defined($groups[$i]); $i++) + { + $mysqld_server = $mysqld; + @options = defaults_for_group($groups[$i]); + + for ($j = 0, $tmp= ""; defined($options[$j]); $j++) + { + if ("--mysqladmin=" eq substr($options[$j], 0, 13)) + { + # catch this and ignore + } + elsif ("--mysqld=" eq substr($options[$j], 0, 9)) + { + $options[$j] =~ s/\-\-mysqld\=//; + $mysqld_server = $options[$j]; + } + elsif ("--pid-file=" eq substr($options[$j], 0, 11)) + { + $options[$j] =~ s/\-\-pid-file\=//; + $pid_file = $options[$j]; + } + } + $com = "killproc -p $pid_file -HUP $mysqld_server"; + system($com); + + $com = "touch $pid_file"; + system($com); + } + if (!$i && !$opt_no_log) + { + w2log("No MySQL servers to be reloaded (check your GNRs)", + "$opt_log", 0, 0); + } +} + +### #### stop multiple servers #### @@ -793,7 +884,7 @@ sub usage $my_progname version $VER by Jani Tolonen Description: -$my_progname can be used to start, or stop any number of separate +$my_progname can be used to start, reload, or stop any number of separate mysqld processes running in different TCP/IP ports and UNIX sockets. $my_progname can read group [mysqld_multi] from my.cnf file. You may @@ -811,16 +902,16 @@ integer starting from 1. These groups should be the same as the regular [mysqld] group, but with those port, socket and any other options that are to be used with each separate mysqld process. The number in the group name has another function; it can be used for starting, -stopping, or reporting any specific mysqld server. +reloading, stopping, or reporting any specific mysqld server. -Usage: $my_progname [OPTIONS] {start|stop|report} [GNR,GNR,GNR...] -or $my_progname [OPTIONS] {start|stop|report} [GNR-GNR,GNR,GNR-GNR,...] +Usage: $my_progname [OPTIONS] {start|reload|stop|report} [GNR,GNR,GNR...] +or $my_progname [OPTIONS] {start|reload|stop|report} [GNR-GNR,GNR,GNR-GNR,...] -The GNR means the group number. You can start, stop or report any GNR, +The GNR means the group number. You can start, reload, stop or report any GNR, or several of them at the same time. (See --example) The GNRs list can be comma separated or a dash combined. The latter means that all the GNRs between GNR1-GNR2 will be affected. Without GNR argument all the -groups found will either be started, stopped, or reported. Note that +groups found will either be started, reloaded, stopped, or reported. Note that syntax for specifying GNRs must appear without spaces. Options: diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index a461f217824..9ef1b0a6971 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -29,6 +29,7 @@ logging=init want_syslog=0 syslog_tag= user='@MYSQLD_USER@' +group='@MYSQLD_GROUP@' pid_file= err_log= err_log_base= @@ -299,6 +300,7 @@ parse_arguments() { --pid[-_]file=*) pid_file="$val" ;; --plugin[-_]dir=*) PLUGIN_DIR="$val" ;; --user=*) user="$val"; SET_USER=1 ;; + --group=*) group="$val"; SET_USER=1 ;; --log[-_]basename=*|--hostname=*|--loose[-_]log[-_]basename=*) pid_file="$val.pid"; err_log_base="$val"; @@ -702,6 +704,7 @@ then if test "$user" != "root" -o $SET_USER = 1 then USER_OPTION="--user=$user" + GROUP_OPTION="--group=$group" fi if test -n "$open_files" then @@ -724,7 +727,12 @@ then log_error "Fatal error Can't create database directory '$mysql_unix_port'" exit 1 fi - chown $user $mysql_unix_port_dir + if [ "$user" -a "$group" ]; then + chown $user:$group $mysql_unix_port_dir + else + [ "$user" ] && chown $user $mysql_unix_port_dir + [ "$group" ] && chgrp $group $mysql_unix_port_dir + fi chmod 755 $mysql_unix_port_dir fi diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 9ec686ef9d9..241b482ab16 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -484,7 +484,10 @@ IF(WIN32) ${CMAKE_CURRENT_BINARY_DIR}/mysql_bootstrap_sql.c COMPONENT Server ) - SET_TARGET_PROPERTIES(mariadb-install-db PROPERTIES COMPILE_FLAGS -DINSTALL_PLUGINDIR=${INSTALL_PLUGINDIR}) + + SET_TARGET_PROPERTIES(mariadb-install-db PROPERTIES COMPILE_DEFINITIONS + "INSTALL_PLUGINDIR=${INSTALL_PLUGINDIR};INSTALL_SHAREDIR=${INSTALL_SHAREDIR}" + ) TARGET_LINK_LIBRARIES(mariadb-install-db mysys shlwapi) ADD_LIBRARY(winservice STATIC winservice.c) diff --git a/sql/field.cc b/sql/field.cc index b72b0357c23..53d099ce4b7 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7289,6 +7289,19 @@ bool Field_longstr::send(Protocol *protocol) } +const Type_handler *Field_string::type_handler() const +{ + if (is_var_string()) + return &type_handler_var_string; + /* + This is a temporary solution and will be fixed soon (in 10.9?). + Type_handler_string_json will provide its own Field_string_json. + */ + if (Type_handler_json_common::has_json_valid_constraint(this)) + return &type_handler_string_json; + return &type_handler_string; +} + /* Copy a string and fill with space */ int Field_string::store(const char *from, size_t length,CHARSET_INFO *cs) @@ -7554,22 +7567,10 @@ Field_string::compatible_field_size(uint field_metadata, int Field_string::cmp(const uchar *a_ptr, const uchar *b_ptr) const { - size_t a_len, b_len; - - if (mbmaxlen() != 1) - { - size_t char_len= Field_string::char_length(); - a_len= field_charset()->charpos(a_ptr, a_ptr + field_length, char_len); - b_len= field_charset()->charpos(b_ptr, b_ptr + field_length, char_len); - } - else - a_len= b_len= field_length; - /* - We have to remove end space to be able to compare multi-byte-characters - like in latin_de 'ae' and 0xe4 - */ - return field_charset()->strnncollsp(a_ptr, a_len, - b_ptr, b_len); + return field_charset()->coll->strnncollsp_nchars(field_charset(), + a_ptr, field_length, + b_ptr, field_length, + Field_string::char_length()); } @@ -7788,6 +7789,20 @@ en_fieldtype Field_string::tmp_engine_column_type(bool use_packed_rows) const const uint Field_varstring::MAX_SIZE= UINT_MAX16; + +const Type_handler *Field_varstring::type_handler() const +{ + /* + This is a temporary solution and will be fixed soon (in 10.9?). + Type_handler_varchar_json will provide its own Field_varstring_json + and Field_varstring_compressed_json + */ + if (Type_handler_json_common::has_json_valid_constraint(this)) + return &type_handler_varchar_json; + return &type_handler_varchar; +} + + /** Save the field metadata for varstring fields. @@ -7934,19 +7949,6 @@ int Field_varstring::cmp(const uchar *a_ptr, const uchar *b_ptr) const } -static int cmp_str_prefix(const uchar *ua, size_t alen, const uchar *ub, - size_t blen, size_t prefix, CHARSET_INFO *cs) -{ - const char *a= (char*)ua, *b= (char*)ub; - MY_STRCOPY_STATUS status; - prefix/= cs->mbmaxlen; - alen= cs->cset->well_formed_char_length(cs, a, a + alen, prefix, &status); - blen= cs->cset->well_formed_char_length(cs, b, b + blen, prefix, &status); - return cs->coll->strnncollsp(cs, ua, alen, ub, blen); -} - - - int Field_varstring::cmp_prefix(const uchar *a_ptr, const uchar *b_ptr, size_t prefix_len) const { @@ -7966,8 +7968,13 @@ int Field_varstring::cmp_prefix(const uchar *a_ptr, const uchar *b_ptr, a_length= uint2korr(a_ptr); b_length= uint2korr(b_ptr); } - return cmp_str_prefix(a_ptr+length_bytes, a_length, b_ptr+length_bytes, - b_length, prefix_len, field_charset()); + return field_charset()->coll->strnncollsp_nchars(field_charset(), + a_ptr + length_bytes, + a_length, + b_ptr + length_bytes, + b_length, + prefix_len / + field_charset()->mbmaxlen); } @@ -8754,8 +8761,11 @@ int Field_blob::cmp_prefix(const uchar *a_ptr, const uchar *b_ptr, memcpy(&blob1, a_ptr+packlength, sizeof(char*)); memcpy(&blob2, b_ptr+packlength, sizeof(char*)); size_t a_len= get_length(a_ptr), b_len= get_length(b_ptr); - return cmp_str_prefix(blob1, a_len, blob2, b_len, prefix_len, - field_charset()); + return field_charset()->coll->strnncollsp_nchars(field_charset(), + blob1, a_len, + blob2, b_len, + prefix_len / + field_charset()->mbmaxlen); } @@ -8922,6 +8932,15 @@ void Field_blob::sort_string(uchar *to,uint length) */ const Type_handler *Field_blob::type_handler() const { + /* + This is a temporary solution and will be fixed soon (in 10.9?). + Type_handler_*blob_json will provide its own Field_blob_json + and Field_blob_compressed_json. + */ + if (Type_handler_json_common::has_json_valid_constraint(this)) + return Type_handler_json_common:: + json_blob_type_handler_by_length_bytes(packlength); + switch (packlength) { case 1: return &type_handler_tiny_blob; case 2: return &type_handler_blob; @@ -9634,16 +9653,8 @@ bool Field_num::is_equal(const Column_definition &new_field) const } -bool Field_enum::can_optimize_range(const Item_bool_func *cond, - const Item *item, - bool is_eq_func) const -{ - return item->cmp_type() != TIME_RESULT; -} - - -bool Field_enum::can_optimize_keypart_ref(const Item_bool_func *cond, - const Item *item) const +bool Field_enum::can_optimize_range_or_keypart_ref(const Item_bool_func *cond, + const Item *item) const { switch (item->cmp_type()) { diff --git a/sql/field.h b/sql/field.h index 7be16a1457e..0fa577dab96 100644 --- a/sql/field.h +++ b/sql/field.h @@ -4017,12 +4017,7 @@ public: NONE, field_name_arg, collation), can_alter_field_type(1) {}; - const Type_handler *type_handler() const override - { - if (is_var_string()) - return &type_handler_var_string; - return &type_handler_string; - } + const Type_handler *type_handler() const override; enum ha_base_keytype key_type() const override { return binary() ? HA_KEYTYPE_BINARY : HA_KEYTYPE_TEXT; } en_fieldtype tmp_engine_column_type(bool use_packed_rows) const override; @@ -4141,8 +4136,7 @@ public: share->varchar_fields++; } - const Type_handler *type_handler() const override - { return &type_handler_varchar; } + const Type_handler *type_handler() const override; en_fieldtype tmp_engine_column_type(bool use_packed_rows) const override { return FIELD_VARCHAR; @@ -4726,6 +4720,8 @@ private: class Field_enum :public Field_str { static void do_field_enum(Copy_field *copy_field); longlong val_int(const uchar *) const; + bool can_optimize_range_or_keypart_ref(const Item_bool_func *cond, + const Item *item) const; protected: uint packlength; public: @@ -4818,9 +4814,12 @@ public: uint param_data) override; bool can_optimize_keypart_ref(const Item_bool_func *cond, - const Item *item) const override; - bool can_optimize_group_min_max(const Item_bool_func *, const Item *) - const override + const Item *item) const override + { + return can_optimize_range_or_keypart_ref(cond, item); + } + bool can_optimize_group_min_max(const Item_bool_func *cond, + const Item *const_item) const override { /* Can't use GROUP_MIN_MAX optimization for ENUM and SET, @@ -4833,7 +4832,10 @@ public: } bool can_optimize_range(const Item_bool_func *cond, const Item *item, - bool is_eq_func) const override; + bool is_eq_func) const override + { + return can_optimize_range_or_keypart_ref(cond, item); + } Binlog_type_info binlog_type_info() const override; private: bool is_equal(const Column_definition &new_field) const override; diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index f17abed82ff..06be234fb13 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -4106,8 +4106,9 @@ int ha_partition::external_lock(THD *thd, int lock_type) These commands may be excluded because working history partition is needed only for versioned DML. */ thd->lex->sql_command != SQLCOM_SELECT && - thd->lex->sql_command != SQLCOM_INSERT_SELECT) - m_part_info->vers_set_hist_part(thd); + thd->lex->sql_command != SQLCOM_INSERT_SELECT && + (error= m_part_info->vers_set_hist_part(thd))) + goto err_handler; } DBUG_RETURN(0); @@ -4244,7 +4245,7 @@ int ha_partition::start_stmt(THD *thd, thr_lock_type lock_type) i= bitmap_get_next_set(&m_part_info->lock_partitions, i)) { if (unlikely((error= m_file[i]->start_stmt(thd, lock_type)))) - break; + DBUG_RETURN(error); /* Add partition to be called in reset(). */ bitmap_set_bit(&m_partitions_to_reset, i); } @@ -4256,7 +4257,7 @@ int ha_partition::start_stmt(THD *thd, thr_lock_type lock_type) // TODO: MDEV-20345 (see above) thd->lex->sql_command != SQLCOM_SELECT && thd->lex->sql_command != SQLCOM_INSERT_SELECT) - m_part_info->vers_set_hist_part(thd); + error= m_part_info->vers_set_hist_part(thd); } DBUG_RETURN(error); } diff --git a/sql/ha_sequence.cc b/sql/ha_sequence.cc index 596f8584041..2447242593c 100644 --- a/sql/ha_sequence.cc +++ b/sql/ha_sequence.cc @@ -30,6 +30,10 @@ #include "sql_base.h" #include "log_event.h" +#ifdef WITH_WSREP +#include "wsrep_trans_observer.h" /* wsrep_start_transaction() */ +#endif + /* Table flags we should inherit and disable from the original engine. We add HA_STATS_RECORDS_IS_EXACT as ha_sequence::info() will ensure @@ -204,6 +208,7 @@ int ha_sequence::write_row(const uchar *buf) int error; sequence_definition tmp_seq; bool sequence_locked; + THD *thd= table->in_use; DBUG_ENTER("ha_sequence::write_row"); DBUG_ASSERT(table->record[0] == buf); @@ -245,8 +250,6 @@ int ha_sequence::write_row(const uchar *buf) on master and slaves - Check that the new row is an accurate SEQUENCE object */ - - THD *thd= table->in_use; if (table->s->tmp_table == NO_TMP_TABLE && thd->mdl_context.upgrade_shared_lock(table->mdl_ticket, MDL_EXCLUSIVE, @@ -265,6 +268,16 @@ int ha_sequence::write_row(const uchar *buf) sequence->write_lock(table); } +#ifdef WITH_WSREP + /* We need to start Galera transaction for select NEXT VALUE FOR + sequence if it is not yet started. Note that ALTER is handled + as TOI. */ + if (WSREP_ON && WSREP(thd) && + !thd->wsrep_trx().active() && + wsrep_thd_is_local(thd)) + wsrep_start_transaction(thd, thd->wsrep_next_trx_id()); +#endif + if (likely(!(error= file->update_first_row(buf)))) { Log_func *log_func= Write_rows_log_event::binlog_row_logging_function; diff --git a/sql/handler.cc b/sql/handler.cc index 9c4c6287950..269115bc0da 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1762,14 +1762,13 @@ int ha_commit_trans(THD *thd, bool all) #endif TR_table trt(thd, true); if (trt.update(trx_start_id, trx_end_id)) -#ifdef WITH_WSREP { +#ifdef WITH_WSREP thd->variables.wsrep_on= saved_wsrep_on; #endif + (void) trans_rollback_stmt(thd); goto err; -#ifdef WITH_WSREP } -#endif // Here, the call will not commit inside InnoDB. It is only working // around closing thd->transaction.stmt open by TR_table::open(). if (all) @@ -2203,7 +2202,8 @@ int ha_rollback_trans(THD *thd, bool all) Thanks to possibility of MDL deadlock rollback request can come even if transaction hasn't been started in any transactional storage engine. */ - if (thd->transaction_rollback_request) + if (thd->transaction_rollback_request && + thd->transaction->xid_state.is_explicit_XA()) thd->transaction->xid_state.set_error(thd->get_stmt_da()->sql_errno()); thd->has_waiter= false; @@ -4532,6 +4532,9 @@ void handler::print_error(int error, myf errflag) case HA_ERR_COMMIT_ERROR: textno= ER_ERROR_DURING_COMMIT; break; + case HA_ERR_PARTITION_LIST: + my_error(ER_VERS_NOT_ALLOWED, errflag, table->s->db.str, table->s->table_name.str); + DBUG_VOID_RETURN; default: { /* The error was "unknown" to this function. @@ -8301,6 +8304,8 @@ bool Table_scope_and_contents_source_st::vers_fix_system_fields( List_iterator<Create_field> it(alter_info->create_list); while (Create_field *f= it++) { + if (f->vers_sys_field()) + continue; if ((f->versioning == Column_definition::VERSIONING_NOT_SET && !add_versioning) || f->versioning == Column_definition::WITHOUT_VERSIONING) { @@ -8322,9 +8327,10 @@ bool Table_scope_and_contents_source_st::vers_check_system_fields( if (!(options & HA_VERSIONED_TABLE)) return false; + uint versioned_fields= 0; + if (!(alter_info->flags & ALTER_DROP_SYSTEM_VERSIONING)) { - uint versioned_fields= 0; uint fieldnr= 0; List_iterator<Create_field> field_it(alter_info->create_list); while (Create_field *f= field_it++) @@ -8355,7 +8361,7 @@ bool Table_scope_and_contents_source_st::vers_check_system_fields( } } - if (!(alter_info->flags & ALTER_ADD_SYSTEM_VERSIONING)) + if (!(alter_info->flags & ALTER_ADD_SYSTEM_VERSIONING) && !versioned_fields) return false; return vers_info.check_sys_fields(table_name, db, alter_info); diff --git a/sql/handler.h b/sql/handler.h index fe61666bf20..8ad521e189a 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -353,9 +353,18 @@ enum chf_create_flags { run ANALYZE TABLE on it */ #define HA_ONLINE_ANALYZE (1ULL << 59) +/* + Rowid's are not comparable. This is set if the rowid is unique to the + current open handler, like it is with federated where the rowid is a + pointer to a local result set buffer. The effect of having this set is + that the optimizer will not consirer the following optimizations for + the table: + ror scans or filtering +*/ +#define HA_NON_COMPARABLE_ROWID (1ULL << 60) /* Implements SELECT ... FOR UPDATE SKIP LOCKED */ -#define HA_CAN_SKIP_LOCKED (1ULL << 60) +#define HA_CAN_SKIP_LOCKED (1ULL << 61) #define HA_LAST_TABLE_FLAG HA_CAN_SKIP_LOCKED @@ -3283,6 +3292,9 @@ public: Rowid_filter *pushed_rowid_filter; /* true when the pushed rowid filter has been already filled */ bool rowid_filter_is_active; + /* Used for disabling/enabling pushed_rowid_filter */ + Rowid_filter *save_pushed_rowid_filter; + bool save_rowid_filter_is_active; Discrete_interval auto_inc_interval_for_cur_row; /** @@ -3404,6 +3416,8 @@ public: pushed_idx_cond_keyno(MAX_KEY), pushed_rowid_filter(NULL), rowid_filter_is_active(0), + save_pushed_rowid_filter(NULL), + save_rowid_filter_is_active(false), auto_inc_intervals_count(0), m_psi(NULL), m_psi_batch_mode(PSI_BATCH_MODE_NONE), @@ -4488,6 +4502,27 @@ public: rowid_filter_is_active= false; } + virtual void disable_pushed_rowid_filter() + { + DBUG_ASSERT(pushed_rowid_filter != NULL && + save_pushed_rowid_filter == NULL); + save_pushed_rowid_filter= pushed_rowid_filter; + if (rowid_filter_is_active) + save_rowid_filter_is_active= rowid_filter_is_active; + pushed_rowid_filter= NULL; + rowid_filter_is_active= false; + } + + virtual void enable_pushed_rowid_filter() + { + DBUG_ASSERT(save_pushed_rowid_filter != NULL && + pushed_rowid_filter == NULL); + pushed_rowid_filter= save_pushed_rowid_filter; + if (save_rowid_filter_is_active) + rowid_filter_is_active= true; + save_pushed_rowid_filter= NULL; + } + virtual bool rowid_filter_push(Rowid_filter *rowid_filter) { return true; } /* Needed for partition / spider */ diff --git a/sql/item.cc b/sql/item.cc index e0456edfee0..09c83a341c6 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -71,12 +71,11 @@ bool cmp_items(Item *a, Item *b) /** Set max_sum_func_level if it is needed */ -inline void set_max_sum_func_level(SELECT_LEX *select) +inline void set_max_sum_func_level(THD *thd, SELECT_LEX *select) { - LEX *lex_s= select->parent_lex; - if (lex_s->in_sum_func && - lex_s->in_sum_func->nest_level >= select->nest_level) - set_if_bigger(lex_s->in_sum_func->max_sum_func_level, + if (thd->lex->in_sum_func && + thd->lex->in_sum_func->nest_level >= select->nest_level) + set_if_bigger(thd->lex->in_sum_func->max_sum_func_level, select->nest_level - 1); } @@ -655,7 +654,6 @@ Item_ident::Item_ident(THD *thd, Name_resolution_context *context_arg, can_be_depended(TRUE), alias_name_used(FALSE) { name= field_name_arg; - DBUG_ASSERT(!context || context->select_lex); } @@ -673,7 +671,6 @@ Item_ident::Item_ident(THD *thd, TABLE_LIST *view_arg, can_be_depended(TRUE), alias_name_used(FALSE) { name= field_name_arg; - DBUG_ASSERT(!context || context->select_lex); } @@ -695,9 +692,7 @@ Item_ident::Item_ident(THD *thd, Item_ident *item) cached_field_index(item->cached_field_index), can_be_depended(item->can_be_depended), alias_name_used(item->alias_name_used) -{ - DBUG_ASSERT(!context || context->select_lex); -} +{} void Item_ident::cleanup() { @@ -3119,17 +3114,6 @@ Item_field::Item_field(THD *thd, Item_field *item) } -bool Item_field::is_json_type() -{ - if (!field->check_constraint || - field->check_constraint->expr->type() != FUNC_ITEM) - return FALSE; - - Item_func *f= (Item_func *) field->check_constraint->expr; - return f->functype() == Item_func::JSON_VALID_FUNC; -} - - void Item_field::set_field(Field *field_par) { field=result_field=field_par; // for easy coding with fields @@ -5634,7 +5618,6 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference) Name_resolution_context *last_checked_context= context; Item **ref= (Item **) not_found_item; SELECT_LEX *current_sel= context->select_lex; - LEX *lex_s= current_sel->parent_lex; Name_resolution_context *outer_context= 0; SELECT_LEX *select= 0; @@ -5736,18 +5719,19 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference) return -1; thd->change_item_tree(reference, rf); select->inner_refs_list.push_back(rf, thd->mem_root); - rf->in_sum_func= lex_s->in_sum_func; + rf->in_sum_func= thd->lex->in_sum_func; } /* A reference is resolved to a nest level that's outer or the same as the nest level of the enclosing set function : adjust the value of max_arg_level for the function if it's needed. */ - if (lex_s->in_sum_func && - lex_s->in_sum_func->nest_level >= select->nest_level) + if (thd->lex->in_sum_func && + thd->lex == context->select_lex->parent_lex && + thd->lex->in_sum_func->nest_level >= select->nest_level) { Item::Type ref_type= (*reference)->type(); - set_if_bigger(lex_s->in_sum_func->max_arg_level, + set_if_bigger(thd->lex->in_sum_func->max_arg_level, select->nest_level); set_field(*from_field); base_flags|= item_base_t::FIXED; @@ -5768,10 +5752,11 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference) ((ref_type == REF_ITEM || ref_type == FIELD_ITEM) ? (Item_ident*) (*reference) : 0), false); - if (lex_s->in_sum_func && - lex_s->in_sum_func->nest_level >= select->nest_level) + if (thd->lex->in_sum_func && + thd->lex == context->select_lex->parent_lex && + thd->lex->in_sum_func->nest_level >= select->nest_level) { - set_if_bigger(lex_s->in_sum_func->max_arg_level, + set_if_bigger(thd->lex->in_sum_func->max_arg_level, select->nest_level); } /* @@ -5864,7 +5849,7 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference) { outer_context->select_lex->inner_refs_list.push_back((Item_outer_ref*)rf, thd->mem_root); - ((Item_outer_ref*)rf)->in_sum_func= lex_s->in_sum_func; + ((Item_outer_ref*)rf)->in_sum_func= thd->lex->in_sum_func; } thd->change_item_tree(reference, rf); /* @@ -5879,7 +5864,7 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference) We can not "move" aggregate function in the place where its arguments are not defined. */ - set_max_sum_func_level(select); + set_max_sum_func_level(thd, select); mark_as_dependent(thd, last_checked_context->select_lex, context->select_lex, rf, rf, false); @@ -5892,7 +5877,7 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference) We can not "move" aggregate function in the place where its arguments are not defined. */ - set_max_sum_func_level(select); + set_max_sum_func_level(thd, select); mark_as_dependent(thd, last_checked_context->select_lex, context->select_lex, this, (Item_ident*)*reference, false); @@ -5972,20 +5957,18 @@ bool Item_field::fix_fields(THD *thd, Item **reference) Field *from_field= (Field *)not_found_field; bool outer_fixed= false; SELECT_LEX *select; - LEX *lex_s; if (context) { select= context->select_lex; - lex_s= context->select_lex->parent_lex; } else { // No real name resolution, used somewhere in SP DBUG_ASSERT(field); select= NULL; - lex_s= NULL; } + if (select && select->in_tvc) { my_error(ER_FIELD_REFERENCE_IN_TVC, MYF(0), full_name()); @@ -6053,7 +6036,7 @@ bool Item_field::fix_fields(THD *thd, Item **reference) We can not "move" aggregate function in the place where its arguments are not defined. */ - set_max_sum_func_level(select); + set_max_sum_func_level(thd, select); set_field(new_field); depended_from= (*((Item_field**)res))->depended_from; return 0; @@ -6082,7 +6065,7 @@ bool Item_field::fix_fields(THD *thd, Item **reference) We can not "move" aggregate function in the place where its arguments are not defined. */ - set_max_sum_func_level(select); + set_max_sum_func_level(thd, select); return FALSE; } } @@ -6119,11 +6102,12 @@ bool Item_field::fix_fields(THD *thd, Item **reference) goto mark_non_agg_field; } - if (lex_s && - lex_s->in_sum_func && - lex_s->in_sum_func->nest_level == + if (!thd->lex->current_select->no_wrap_view_item && + thd->lex->in_sum_func && + thd->lex == select->parent_lex && + thd->lex->in_sum_func->nest_level == select->nest_level) - set_if_bigger(lex_s->in_sum_func->max_arg_level, + set_if_bigger(thd->lex->in_sum_func->max_arg_level, select->nest_level); /* if it is not expression from merged VIEW we will set this field. @@ -6189,9 +6173,8 @@ bool Item_field::fix_fields(THD *thd, Item **reference) if (field->vcol_info) fix_session_vcol_expr_for_read(thd, field, field->vcol_info); if (thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY && - !outer_fixed && + !outer_fixed && !thd->lex->in_sum_func && select && - !lex_s->in_sum_func && select->cur_pos_in_select_list != UNDEF_POS && select->join) { @@ -6226,13 +6209,13 @@ mark_non_agg_field: */ select_lex= context->select_lex; } - if (!lex_s || !lex_s->in_sum_func) + if (!thd->lex->in_sum_func) select_lex->set_non_agg_field_used(true); else { if (outer_fixed) - lex_s->in_sum_func->outer_fields.push_back(this, thd->mem_root); - else if (lex_s->in_sum_func->nest_level != + thd->lex->in_sum_func->outer_fields.push_back(this, thd->mem_root); + else if (thd->lex->in_sum_func->nest_level != select->nest_level) select_lex->set_non_agg_field_used(true); } @@ -7689,12 +7672,6 @@ Item *get_field_item_for_having(THD *thd, Item *item, st_select_lex *sel) return NULL; } -Item *Item_ident::derived_field_transformer_for_having(THD *thd, uchar *arg) -{ - st_select_lex *sel= (st_select_lex *)arg; - context= &sel->context; - return this; -} Item *Item_field::derived_field_transformer_for_having(THD *thd, uchar *arg) { @@ -7983,9 +7960,7 @@ bool Item_ref::fix_fields(THD *thd, Item **reference) { enum_parsing_place place= NO_MATTER; DBUG_ASSERT(fixed() == 0); - SELECT_LEX *current_sel= context->select_lex; - LEX *lex_s= context->select_lex->parent_lex; if (set_properties_only) { @@ -8147,10 +8122,11 @@ bool Item_ref::fix_fields(THD *thd, Item **reference) the nest level of the enclosing set function : adjust the value of max_arg_level for the function if it's needed. */ - if (lex_s->in_sum_func && - lex_s->in_sum_func->nest_level >= + if (thd->lex->in_sum_func && + thd->lex == context->select_lex->parent_lex && + thd->lex->in_sum_func->nest_level >= last_checked_context->select_lex->nest_level) - set_if_bigger(lex_s->in_sum_func->max_arg_level, + set_if_bigger(thd->lex->in_sum_func->max_arg_level, last_checked_context->select_lex->nest_level); return FALSE; } @@ -8170,10 +8146,11 @@ bool Item_ref::fix_fields(THD *thd, Item **reference) the nest level of the enclosing set function : adjust the value of max_arg_level for the function if it's needed. */ - if (lex_s->in_sum_func && - lex_s->in_sum_func->nest_level >= + if (thd->lex->in_sum_func && + thd->lex == context->select_lex->parent_lex && + thd->lex->in_sum_func->nest_level >= last_checked_context->select_lex->nest_level) - set_if_bigger(lex_s->in_sum_func->max_arg_level, + set_if_bigger(thd->lex->in_sum_func->max_arg_level, last_checked_context->select_lex->nest_level); } } @@ -9694,6 +9671,7 @@ bool Item_default_value::val_native_result(THD *thd, Native *to) return Item_field::val_native_result(thd, to); } + table_map Item_default_value::used_tables() const { if (!field || !field->default_value) diff --git a/sql/item.h b/sql/item.h index 636ec47b43e..46a513023dd 100644 --- a/sql/item.h +++ b/sql/item.h @@ -2064,7 +2064,6 @@ public: table during query processing (grouping and so on) */ virtual bool is_result_field() { return 0; } - virtual bool is_json_type() { return false; } virtual bool is_bool_literal() const { return false; } /* This is to handle printing of default values */ virtual bool need_parentheses_in_default() { return false; } @@ -3504,7 +3503,6 @@ public: Collect outer references */ bool collect_outer_ref_processor(void *arg) override; - Item *derived_field_transformer_for_having(THD *thd, uchar *arg) override; friend bool insert_fields(THD *thd, Name_resolution_context *context, const char *db_name, const char *table_name, List_iterator<Item> *it, @@ -3568,7 +3566,6 @@ public: my_decimal *val_decimal_result(my_decimal *) override; bool val_bool_result() override; bool is_null_result() override; - bool is_json_type() override; bool send(Protocol *protocol, st_value *buffer) override; Load_data_outvar *get_load_data_outvar() override { return this; } bool load_data_set_null(THD *thd, const Load_data_param *param) override @@ -5639,7 +5636,6 @@ public: { return ref ? (*ref)->get_typelib() : NULL; } - bool is_json_type() override { return (*ref)->is_json_type(); } bool walk(Item_processor processor, bool walk_subquery, void *arg) override { diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index fefb2a1c662..89ac59098ac 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -1,4 +1,4 @@ -/* 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 @@ -133,16 +133,17 @@ static int json_nice(json_engine_t *je, String *nice_js, Item_func_json_format::formats mode, int tab_size=4) { int depth= 0; - const char *comma, *colon; + static const char *comma= ", ", *colon= "\": "; uint comma_len, colon_len; int first_value= 1; - DBUG_ASSERT(je->s.cs == nice_js->charset()); + nice_js->length(0); + nice_js->set_charset(je->s.cs); + nice_js->alloc(je->s.str_end - je->s.c_str + 32); + DBUG_ASSERT(mode != Item_func_json_format::DETAILED || (tab_size >= 0 && tab_size <= TAB_SIZE_LIMIT)); - comma= ", "; - colon= "\": "; if (mode == Item_func_json_format::LOOSE) { comma_len= 2; @@ -239,7 +240,7 @@ handle_value: }; } while (json_scan_next(je) == 0); - return je->s.error; + return je->s.error || *je->killed_ptr; error: return 1; @@ -933,8 +934,6 @@ String *Item_func_json_extract::read_json(String *str, js= str; json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), (const uchar *) js->ptr() + js->length()); - tmp_js.length(0); - tmp_js.set_charset(js->charset()); if (json_nice(&je, &tmp_js, Item_func_json_format::LOOSE)) goto error; @@ -1512,6 +1511,32 @@ null_return: } +/* + This reproduces behavior according to the former + Item_func_conv_charset::is_json_type() which returned args[0]->is_json_type(). + JSON functions with multiple string input with different character sets + wrap some arguments into Item_func_conv_charset. So the former + Item_func_conv_charset::is_json_type() took the JSON propery from args[0], + i.e. from the original argument before the conversion. + This is probably not always correct because an *explicit* + `CONVERT(arg USING charset)` is actually a general purpose string + expression, not a JSON expression. +*/ +bool is_json_type(const Item *item) +{ + for ( ; ; ) + { + if (Type_handler_json_common::is_json_type_handler(item->type_handler())) + return true; + const Item_func_conv_charset *func; + if (!(func= dynamic_cast<const Item_func_conv_charset*>(item))) + return false; + item= func->arguments()[0]; + } + return false; +} + + static int append_json_value(String *str, Item *item, String *tmp_val) { if (item->type_handler()->is_bool_type()) @@ -1540,7 +1565,7 @@ static int append_json_value(String *str, Item *item, String *tmp_val) String *sv= item->val_json(tmp_val); if (item->null_value) goto append_null; - if (item->is_json_type()) + if (is_json_type(item)) return str->append(sv->ptr(), sv->length()); if (item->result_type() == STRING_RESULT) @@ -1586,7 +1611,7 @@ static int append_json_value_from_field(String *str, String *sv= f->val_str(tmp_val, key + offset); if (f->is_null_in_record(key)) goto append_null; - if (i->is_json_type()) + if (is_json_type(i)) return str->append(sv->ptr(), sv->length()); if (i->result_type() == STRING_RESULT) @@ -1714,6 +1739,7 @@ String *Item_func_json_array_append::val_str(String *str) uint n_arg, n_path; size_t str_rest_len; const uchar *ar_end; + THD *thd= current_thd; DBUG_ASSERT(fixed()); @@ -1741,6 +1767,7 @@ String *Item_func_json_array_append::val_str(String *str) json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), (const uchar *) js->ptr() + js->length()); + je.killed_ptr= (uchar*)&thd->killed; c_path->cur_step= c_path->p.steps; @@ -1821,8 +1848,7 @@ String *Item_func_json_array_append::val_str(String *str) json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), (const uchar *) js->ptr() + js->length()); - str->length(0); - str->set_charset(js->charset()); + je.killed_ptr= (uchar*)&thd->killed; if (json_nice(&je, str, Item_func_json_format::LOOSE)) goto js_error; @@ -1832,6 +1858,7 @@ js_error: report_json_error(js, &je, 0); return_null: + thd->check_killed(); // to get the error message right null_value= 1; return 0; } @@ -1842,6 +1869,7 @@ String *Item_func_json_array_insert::val_str(String *str) json_engine_t je; String *js= args[0]->val_json(&tmp_js); uint n_arg, n_path; + THD *thd= current_thd; DBUG_ASSERT(fixed()); @@ -1879,6 +1907,7 @@ String *Item_func_json_array_insert::val_str(String *str) json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), (const uchar *) js->ptr() + js->length()); + je.killed_ptr= (uchar*)&thd->killed; c_path->cur_step= c_path->p.steps; @@ -1918,7 +1947,7 @@ String *Item_func_json_array_insert::val_str(String *str) goto js_error; } - if (unlikely(je.s.error)) + if (unlikely(je.s.error || *je.killed_ptr)) goto js_error; str->length(0); @@ -1962,8 +1991,7 @@ String *Item_func_json_array_insert::val_str(String *str) json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), (const uchar *) js->ptr() + js->length()); - str->length(0); - str->set_charset(js->charset()); + je.killed_ptr= (uchar*)&thd->killed; if (json_nice(&je, str, Item_func_json_format::LOOSE)) goto js_error; @@ -1972,6 +2000,7 @@ String *Item_func_json_array_insert::val_str(String *str) js_error: report_json_error(js, &je, 0); return_null: + thd->check_killed(); // to get the error message right null_value= 1; return 0; } @@ -2130,8 +2159,7 @@ merged_j1: return 2; continue; } - if (json_skip_key(je2) || - json_skip_level(je1)) + if (json_skip_key(je2) || json_skip_level(je1)) return 1; goto continue_j2; } @@ -2231,6 +2259,7 @@ String *Item_func_json_merge::val_str(String *str) json_engine_t je1, je2; String *js1= args[0]->val_json(&tmp_js1), *js2=NULL; uint n_arg; + THD *thd= current_thd; LINT_INIT(js2); if (args[0]->null_value) @@ -2247,9 +2276,11 @@ String *Item_func_json_merge::val_str(String *str) json_scan_start(&je1, js1->charset(),(const uchar *) js1->ptr(), (const uchar *) js1->ptr() + js1->length()); + je1.killed_ptr= (uchar*)&thd->killed; json_scan_start(&je2, js2->charset(),(const uchar *) js2->ptr(), (const uchar *) js2->ptr() + js2->length()); + je2.killed_ptr= (uchar*)&thd->killed; if (do_merge(str, &je1, &je2)) goto error_return; @@ -2271,8 +2302,7 @@ String *Item_func_json_merge::val_str(String *str) json_scan_start(&je1, js1->charset(),(const uchar *) js1->ptr(), (const uchar *) js1->ptr() + js1->length()); - str->length(0); - str->set_charset(js1->charset()); + je1.killed_ptr= (uchar*)&thd->killed; if (json_nice(&je1, str, Item_func_json_format::LOOSE)) goto error_return; @@ -2284,6 +2314,7 @@ error_return: report_json_error(js1, &je1, 0); if (je2.s.error) report_json_error(js2, &je2, n_arg); + thd->check_killed(); // to get the error message right null_return: null_value= 1; return NULL; @@ -2533,6 +2564,7 @@ String *Item_func_json_merge_patch::val_str(String *str) String *js1= args[0]->val_json(&tmp_js1), *js2=NULL; uint n_arg; bool empty_result, merge_to_null; + THD *thd= current_thd; /* To report errors properly if some JSON is invalid. */ je1.s.error= je2.s.error= 0; @@ -2549,6 +2581,7 @@ String *Item_func_json_merge_patch::val_str(String *str) json_scan_start(&je2, js2->charset(),(const uchar *) js2->ptr(), (const uchar *) js2->ptr() + js2->length()); + je2.killed_ptr= (uchar*)&thd->killed; if (merge_to_null) { @@ -2570,6 +2603,7 @@ String *Item_func_json_merge_patch::val_str(String *str) json_scan_start(&je1, js1->charset(),(const uchar *) js1->ptr(), (const uchar *) js1->ptr() + js1->length()); + je1.killed_ptr= (uchar*)&thd->killed; if (do_merge_patch(str, &je1, &je2, &empty_result)) goto error_return; @@ -2598,8 +2632,7 @@ cont_point: json_scan_start(&je1, js1->charset(),(const uchar *) js1->ptr(), (const uchar *) js1->ptr() + js1->length()); - str->length(0); - str->set_charset(js1->charset()); + je1.killed_ptr= (uchar*)&thd->killed; if (json_nice(&je1, str, Item_func_json_format::LOOSE)) goto error_return; @@ -2611,6 +2644,7 @@ error_return: report_json_error(js1, &je1, 0); if (je2.s.error) report_json_error(js2, &je2, n_arg); + thd->check_killed(); // to get the error message right null_return: null_value= 1; return NULL; @@ -2847,6 +2881,7 @@ String *Item_func_json_insert::val_str(String *str) String *js= args[0]->val_json(&tmp_js); uint n_arg, n_path; json_string_t key_name; + THD *thd= current_thd; DBUG_ASSERT(fixed()); @@ -2887,6 +2922,7 @@ String *Item_func_json_insert::val_str(String *str) json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), (const uchar *) js->ptr() + js->length()); + je.killed_ptr= (uchar*)&thd->killed; if (c_path->p.last_step < c_path->p.steps) goto v_found; @@ -3068,7 +3104,7 @@ continue_point: json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), (const uchar *) js->ptr() + js->length()); - str->length(0); + je.killed_ptr= (uchar*)&thd->killed; if (json_nice(&je, str, Item_func_json_format::LOOSE)) goto js_error; @@ -3076,6 +3112,7 @@ continue_point: js_error: report_json_error(js, &je, 0); + thd->check_killed(); // to get the error message right return_null: null_value= 1; return 0; @@ -3099,6 +3136,7 @@ String *Item_func_json_remove::val_str(String *str) String *js= args[0]->val_json(&tmp_js); uint n_arg, n_path; json_string_t key_name; + THD *thd= current_thd; DBUG_ASSERT(fixed()); @@ -3145,6 +3183,7 @@ String *Item_func_json_remove::val_str(String *str) json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), (const uchar *) js->ptr() + js->length()); + je.killed_ptr= (uchar*)&thd->killed; c_path->cur_step= c_path->p.steps; @@ -3253,8 +3292,7 @@ v_found: json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), (const uchar *) js->ptr() + js->length()); - str->length(0); - str->set_charset(js->charset()); + je.killed_ptr= (uchar*)&thd->killed; if (json_nice(&je, str, Item_func_json_format::LOOSE)) goto js_error; @@ -3262,6 +3300,7 @@ v_found: return str; js_error: + thd->check_killed(); // to get the error message right report_json_error(js, &je, 0); null_return: null_value= 1; @@ -3652,6 +3691,7 @@ String *Item_func_json_format::val_str(String *str) String *js= args[0]->val_json(&tmp_js); json_engine_t je; int tab_size= 4; + THD *thd= current_thd; if ((null_value= args[0]->null_value)) return 0; @@ -3675,13 +3715,13 @@ String *Item_func_json_format::val_str(String *str) json_scan_start(&je, js->charset(), (const uchar *) js->ptr(), (const uchar *) js->ptr()+js->length()); + je.killed_ptr= (uchar*)&thd->killed; - str->length(0); - str->set_charset(js->charset()); if (json_nice(&je, str, fmt, tab_size)) { null_value= 1; report_json_error(js, &je, 0); + thd->check_killed(); // to get the error message right return 0; } diff --git a/sql/item_jsonfunc.h b/sql/item_jsonfunc.h index e87b971269b..70993228241 100644 --- a/sql/item_jsonfunc.h +++ b/sql/item_jsonfunc.h @@ -24,7 +24,7 @@ #include "item_cmpfunc.h" // Item_bool_func #include "item_strfunc.h" // Item_str_func #include "item_sum.h" - +#include "sql_type_json.h" class json_path_with_flags { @@ -156,12 +156,9 @@ public: :Item_str_func(thd, a, b) { } Item_json_func(THD *thd, List<Item> &list) :Item_str_func(thd, list) { } - bool is_json_type() override { return true; } - void make_send_field(THD *thd, Send_field *tmp_field) override + const Type_handler *type_handler() const override { - Item_str_func::make_send_field(thd, tmp_field); - static const Lex_cstring fmt(STRING_WITH_LEN("json")); - tmp_field->set_format_name(fmt); + return Type_handler_json_common::json_type_handler(max_length); } }; @@ -692,7 +689,10 @@ public: } Item_func_json_arrayagg(THD *thd, Item_func_json_arrayagg *item) : Item_func_group_concat(thd, item) {} - bool is_json_type() override { return true; } + const Type_handler *type_handler() const override + { + return Type_handler_json_common::json_type_handler_sum(this); + } LEX_CSTRING func_name_cstring() const override { @@ -721,7 +721,6 @@ public: } Item_func_json_objectagg(THD *thd, Item_func_json_objectagg *item); - bool is_json_type() override { return true; } void cleanup() override; enum Sumfunctype sum_func () const override { return JSON_OBJECTAGG_FUNC;} @@ -732,9 +731,7 @@ public: } const Type_handler *type_handler() const override { - if (too_big_for_varchar()) - return &type_handler_blob; - return &type_handler_varchar; + return Type_handler_json_common::json_type_handler_sum(this); } void clear() override; bool add() override; @@ -760,5 +757,6 @@ public: { return get_item_copy<Item_func_json_objectagg>(thd, this); } }; +extern bool is_json_type(const Item *item); #endif /* ITEM_JSONFUNC_INCLUDED */ diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index d4bf28a9c21..9f36cbe1ed9 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -741,7 +741,7 @@ String *Item_func_des_encrypt::val_str(String *str) if ((null_value= args[0]->null_value)) return 0; // ENCRYPT(NULL) == NULL if ((res_length=res->length()) == 0) - return make_empty_result(); + return make_empty_result(str); if (arg_count == 1) { /* Protect against someone doing FLUSH DES_KEY_FILE */ @@ -944,7 +944,7 @@ String *Item_func_concat_ws::val_str(String *str) } if (i == arg_count) - return make_empty_result(); + return make_empty_result(str); for (i++; i < arg_count ; i++) { @@ -1095,7 +1095,7 @@ String *Item_func_reverse::val_str(String *str) return 0; /* An empty string is a special case as the string pointer may be null */ if (!res->length()) - return make_empty_result(); + return make_empty_result(str); if (str->alloc(res->length())) { null_value= 1; @@ -1765,7 +1765,7 @@ String *Item_func_left::val_str(String *str) /* if "unsigned_flag" is set, we have a *huge* positive number. */ if ((length <= 0) && (!args[1]->unsigned_flag)) - return make_empty_result(); + return make_empty_result(str); if ((res->length() <= (ulonglong) length) || (res->length() <= (char_pos= res->charpos((int) length)))) return res; @@ -1809,7 +1809,7 @@ String *Item_func_right::val_str(String *str) /* if "unsigned_flag" is set, we have a *huge* positive number. */ if ((length <= 0) && (!args[1]->unsigned_flag)) - return make_empty_result(); /* purecov: inspected */ + return make_empty_result(str); /* purecov: inspected */ if (res->length() <= (ulonglong) length) return res; /* purecov: inspected */ @@ -1851,7 +1851,7 @@ String *Item_func_substr::val_str(String *str) /* Negative or zero length, will return empty string. */ if ((arg_count == 3) && (length <= 0) && (length == 0 || !args[2]->unsigned_flag)) - return make_empty_result(); + return make_empty_result(str); /* Assumes that the maximum length of a String is < INT_MAX32. */ /* Set here so that rest of code sees out-of-bound value as such. */ @@ -1862,12 +1862,12 @@ String *Item_func_substr::val_str(String *str) /* Assumes that the maximum length of a String is < INT_MAX32. */ if ((!args[1]->unsigned_flag && (start < INT_MIN32 || start > INT_MAX32)) || (args[1]->unsigned_flag && ((ulonglong) start > INT_MAX32))) - return make_empty_result(); + return make_empty_result(str); start= ((start < 0) ? res->numchars() + start : start - 1); start= res->charpos((int) start); if ((start < 0) || ((uint) start + 1 > res->length())) - return make_empty_result(); + return make_empty_result(str); length= res->charpos((int) length, (uint32) start); tmp_length= res->length() - start; @@ -1937,7 +1937,7 @@ String *Item_func_substr_index::val_str(String *str) null_value=0; uint delimiter_length= delimiter->length(); if (!res->length() || !delimiter_length || !count) - return make_empty_result(); // Wrong parameters + return make_empty_result(str); // Wrong parameters res->set_charset(collation.collation); @@ -2347,7 +2347,7 @@ String *Item_func_password::val_str_ascii(String *str) switch (alg){ case NEW: if (args[0]->null_value || res->length() == 0) - return make_empty_result(); + return make_empty_result(str); my_make_scrambled_password(tmp_value, res->ptr(), res->length()); str->set(tmp_value, SCRAMBLED_PASSWORD_CHAR_LENGTH, &my_charset_latin1); break; @@ -2355,7 +2355,7 @@ String *Item_func_password::val_str_ascii(String *str) if ((null_value=args[0]->null_value)) return 0; if (res->length() == 0) - return make_empty_result(); + return make_empty_result(str); my_make_scrambled_password_323(tmp_value, res->ptr(), res->length()); str->set(tmp_value, SCRAMBLED_PASSWORD_CHAR_LENGTH_323, &my_charset_latin1); break; @@ -2394,13 +2394,15 @@ char *Item_func_password::alloc(THD *thd, const char *password, String *Item_func_encrypt::val_str(String *str) { DBUG_ASSERT(fixed()); + #ifdef HAVE_CRYPT String *res =args[0]->val_str(str); + char salt[3],*salt_ptr; if ((null_value=args[0]->null_value)) return 0; if (res->length() == 0) - return make_empty_result(); + return make_empty_result(str); if (arg_count == 1) { // generate random salt time_t timestamp=current_thd->query_start(); @@ -2698,8 +2700,8 @@ String *Item_func_soundex::val_str(String *str) for ( ; ; ) /* Skip pre-space */ { if ((rc= cs->mb_wc(&wc, (uchar*) from, (uchar*) end)) <= 0) - return make_empty_result(); /* EOL or invalid byte sequence */ - + return make_empty_result(str); /* EOL or invalid byte sequence */ + if (rc == 1 && cs->m_ctype) { /* Single byte letter found */ @@ -2723,7 +2725,7 @@ String *Item_func_soundex::val_str(String *str) { /* Extra safety - should not really happen */ DBUG_ASSERT(false); - return make_empty_result(); + return make_empty_result(str); } to+= rc; break; @@ -3024,7 +3026,7 @@ String *Item_func_make_set::val_str(String *str) ulonglong bits; bool first_found=0; Item **ptr=args+1; - String *result= make_empty_result(); + String *result= make_empty_result(str); bits=args[0]->val_int(); if ((null_value=args[0]->null_value)) @@ -3048,7 +3050,7 @@ String *Item_func_make_set::val_str(String *str) else { if (tmp_str.copy(*res)) // Don't use 'str' - return make_empty_result(); + return make_empty_result(str); result= &tmp_str; } } @@ -3058,11 +3060,11 @@ String *Item_func_make_set::val_str(String *str) { // Copy data to tmp_str if (tmp_str.alloc(result->length()+res->length()+1) || tmp_str.copy(*result)) - return make_empty_result(); + return make_empty_result(str); result= &tmp_str; } if (tmp_str.append(STRING_WITH_LEN(","), &my_charset_bin) || tmp_str.append(*res)) - return make_empty_result(); + return make_empty_result(str); } } } @@ -3203,7 +3205,7 @@ String *Item_func_repeat::val_str(String *str) null_value= 0; if (count <= 0 && (count == 0 || !args[1]->unsigned_flag)) - return make_empty_result(); + return make_empty_result(str); /* Assumes that the maximum length of a String is < INT_MAX32. */ /* Bounds check on count: If this is triggered, we will error. */ @@ -3268,7 +3270,7 @@ String *Item_func_space::val_str(String *str) null_value= 0; if (count <= 0 && (count == 0 || !args[0]->unsigned_flag)) - return make_empty_result(); + return make_empty_result(str); /* Assumes that the maximum length of a String is < INT_MAX32. Bounds check on count: If this is triggered, we will error. @@ -3435,7 +3437,7 @@ String *Item_func_rpad::val_str(String *str) null_value=0; if (count == 0) - return make_empty_result(); + return make_empty_result(str); /* Assumes that the maximum length of a String is < INT_MAX32. */ /* Set here so that rest of code sees out-of-bound value as such. */ @@ -3527,7 +3529,7 @@ String *Item_func_lpad::val_str(String *str) null_value=0; if (count == 0) - return make_empty_result(); + return make_empty_result(str); /* Assumes that the maximum length of a String is < INT_MAX32. */ /* Set here so that rest of code sees out-of-bound value as such. */ @@ -3898,7 +3900,7 @@ String *Item_func_hex::val_str_ascii_from_val_real(String *str) dec= ~(longlong) 0; else dec= (ulonglong) (val + (val > 0 ? 0.5 : -0.5)); - return str->set_hex(dec) ? make_empty_result() : str; + return str->set_hex(dec) ? make_empty_result(str) : str; } @@ -3909,7 +3911,7 @@ String *Item_func_hex::val_str_ascii_from_val_str(String *str) DBUG_ASSERT(res != str); if ((null_value= (res == NULL))) return NULL; - return str->set_hex(res->ptr(), res->length()) ? make_empty_result() : str; + return str->set_hex(res->ptr(), res->length()) ? make_empty_result(str) : str; } @@ -3918,7 +3920,7 @@ String *Item_func_hex::val_str_ascii_from_val_int(String *str) ulonglong dec= (ulonglong) args[0]->val_int(); if ((null_value= args[0]->null_value)) return 0; - return str->set_hex(dec) ? make_empty_result() : str; + return str->set_hex(dec) ? make_empty_result(str) : str; } diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index ba61206d8d9..c183f1c1ac2 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -3,7 +3,7 @@ /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. - Copyright (c) 2009, 2019, MariaDB + Copyright (c) 2009, 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 @@ -35,21 +35,21 @@ protected: character set. No memory is allocated. @retval A pointer to the str_value member. */ - virtual String *make_empty_result() + virtual String *make_empty_result(String *str) { /* Reset string length to an empty string. We don't use str_value.set() as we don't want to free and potentially have to reallocate the buffer for each call. */ - if (!str_value.is_alloced()) - str_value.set("", 0, collation.collation); /* Avoid null ptrs */ + if (!str->is_alloced()) + str->set("", 0, collation.collation); /* Avoid null ptrs */ else { - str_value.length(0); /* Reuse allocated area */ - str_value.set_charset(collation.collation); + str->length(0); /* Reuse allocated area */ + str->set_charset(collation.collation); } - return &str_value; + return str; } public: Item_str_func(THD *thd): Item_func(thd) { decimals=NOT_FIXED_DEC; } @@ -627,7 +627,7 @@ class Item_func_substr_oracle :public Item_func_substr protected: longlong get_position() override { longlong pos= args[1]->val_int(); return pos == 0 ? 1 : pos; } - String *make_empty_result() override + String *make_empty_result(String *str) override { null_value= 1; return NULL; } public: Item_func_substr_oracle(THD *thd, Item *a, Item *b): @@ -676,7 +676,7 @@ protected: String *trimmed_value(String *res, uint32 offset, uint32 length) { if (length == 0) - return make_empty_result(); + return make_empty_result(&tmp_value); tmp_value.set(*res, offset, length); /* @@ -717,7 +717,7 @@ public: class Item_func_trim_oracle :public Item_func_trim { protected: - String *make_empty_result() override + String *make_empty_result(String *str) override { null_value= 1; return NULL; } LEX_CSTRING func_name_ext() const override { @@ -769,7 +769,7 @@ public: class Item_func_ltrim_oracle :public Item_func_ltrim { protected: - String *make_empty_result() override + String *make_empty_result(String *str) override { null_value= 1; return NULL; } LEX_CSTRING func_name_ext() const override { @@ -817,7 +817,7 @@ public: class Item_func_rtrim_oracle :public Item_func_rtrim { protected: - String *make_empty_result() override + String *make_empty_result(String *str) override { null_value= 1; return NULL; } LEX_CSTRING func_name_ext() const override { @@ -1059,7 +1059,7 @@ public: String *val_str(String *) override; bool fix_length_and_dec() override { - max_length= MAX_FIELD_NAME * system_charset_info->mbmaxlen; + max_length= NAME_CHAR_LEN * system_charset_info->mbmaxlen; set_maybe_null(); return FALSE; } @@ -1414,7 +1414,7 @@ public: class Item_func_rpad_oracle :public Item_func_rpad { - String *make_empty_result() override + String *make_empty_result(String *str) override { null_value= 1; return NULL; } public: Item_func_rpad_oracle(THD *thd, Item *arg1, Item *arg2, Item *arg3): @@ -1457,7 +1457,7 @@ public: class Item_func_lpad_oracle :public Item_func_lpad { - String *make_empty_result() override + String *make_empty_result(String *str) override { null_value= 1; return NULL; } public: Item_func_lpad_oracle(THD *thd, Item *arg1, Item *arg2, Item *arg3): @@ -1774,7 +1774,6 @@ public: (cs->mbmaxlen > 1 || !(cs->state & MY_CS_NONASCII)))); } } - bool is_json_type() override { return args[0]->is_json_type(); } String *val_str(String *) override; longlong val_int() override { diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 58680384f55..c2e322926d9 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -4102,6 +4102,8 @@ int subselect_single_select_engine::exec() tab->save_read_record= tab->read_record.read_record_func; tab->read_record.read_record_func= rr_sequential; tab->read_first_record= read_first_record_seq; + if (tab->rowid_filter) + tab->table->file->disable_pushed_rowid_filter(); tab->read_record.thd= join->thd; tab->read_record.ref_length= tab->table->file->ref_length; tab->read_record.unlock_row= rr_unlock_row; @@ -4122,6 +4124,8 @@ int subselect_single_select_engine::exec() tab->read_record.ref_length= 0; tab->read_first_record= tab->save_read_first_record; tab->read_record.read_record_func= tab->save_read_record; + if (tab->rowid_filter) + tab->table->file->enable_pushed_rowid_filter(); } executed= 1; if (!(uncacheable() & ~UNCACHEABLE_EXPLAIN) && @@ -5307,9 +5311,8 @@ bool subselect_hash_sj_engine::make_semi_join_conds() tmp_table_ref->init_one_table(&empty_clex_str, &table_name, NULL, TL_READ); tmp_table_ref->table= tmp_table; - context= new (thd->mem_root) Name_resolution_context; + context= new Name_resolution_context; context->init(); - context->select_lex= item_in->unit->first_select(); context->first_name_resolution_table= context->last_name_resolution_table= tmp_table_ref; semi_join_conds_context= context; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 5d7de582204..c8a7aca5afb 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -92,7 +92,6 @@ static void store_bit_fields_as_bigint_in_tempory_table(List<Item> *list) bool Item_sum::init_sum_func_check(THD *thd) { SELECT_LEX *curr_sel= thd->lex->current_select; - LEX *lex_s= (curr_sel ? curr_sel->parent_lex : thd->lex); if (curr_sel && curr_sel->name_visibility_map.is_clear_all()) { for (SELECT_LEX *sl= curr_sel; sl; sl= sl->context.outer_select()) @@ -108,9 +107,9 @@ bool Item_sum::init_sum_func_check(THD *thd) return TRUE; } /* Set a reference to the nesting set function if there is any */ - in_sum_func= lex_s->in_sum_func; + in_sum_func= thd->lex->in_sum_func; /* Save a pointer to object to be used in items for nested set functions */ - lex_s->in_sum_func= this; + thd->lex->in_sum_func= this; nest_level= thd->lex->current_select->nest_level; ref_by= 0; aggr_level= -1; @@ -177,7 +176,6 @@ bool Item_sum::init_sum_func_check(THD *thd) bool Item_sum::check_sum_func(THD *thd, Item **ref) { SELECT_LEX *curr_sel= thd->lex->current_select; - LEX *lex_s= curr_sel->parent_lex; nesting_map allow_sum_func(thd->lex->allow_sum_func); allow_sum_func.intersect(curr_sel->name_visibility_map); bool invalid= FALSE; @@ -340,7 +338,7 @@ bool Item_sum::check_sum_func(THD *thd, Item **ref) if (sum_func() == SP_AGGREGATE_FUNC) aggr_sel->set_custom_agg_func_used(true); update_used_tables(); - lex_s->in_sum_func= in_sum_func; + thd->lex->in_sum_func= in_sum_func; return FALSE; } diff --git a/sql/json_table.cc b/sql/json_table.cc index e57dccd00c4..4384da18833 100644 --- a/sql/json_table.cc +++ b/sql/json_table.cc @@ -850,9 +850,11 @@ TABLE *create_table_for_function(THD *thd, TABLE_LIST *sql_table) } -int Json_table_column::set(THD *thd, enum_type ctype, const LEX_CSTRING &path) +int Json_table_column::set(THD *thd, enum_type ctype, const LEX_CSTRING &path, + CHARSET_INFO *cs) { set(ctype); + m_explicit_cs= cs; if (json_path_setup(&m_path, thd->variables.collation_connection, (const uchar *) path.str, (const uchar *)(path.str + path.length))) { diff --git a/sql/json_table.h b/sql/json_table.h index 3560b4ca137..52cdae13e9b 100644 --- a/sql/json_table.h +++ b/sql/json_table.h @@ -159,7 +159,7 @@ public: { m_column_type= ctype; } - int set(THD *thd, enum_type ctype, const LEX_CSTRING &path); + int set(THD *thd, enum_type ctype, const LEX_CSTRING &path, CHARSET_INFO *cs); Json_table_column(Create_field *f, Json_table_nested_path *nest) : m_field(f), m_nest(nest), m_explicit_cs(NULL) { diff --git a/sql/log.cc b/sql/log.cc index da7b2dbda71..c23e7829ece 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1699,7 +1699,7 @@ static int binlog_close_connection(handlerton *hton, THD *thd) binlog_cache_mngr *const cache_mngr= (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton); #ifdef WITH_WSREP - if (cache_mngr && !cache_mngr->trx_cache.empty()) { + if (WSREP(thd) && cache_mngr && !cache_mngr->trx_cache.empty()) { IO_CACHE* cache= cache_mngr->get_binlog_cache_log(true); uchar *buf; size_t len=0; @@ -3709,6 +3709,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name, opt_slave_sql_verify_checksum ? (enum_binlog_checksum_alg) binlog_checksum_options : BINLOG_CHECKSUM_ALG_OFF; s.checksum_alg= relay_log_checksum_alg; + s.set_relay_log_event(); } else s.checksum_alg= (enum_binlog_checksum_alg)binlog_checksum_options; diff --git a/sql/log_event_server.cc b/sql/log_event_server.cc index cc103751b13..af5e90d119b 100644 --- a/sql/log_event_server.cc +++ b/sql/log_event_server.cc @@ -124,6 +124,7 @@ static const char *HA_ERR(int i) case HA_ERR_LOGGING_IMPOSSIBLE: return "HA_ERR_LOGGING_IMPOSSIBLE"; case HA_ERR_CORRUPT_EVENT: return "HA_ERR_CORRUPT_EVENT"; case HA_ERR_ROWS_EVENT_APPLY : return "HA_ERR_ROWS_EVENT_APPLY"; + case HA_ERR_PARTITION_LIST : return "HA_ERR_PARTITION_LIST"; } return "No Error!"; } @@ -2396,7 +2397,8 @@ int Format_description_log_event::do_apply_event(rpl_group_info *rgi) original place when it comes to us; we'll know this by checking log_pos ("artificial" events have log_pos == 0). */ - if (!is_artificial_event() && created && thd->transaction->all.ha_list) + if (!thd->rli_fake && + !is_artificial_event() && created && thd->transaction->all.ha_list) { /* This is not an error (XA is safe), just an information */ rli->report(INFORMATION_LEVEL, 0, NULL, diff --git a/sql/mysql_install_db.cc b/sql/mysql_install_db.cc index f712e29b843..713c6ac4c3f 100644 --- a/sql/mysql_install_db.cc +++ b/sql/mysql_install_db.cc @@ -127,15 +127,6 @@ ATTRIBUTE_NORETURN static void die(const char *fmt, ...) fprintf(stderr, "FATAL ERROR: "); vfprintf(stderr, fmt, args); fputc('\n', stderr); - if (verbose_errors) - { - fprintf(stderr, - "https://mariadb.com/kb/en/installation-issues-on-windows contains some help\n" - "for solving the most common problems. If this doesn't help you, please\n" - "leave a comment in the Knowledge Base or file a bug report at\n" - "https://jira.mariadb.org"); - } - fflush(stderr); va_end(args); my_end(0); exit(1); @@ -252,8 +243,6 @@ int main(int argc, char **argv) DBUG_ASSERT(datadir); - /* Print some help on errors */ - verbose_errors= TRUE; /* Workaround WiX bug (strip possible quote character at the end of path) */ size_t len= strlen(datadir); @@ -286,11 +275,11 @@ int main(int argc, char **argv) Convert slashes in paths into MySQL-compatible form */ -static void convert_slashes(char *s) +static void convert_slashes(char *s, char replacement) { - for (; *s ; s++) - if (*s == '\\') - *s= '/'; + for (; *s; s++) + if (*s == '\\' || *s == '/') + *s= replacement; } @@ -300,15 +289,16 @@ static void convert_slashes(char *s) E.g basedir for C:\my\bin\mysqld.exe would be C:\my */ -static void get_basedir(char *basedir, int size, const char *mysqld_path) +static void get_basedir(char *basedir, int size, const char *mysqld_path, + char slash) { strcpy_s(basedir, size, mysqld_path); - convert_slashes(basedir); - char *p= strrchr(basedir,'/'); + convert_slashes(basedir, '\\'); + char *p= strrchr(basedir, '\\'); if (p) { *p = 0; - p= strrchr(basedir, '/'); + p= strrchr(basedir, '\\'); if (p) *p= 0; } @@ -320,7 +310,7 @@ static void get_basedir(char *basedir, int size, const char *mysqld_path) static char *get_plugindir() { static char plugin_dir[2*MAX_PATH]; - get_basedir(plugin_dir, sizeof(plugin_dir), mysqld_path); + get_basedir(plugin_dir, sizeof(plugin_dir), mysqld_path, '/'); strcat(plugin_dir, "/" STR(INSTALL_PLUGINDIR)); if (access(plugin_dir, 0) == 0) @@ -391,7 +381,7 @@ static int create_myini() } /* Write out server settings. */ - convert_slashes(path_buf); + convert_slashes(path_buf,'/'); write_myini_str("datadir",path_buf); if (opt_skip_networking) @@ -600,7 +590,8 @@ static void clean_directory(const char *dir) (defined as username or group string or as SID) */ -static int set_directory_permissions(const char *dir, const char *os_user) +static int set_directory_permissions(const char *dir, const char *os_user, + DWORD permission) { struct{ @@ -676,12 +667,19 @@ static int set_directory_permissions(const char *dir, const char *os_user) ea.Trustee.TrusteeForm= TRUSTEE_IS_SID; ea.Trustee.ptstrName= (LPTSTR)pSid; } + ea.Trustee.TrusteeType= TRUSTEE_IS_UNKNOWN; ea.grfAccessMode= GRANT_ACCESS; - ea.grfAccessPermissions= GENERIC_ALL; - ea.grfInheritance= CONTAINER_INHERIT_ACE|OBJECT_INHERIT_ACE; - ea.Trustee.TrusteeType= TRUSTEE_IS_UNKNOWN; - ACL* pNewDACL= 0; - SetEntriesInAcl(1,&ea,pOldDACL,&pNewDACL); + ea.grfAccessPermissions= permission; + ea.grfInheritance= CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE; + ACL *pNewDACL= 0; + + ACCESS_MASK access_mask; + if (GetEffectiveRightsFromAcl(pOldDACL, &ea.Trustee, &access_mask) != ERROR_SUCCESS + || (access_mask & permission) != permission) + { + SetEntriesInAcl(1, &ea, pOldDACL, &pNewDACL); + } + if (pNewDACL) { SetSecurityInfo(hDir,SE_FILE_OBJECT,DACL_SECURITY_INFORMATION,NULL, NULL, @@ -695,7 +693,65 @@ static int set_directory_permissions(const char *dir, const char *os_user) return 0; } +static void set_permissions(const char *datadir, const char *service_user) +{ + /* + Set data directory permissions for both current user and + the one who who runs services. + */ + set_directory_permissions(datadir, NULL, + FILE_GENERIC_READ | FILE_GENERIC_WRITE); + if (!service_user) + return; + + /* Datadir permission for the service. */ + set_directory_permissions(datadir, service_user, FILE_ALL_ACCESS); + char basedir[MAX_PATH]; + char path[MAX_PATH]; + struct + { + const char *subdir; + DWORD perm; + } all_subdirs[]= { + {STR(INSTALL_PLUGINDIR), FILE_GENERIC_READ | FILE_GENERIC_EXECUTE}, + {STR(INSTALL_SHAREDIR), FILE_GENERIC_READ}, + }; + + + if (strncmp(service_user,"NT SERVICE\\",sizeof("NT SERVICE\\")-1) == 0) + { + /* + Read and execute permission for executables can/should be given + to any service account, rather than specific one. + */ + service_user="NT SERVICE\\ALL SERVICES"; + } + + get_basedir(basedir, sizeof(basedir), mysqld_path, '\\'); + for (int i= 0; i < array_elements(all_subdirs); i++) + { + auto subdir= + snprintf(path, sizeof(path), "%s\\%s", basedir, all_subdirs[i].subdir); + if (access(path, 0) == 0) + { + set_directory_permissions(path, service_user, all_subdirs[i].perm); + } + } + + /* Bindir, the directory where mysqld_path is located. */ + strcpy_s(path, mysqld_path); + char *end= strrchr(path, '/'); + if (!end) + end= strrchr(path, '\\'); + if (end) + *end= 0; + if (access(path, 0) == 0) + { + set_directory_permissions(path, service_user, + FILE_GENERIC_READ | FILE_GENERIC_EXECUTE); + } +} /* Create database instance (including registering as service etc) .*/ @@ -776,19 +832,13 @@ static int create_db_instance(const char *datadir) goto end; service_created = true; } + + set_permissions(datadir, service_user.c_str()); + if (opt_large_pages) { handle_user_privileges(service_user.c_str(), L"SeLockMemoryPrivilege", true); } - /* - Set data directory permissions for both current user and - the one who who runs services. - */ - set_directory_permissions(datadir, NULL); - if (!service_user.empty()) - { - set_directory_permissions(datadir, service_user.c_str()); - } /* Get security descriptor for the data directory. diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e7e5af8a2c8..96abe83c2c5 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1780,6 +1780,7 @@ static void close_connections(void) { wsrep_deinit(true); } + wsrep_sst_auth_free(); #endif /* All threads has now been aborted */ DBUG_PRINT("quit", ("Waiting for threads to die (count=%u)", THD_count::value())); diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 06063cb9ae1..a43979962cc 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -2695,6 +2695,8 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, notnull_cond= head->notnull_cond; if (!records) records++; /* purecov: inspected */ + if (head->file->ha_table_flags() & HA_NON_COMPARABLE_ROWID) + only_single_index_range_scan= 1; if (head->force_index || force_quick_range) scan_time= read_time= DBL_MAX; @@ -3283,6 +3285,25 @@ double records_in_column_ranges(PARAM *param, uint idx, /* + Compare quick select ranges according to number of found rows + If there is equal amounts of rows, use the long key part. + The idea is that if we have keys (a),(a,b) and (a,b,c) and we have + a query like WHERE a=1 and b=1 and c=1, + it is better to use key (a,b,c) than (a) as it will ensure we don't also + use histograms for columns b and c +*/ + +static +int cmp_quick_ranges(TABLE *table, uint *a, uint *b) +{ + int tmp= CMP_NUM(table->opt_range[*a].rows, table->opt_range[*b].rows); + if (tmp) + return tmp; + return -CMP_NUM(table->opt_range[*a].key_parts, table->opt_range[*b].key_parts); +} + + +/* Calculate the selectivity of the condition imposed on the rows of a table SYNOPSIS @@ -3318,10 +3339,10 @@ double records_in_column_ranges(PARAM *param, uint idx, bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond) { - uint keynr; - uint max_quick_key_parts= 0; + uint keynr, range_index, ranges; MY_BITMAP *used_fields= &table->cond_set; - double table_records= (double)table->stat_records(); + double table_records= (double)table->stat_records(); + uint optimal_key_order[MAX_KEY]; DBUG_ENTER("calculate_cond_selectivity_for_table"); table->cond_selectivity= 1.0; @@ -3360,23 +3381,21 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond) Json_writer_object trace_wrapper(thd); Json_writer_array selectivity_for_indexes(thd, "selectivity_for_indexes"); - for (keynr= 0; keynr < table->s->keys; keynr++) - { + /* + Walk through all quick ranges in the order of least found rows. + */ + for (ranges= keynr= 0 ; keynr < table->s->keys; keynr++) if (table->opt_range_keys.is_set(keynr)) - set_if_bigger(max_quick_key_parts, table->opt_range[keynr].key_parts); - } + optimal_key_order[ranges++]= keynr; - /* - Walk through all indexes, indexes where range access uses more keyparts - go first. - */ - for (uint quick_key_parts= max_quick_key_parts; - quick_key_parts; quick_key_parts--) + my_qsort2(optimal_key_order, ranges, + sizeof(optimal_key_order[0]), + (qsort2_cmp) cmp_quick_ranges, table); + + for (range_index= 0 ; range_index < ranges ; range_index++) { - for (keynr= 0; keynr < table->s->keys; keynr++) + uint keynr= optimal_key_order[range_index]; { - if (table->opt_range_keys.is_set(keynr) && - table->opt_range[keynr].key_parts == quick_key_parts) { uint i; uint used_key_parts= table->opt_range[keynr].key_parts; @@ -10268,7 +10287,7 @@ key_or(RANGE_OPT_PARAM *param, SEL_ARG *key1,SEL_ARG *key2) uint max_part_no= MY_MAX(key1->max_part_no, key2->max_part_no); - for (key2=key2->first(); key2; ) + for (key2=key2->first(); ; ) { /* key1 consists of one or more ranges. tmp is the range currently @@ -10282,6 +10301,16 @@ key_or(RANGE_OPT_PARAM *param, SEL_ARG *key1,SEL_ARG *key2) ^ tmp */ + if (key1->min_flag & NO_MIN_RANGE && + key1->max_flag & NO_MAX_RANGE) + { + if (key1->maybe_flag) + return new SEL_ARG(SEL_ARG::MAYBE_KEY); + return 0; // Always true OR + } + if (!key2) + break; + SEL_ARG *tmp=key1->find_range(key2); /* @@ -10352,6 +10381,13 @@ key_or(RANGE_OPT_PARAM *param, SEL_ARG *key1,SEL_ARG *key2) key2->copy_min(tmp); if (!(key1=key1->tree_delete(tmp))) { // Only one key in tree + if (key2->min_flag & NO_MIN_RANGE && + key2->max_flag & NO_MAX_RANGE) + { + if (key2->maybe_flag) + return new SEL_ARG(SEL_ARG::MAYBE_KEY); + return 0; // Always true OR + } key1=key2; key1->make_root(); key2=key2_next; @@ -11667,6 +11703,9 @@ static bool is_key_scan_ror(PARAM *param, uint keynr, uint8 nparts) table_key->user_defined_key_parts); uint pk_number; + if (param->table->file->ha_table_flags() & HA_NON_COMPARABLE_ROWID) + return false; + for (KEY_PART_INFO *kp= table_key->key_part; kp < key_part; kp++) { field_index_t fieldnr= (param->table->key_info[keynr]. diff --git a/sql/opt_split.cc b/sql/opt_split.cc index ad90bf32315..85e2df2dbb3 100644 --- a/sql/opt_split.cc +++ b/sql/opt_split.cc @@ -311,6 +311,8 @@ struct SplM_field_ext_info: public SplM_field_info occurred also in the select list of this join 9. There are defined some keys usable for ref access of fields from C with available statistics. + 10. The select doesn't use WITH ROLLUP (This limitation can probably be + lifted) @retval true if the answer is positive @@ -327,7 +329,8 @@ bool JOIN::check_for_splittable_materialized() (unit->first_select()->next_select()) || // !(3) (derived->prohibit_cond_pushdown) || // !(4) (derived->is_recursive_with_table()) || // !(5) - (table_count == 0 || const_tables == top_join_tab_count)) // !(6) + (table_count == 0 || const_tables == top_join_tab_count) || // !(6) + rollup.state != ROLLUP::STATE_NONE) // (10) return false; if (group_list) // (7.1) { @@ -1060,16 +1063,16 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count, Inject equalities for splitting used by the materialization join @param - remaining_tables used to filter out the equalities that cannot + excluded_tables used to filter out the equalities that cannot be pushed. @details - This function is called by JOIN_TAB::fix_splitting that is used - to fix the chosen splitting of a splittable materialized table T - in the final query execution plan. In this plan the table T - is joined just before the 'remaining_tables'. So all equalities - usable for splitting whose right parts do not depend on any of - remaining tables can be pushed into join for T. + This function injects equalities pushed into a derived table T for which + the split optimization has been chosen by the optimizer. The function + is called by JOIN::inject_splitting_cond_for_all_tables_with_split_op(). + All equalities usable for splitting T whose right parts do not depend on + any of the 'excluded_tables' can be pushed into the where clause of the + derived table T. The function also marks the select that specifies T as UNCACHEABLE_DEPENDENT_INJECTED. @@ -1078,7 +1081,7 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count, true on failure */ -bool JOIN::inject_best_splitting_cond(table_map remaining_tables) +bool JOIN::inject_best_splitting_cond(table_map excluded_tables) { Item *inj_cond= 0; List<Item> *inj_cond_list= &spl_opt_info->inj_cond_list; @@ -1086,7 +1089,7 @@ bool JOIN::inject_best_splitting_cond(table_map remaining_tables) KEY_FIELD *added_key_field; while ((added_key_field= li++)) { - if (remaining_tables & added_key_field->val->used_tables()) + if (excluded_tables & added_key_field->val->used_tables()) continue; if (inj_cond_list->push_back(added_key_field->cond, thd->mem_root)) return true; @@ -1103,7 +1106,7 @@ bool JOIN::inject_best_splitting_cond(table_map remaining_tables) if (inj_cond) inj_cond->fix_fields(thd,0); - if (inject_cond_into_where(inj_cond)) + if (inject_cond_into_where(inj_cond->copy_andor_structure(thd))) return true; select_lex->uncacheable|= UNCACHEABLE_DEPENDENT_INJECTED; @@ -1180,8 +1183,6 @@ bool JOIN_TAB::fix_splitting(SplM_plan_info *spl_plan, memcpy((char *) md_join->best_positions, (char *) spl_plan->best_positions, sizeof(POSITION) * md_join->table_count); - if (md_join->inject_best_splitting_cond(remaining_tables)) - return true; /* This is called for a proper work of JOIN::get_best_combination() called for the join that materializes T @@ -1225,7 +1226,8 @@ bool JOIN::fix_all_splittings_in_plan() if (tab->table->is_splittable()) { SplM_plan_info *spl_plan= cur_pos->spl_plan; - if (tab->fix_splitting(spl_plan, all_tables & ~prev_tables, + if (tab->fix_splitting(spl_plan, + all_tables & ~prev_tables, tablenr < const_tables )) return true; } @@ -1233,3 +1235,44 @@ bool JOIN::fix_all_splittings_in_plan() } return false; } + + +/** + @brief + Inject splitting conditions into WHERE of split derived + + @details + The function calls JOIN_TAB::inject_best_splitting_cond() for each + materialized derived table T used in this join for which the split + optimization has been chosen by the optimizer. It is done in order to + inject equalities pushed into the where clause of the specification + of T that would be helpful to employ the splitting technique. + + @retval + false on success + true on failure +*/ + +bool JOIN::inject_splitting_cond_for_all_tables_with_split_opt() +{ + table_map prev_tables= 0; + table_map all_tables= (table_map(1) << table_count) - 1; + for (uint tablenr= 0; tablenr < table_count; tablenr++) + { + POSITION *cur_pos= &best_positions[tablenr]; + JOIN_TAB *tab= cur_pos->table; + prev_tables|= tab->table->map; + if (!(tab->table->is_splittable() && cur_pos->spl_plan)) + continue; + SplM_opt_info *spl_opt_info= tab->table->spl_opt_info; + JOIN *join= spl_opt_info->join; + /* + Currently the equalities referencing columns of SJM tables with + look-up access cannot be pushed into materialized derived. + */ + if (join->inject_best_splitting_cond((all_tables & ~prev_tables) | + sjm_lookup_tables)) + return true; + } + return false; +} diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 596b5169659..a74ec6ae5fe 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -1613,8 +1613,15 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred) { SELECT_LEX *parent_lex= parent_join->select_lex; TABLE_LIST *emb_tbl_nest= NULL; + TABLE_LIST *orig_tl; List<TABLE_LIST> *emb_join_list= &parent_lex->top_join_list; THD *thd= parent_join->thd; + SELECT_LEX *save_lex; + Item **left; + Item *left_exp; + Item *left_exp_orig; + + uint ncols; DBUG_ENTER("convert_subq_to_sj"); /* @@ -1774,18 +1781,18 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred) because view's tables are inserted after the view) */ - for (tl= (TABLE_LIST*)(parent_lex->table_list.first); tl->next_local; tl= tl->next_local) + for (orig_tl= (TABLE_LIST*)(parent_lex->table_list.first); + orig_tl->next_local; + orig_tl= orig_tl->next_local) {} - tl->next_local= subq_lex->join->tables_list; + orig_tl->next_local= subq_lex->join->tables_list; /* A theory: no need to re-connect the next_global chain */ /* 3. Remove the original subquery predicate from the WHERE/ON */ - // The subqueries were replaced for Item_int(1) earlier - subq_pred->reset_strategy(SUBS_SEMI_JOIN); // for subsequent executions - /*TODO: also reset the 'with_subquery' there. */ + /*TODO: also reset the 'm_with_subquery' there. */ /* n. Adjust the parent_join->table_count counter */ uint table_no= parent_join->table_count; @@ -1820,16 +1827,18 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred) Put the subquery's WHERE into semi-join's sj_on_expr Add the subquery-induced equalities too. */ - SELECT_LEX *save_lex= thd->lex->current_select; + save_lex= thd->lex->current_select; + table_map subq_pred_used_tables; + thd->lex->current_select=subq_lex; - Item **left= subq_pred->left_exp_ptr(); + left= subq_pred->left_exp_ptr(); if ((*left)->fix_fields_if_needed(thd, left)) - DBUG_RETURN(TRUE); - Item *left_exp= *left; - Item *left_exp_orig= subq_pred->left_exp_orig(); + goto restore_tl_and_exit; + left_exp= *left; + left_exp_orig= subq_pred->left_exp_orig(); thd->lex->current_select=save_lex; - table_map subq_pred_used_tables= subq_pred->used_tables(); + subq_pred_used_tables= subq_pred->used_tables(); sj_nest->nested_join->sj_corr_tables= subq_pred_used_tables; sj_nest->nested_join->sj_depends_on= subq_pred_used_tables | left_exp->used_tables(); @@ -1850,7 +1859,7 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred) Item_direct_view_refs doesn't substitute itself with anything in Item_direct_view_ref::fix_fields. */ - uint ncols= sj_nest->sj_in_exprs= left_exp->cols(); + ncols= sj_nest->sj_in_exprs= left_exp->cols(); sj_nest->nested_join->sj_outer_expr_list.empty(); reset_equality_number_for_subq_conds(sj_nest->sj_on_expr); @@ -1872,7 +1881,7 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred) new (thd->mem_root) Item_func_eq(thd, left_exp_orig, subq_lex->ref_pointer_array[0]); if (!item_eq) - DBUG_RETURN(TRUE); + goto restore_tl_and_exit; if (left_exp_orig != left_exp) thd->change_item_tree(item_eq->arguments(), left_exp); item_eq->in_equality_no= 0; @@ -1893,7 +1902,7 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred) Item_func_eq(thd, left_exp_orig->element_index(i), subq_lex->ref_pointer_array[i]); if (!item_eq) - DBUG_RETURN(TRUE); + goto restore_tl_and_exit; DBUG_ASSERT(left_exp->element_index(i)->fixed()); if (left_exp_orig->element_index(i) != left_exp->element_index(i)) @@ -1912,13 +1921,13 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred) Item_row *row= new (thd->mem_root) Item_row(thd, subq_lex->pre_fix); /* fix fields on subquery was call so they should be the same */ if (!row) - DBUG_RETURN(TRUE); + goto restore_tl_and_exit; DBUG_ASSERT(ncols == row->cols()); nested_join->sj_outer_expr_list.push_back(left); Item_func_eq *item_eq= new (thd->mem_root) Item_func_eq(thd, left_exp_orig, row); if (!item_eq) - DBUG_RETURN(TRUE); + goto restore_tl_and_exit; for (uint i= 0; i < row->cols(); i++) { if (row->element_index(i) != subq_lex->ref_pointer_array[i]) @@ -1937,9 +1946,7 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred) we have in here). */ if (sj_nest->sj_on_expr->fix_fields_if_needed(thd, &sj_nest->sj_on_expr)) - { - DBUG_RETURN(TRUE); - } + goto restore_tl_and_exit; /* Walk through sj nest's WHERE and ON expressions and call @@ -1964,9 +1971,7 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred) emb_tbl_nest->on_expr->top_level_item(); if (emb_tbl_nest->on_expr->fix_fields_if_needed(thd, &emb_tbl_nest->on_expr)) - { - DBUG_RETURN(TRUE); - } + goto restore_tl_and_exit; } else { @@ -1980,9 +1985,8 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred) save_lex= thd->lex->current_select; thd->lex->current_select=parent_join->select_lex; if (parent_join->conds->fix_fields_if_needed(thd, &parent_join->conds)) - { - DBUG_RETURN(1); - } + goto restore_tl_and_exit; + thd->lex->current_select=save_lex; parent_join->select_lex->where= parent_join->conds; } @@ -1995,9 +1999,16 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred) parent_lex->ftfunc_list->push_front(ifm, thd->mem_root); } + // The subqueries were replaced for Item_int(1) earlier + subq_pred->reset_strategy(SUBS_SEMI_JOIN); // for subsequent executions + parent_lex->have_merged_subqueries= TRUE; /* Fatal error may have been set to by fix_after_pullout() */ DBUG_RETURN(thd->is_fatal_error); + +restore_tl_and_exit: + orig_tl->next_local= NULL; + DBUG_RETURN(TRUE); } diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 62a3092f369..548a9ed6f67 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -40,7 +40,7 @@ #include "ha_partition.h" -partition_info *partition_info::get_clone(THD *thd) +partition_info *partition_info::get_clone(THD *thd, bool empty_data_and_index_file) { MEM_ROOT *mem_root= thd->mem_root; DBUG_ENTER("partition_info::get_clone"); @@ -60,21 +60,22 @@ partition_info *partition_info::get_clone(THD *thd) { List_iterator<partition_element> subpart_it(part->subpartitions); partition_element *subpart; - partition_element *part_clone= new (mem_root) partition_element(); + partition_element *part_clone= new (mem_root) partition_element(*part); if (!part_clone) DBUG_RETURN(NULL); - - *part_clone= *part; part_clone->subpartitions.empty(); while ((subpart= (subpart_it++))) { - partition_element *subpart_clone= new (mem_root) partition_element(); + partition_element *subpart_clone= new (mem_root) partition_element(*subpart); if (!subpart_clone) DBUG_RETURN(NULL); - - *subpart_clone= *subpart; + if (empty_data_and_index_file) + subpart_clone->data_file_name= subpart_clone->index_file_name= NULL; part_clone->subpartitions.push_back(subpart_clone, mem_root); } + + if (empty_data_and_index_file) + part_clone->data_file_name= part_clone->index_file_name= NULL; clone->partitions.push_back(part_clone, mem_root); part_clone->list_val_list.empty(); List_iterator<part_elem_value> list_val_it(part->list_val_list); @@ -819,8 +820,13 @@ bool partition_info::has_unique_name(partition_element *element) vers_info->interval Limit by fixed time interval vers_info->hist_part (out) Working history partition */ -void partition_info::vers_set_hist_part(THD *thd) +int partition_info::vers_set_hist_part(THD *thd) { + if (table->pos_in_table_list && + table->pos_in_table_list->partition_names) + { + return HA_ERR_PARTITION_LIST; + } if (vers_info->limit) { ha_partition *hp= (ha_partition*)(table->file); @@ -828,9 +834,11 @@ void partition_info::vers_set_hist_part(THD *thd) List_iterator<partition_element> it(partitions); while (next != vers_info->hist_part) next= it++; + DBUG_ASSERT(bitmap_is_set(&read_partitions, next->id)); ha_rows records= hp->part_records(next); while ((next= it++) != vers_info->now_part) { + DBUG_ASSERT(bitmap_is_set(&read_partitions, next->id)); ha_rows next_records= hp->part_records(next); if (next_records == 0) break; @@ -848,13 +856,13 @@ void partition_info::vers_set_hist_part(THD *thd) else vers_info->hist_part= next; } - return; + return 0; } if (vers_info->interval.is_set()) { if (vers_info->hist_part->range_value > thd->query_start()) - return; + return 0; partition_element *next= NULL; List_iterator<partition_element> it(partitions); @@ -865,9 +873,10 @@ void partition_info::vers_set_hist_part(THD *thd) { vers_info->hist_part= next; if (next->range_value > thd->query_start()) - return; + return 0; } } + return 0; } diff --git a/sql/partition_info.h b/sql/partition_info.h index 995147d6766..f2b54d14a49 100644 --- a/sql/partition_info.h +++ b/sql/partition_info.h @@ -326,7 +326,7 @@ public: } ~partition_info() {} - partition_info *get_clone(THD *thd); + partition_info *get_clone(THD *thd, bool empty_data_and_index_file= FALSE); bool set_named_partition_bitmap(const char *part_name, size_t length); bool set_partition_bitmaps(List<String> *partition_names); bool set_partition_bitmaps_from_table(TABLE_LIST *table_list); @@ -400,7 +400,7 @@ public: vers_info->limit= limit; return !limit; } - void vers_set_hist_part(THD *thd); + int vers_set_hist_part(THD *thd); bool vers_fix_field_list(THD *thd); void vers_update_el_ids(); partition_element *get_partition(uint part_id) diff --git a/sql/protocol.cc b/sql/protocol.cc index b2ca946037c..33d865a3f9f 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -465,8 +465,12 @@ bool Protocol::net_send_error_packet(THD *thd, uint sql_errno, const char *err, coming from server to have seq_no > 0, due to missing awareness of "out-of-band" operations. Make these clients happy. */ - if (!net->pkt_nr) - net->pkt_nr= 1; + if (!net->pkt_nr && + (sql_errno == ER_CONNECTION_KILLED || sql_errno == ER_SERVER_SHUTDOWN || + sql_errno == ER_QUERY_INTERRUPTED)) + { + net->pkt_nr= 1; + } ret= net_write_command(net,(uchar) 255, (uchar*) "", 0, (uchar*) buff, length); diff --git a/sql/rowid_filter.cc b/sql/rowid_filter.cc index 4a3746d72db..0589b587ba2 100644 --- a/sql/rowid_filter.cc +++ b/sql/rowid_filter.cc @@ -350,6 +350,9 @@ void TABLE::init_cost_info_for_usable_range_rowid_filters(THD *thd) usable_range_filter_keys.clear_all(); key_map::Iterator it(opt_range_keys); + if (file->ha_table_flags() & HA_NON_COMPARABLE_ROWID) + return; // Cannot create filtering + /* From all indexes that can be used for range accesses select only such that - range filter pushdown is supported by the engine for them (1) diff --git a/sql/rpl_utility_server.cc b/sql/rpl_utility_server.cc index 8110b142e74..ccad7bd0709 100644 --- a/sql/rpl_utility_server.cc +++ b/sql/rpl_utility_server.cc @@ -549,6 +549,8 @@ Field_longstr::rpl_conv_type_from(const Conv_source &source, binlog_type() == MYSQL_TYPE_VARCHAR_COMPRESSED || binlog_type() == MYSQL_TYPE_BLOB_COMPRESSED) same_type= binlog_type() == source.real_field_type(); + else if (Type_handler_json_common::is_json_type_handler(type_handler())) + same_type= type_handler()->type_handler_base() == source.type_handler(); else same_type= type_handler() == source.type_handler(); diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 2d90793b90f..cb191ee6455 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -7080,9 +7080,8 @@ ER_UNUSED_28 eng "You should never see it" spa "Nunca deberÃa vd de ver esto" -ER_UNUSED_1 - eng "You should never see it" - spa "Nunca deberÃa vd de ver esto" +ER_VERS_NOT_ALLOWED + eng "Not allowed for system-versioned table %`s.%`s" ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST eng "INSERT into autoincrement field which is not the first part in the composed primary key is unsafe" diff --git a/sql/slave.cc b/sql/slave.cc index 3c5b830fbe2..e25ad565b07 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -4464,6 +4464,15 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli, #ifdef WITH_WSREP wsrep_after_statement(thd); #endif /* WITH_WSREP */ + DBUG_EXECUTE_IF( + "pause_sql_thread_on_fde", + if (ev && typ == FORMAT_DESCRIPTION_EVENT) { + DBUG_ASSERT(!debug_sync_set_action( + thd, + STRING_WITH_LEN( + "now SIGNAL paused_on_fde WAIT_FOR sql_thread_continue"))); + }); + DBUG_RETURN(exec_res); } mysql_mutex_unlock(&rli->data_lock); diff --git a/sql/sp_head.h b/sql/sp_head.h index 475f1e0d424..0c635146e82 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -625,6 +625,23 @@ public: DBUG_RETURN(false); } + /** + Iterate through the LEX stack from the top (the newest) to the bottom + (the oldest) and find the one that contains a non-zero spname. + @returns - the address of spname, or NULL of no spname found. + */ + const sp_name *find_spname_recursive() + { + uint count= m_lex.elements; + for (uint i= 0; i < count; i++) + { + const LEX *tmp= m_lex.elem(count - i - 1); + if (tmp->spname) + return tmp->spname; + } + return NULL; + } + /// Put the instruction on the backpatch list, associated with the label. int push_backpatch(THD *thd, sp_instr *, sp_label *); @@ -1041,7 +1058,8 @@ public: Query_arena(thd->lex->sphead->get_main_mem_root(), STMT_INITIALIZED_FOR_SP) { } ~sp_lex_cursor() { free_items(); } - void cleanup_stmt(bool /*restore_set_statement_vars*/) { } + virtual bool cleanup_stmt(bool /*restore_set_statement_vars*/) override + { return false; } Query_arena *query_arena() { return this; } bool validate() { @@ -1831,8 +1849,8 @@ public: cursor is closed. For now stored procedures always use materialized cursors and the call is not used. */ - virtual void cleanup_stmt(bool /*restore_set_statement_vars*/) - { /* no op */ } + virtual bool cleanup_stmt(bool /*restore_set_statement_vars*/) override + { return false; } private: sp_lex_keeper m_lex_keeper; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 2d7f62cd725..7d97b1c1b0f 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -2266,6 +2266,12 @@ static int set_user_auth(THD *thd, const LEX_CSTRING &user, goto end; } + if (thd->lex->sql_command == SQLCOM_SET_OPTION && !info->hash_password) + { + res= ER_SET_PASSWORD_AUTH_PLUGIN; + goto end; + } + if (info->hash_password && validate_password(thd, user, host, pwtext, auth->auth_string.length)) { @@ -14337,61 +14343,6 @@ bool acl_authenticate(THD *thd, uint com_change_user_pkt_len) if (initialized) // if not --skip-grant-tables { -#ifndef NO_EMBEDDED_ACCESS_CHECKS - bool is_proxy_user= FALSE; - const char *auth_user = acl_user->user.str; - ACL_PROXY_USER *proxy_user; - /* check if the user is allowed to proxy as another user */ - proxy_user= acl_find_proxy_user(auth_user, sctx->host, sctx->ip, - mpvio.auth_info.authenticated_as, - &is_proxy_user); - if (is_proxy_user) - { - ACL_USER *acl_proxy_user; - - /* we need to find the proxy user, but there was none */ - if (!proxy_user) - { - Host_errors errors; - errors.m_proxy_user= 1; - inc_host_errors(mpvio.auth_info.thd->security_ctx->ip, &errors); - if (!thd->is_error()) - login_failed_error(thd); - DBUG_RETURN(1); - } - - my_snprintf(sctx->proxy_user, sizeof(sctx->proxy_user) - 1, - "'%s'@'%s'", auth_user, - safe_str(acl_user->host.hostname)); - - /* we're proxying : find the proxy user definition */ - mysql_mutex_lock(&acl_cache->lock); - acl_proxy_user= find_user_exact(safe_str(proxy_user->get_proxied_host()), - mpvio.auth_info.authenticated_as); - if (!acl_proxy_user) - { - mysql_mutex_unlock(&acl_cache->lock); - - Host_errors errors; - errors.m_proxy_user_acl= 1; - inc_host_errors(mpvio.auth_info.thd->security_ctx->ip, &errors); - if (!thd->is_error()) - login_failed_error(thd); - DBUG_RETURN(1); - } - acl_user= acl_proxy_user->copy(thd->mem_root); - mysql_mutex_unlock(&acl_cache->lock); - } -#endif - - sctx->master_access= acl_user->access; - strmake_buf(sctx->priv_user, acl_user->user.str); - - if (acl_user->host.hostname) - strmake_buf(sctx->priv_host, acl_user->host.hostname); - else - *sctx->priv_host= 0; - /* OK. Let's check the SSL. Historically it was checked after the password, as an additional layer, not instead of the password @@ -14428,6 +14379,65 @@ bool acl_authenticate(THD *thd, uint com_change_user_pkt_len) sctx->password_expired= password_expired; +#ifndef NO_EMBEDDED_ACCESS_CHECKS + if (!password_expired) + { + bool is_proxy_user= FALSE; + const char *auth_user = acl_user->user.str; + ACL_PROXY_USER *proxy_user; + /* check if the user is allowed to proxy as another user */ + proxy_user= acl_find_proxy_user(auth_user, sctx->host, sctx->ip, + mpvio.auth_info.authenticated_as, + &is_proxy_user); + if (is_proxy_user) + { + ACL_USER *acl_proxy_user; + + /* we need to find the proxy user, but there was none */ + if (!proxy_user) + { + Host_errors errors; + errors.m_proxy_user= 1; + inc_host_errors(mpvio.auth_info.thd->security_ctx->ip, &errors); + if (!thd->is_error()) + login_failed_error(thd); + DBUG_RETURN(1); + } + + my_snprintf(sctx->proxy_user, sizeof(sctx->proxy_user) - 1, + "'%s'@'%s'", auth_user, + safe_str(acl_user->host.hostname)); + + /* we're proxying : find the proxy user definition */ + mysql_mutex_lock(&acl_cache->lock); + acl_proxy_user= find_user_exact(safe_str(proxy_user->get_proxied_host()), + mpvio.auth_info.authenticated_as); + if (!acl_proxy_user) + { + mysql_mutex_unlock(&acl_cache->lock); + + Host_errors errors; + errors.m_proxy_user_acl= 1; + inc_host_errors(mpvio.auth_info.thd->security_ctx->ip, &errors); + if (!thd->is_error()) + login_failed_error(thd); + DBUG_RETURN(1); + } + acl_user= acl_proxy_user->copy(thd->mem_root); + mysql_mutex_unlock(&acl_cache->lock); + } + } +#endif + + sctx->master_access= acl_user->access; + strmake_buf(sctx->priv_user, acl_user->user.str); + + if (acl_user->host.hostname) + strmake_buf(sctx->priv_host, acl_user->host.hostname); + else + *sctx->priv_host= 0; + + /* Don't allow the user to connect if he has done too many queries. As we are testing max_user_connections == 0 here, it means that we diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index 26e3d67641d..e0b324e6342 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -444,52 +444,6 @@ dbug_err: return open_error; } -#ifdef WITH_WSREP -/* - OPTIMIZE, REPAIR and ALTER may take MDL locks not only for the - affected table, but also for the table referenced by foreign key - constraint. - - This wsrep_toi_replication() function handles TOI replication for - OPTIMIZE and REPAIR so that certification keys for potential FK - parent tables are also appended in the write set. ALTER TABLE - case is handled elsewhere. -*/ - -static bool wsrep_toi_replication(THD *thd, TABLE_LIST *tables) -{ - LEX *lex= thd->lex; - /* only handle OPTIMIZE and REPAIR here */ - switch (lex->sql_command) - { - case SQLCOM_OPTIMIZE: - case SQLCOM_REPAIR: - break; - default: - return false; - } - - close_thread_tables(thd); - wsrep::key_array keys; - - wsrep_append_fk_parent_table(thd, tables, &keys); - - /* now TOI replication, with no locks held */ - if (keys.empty()) - { - if (!thd->lex->no_write_to_binlog && - wsrep_to_isolation_begin(thd, NULL, NULL, tables)) - return true; - } - else - { - if (!thd->lex->no_write_to_binlog && - wsrep_to_isolation_begin(thd, NULL, NULL, tables, NULL, &keys)) - return true; - } - return false; -} -#endif /* WITH_WSREP */ static void send_read_only_warning(THD *thd, const LEX_CSTRING *msg_status, @@ -593,16 +547,6 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, close_thread_tables(thd); for (table= tables; table; table= table->next_local) table->table= NULL; -#ifdef WITH_WSREP - if (WSREP(thd)) - { - if(wsrep_toi_replication(thd, tables)) - { - WSREP_INFO("wsrep TOI replication of has failed."); - goto err; - } - } -#endif /* WITH_WSREP */ for (table= tables; table; table= table->next_local) { @@ -1561,6 +1505,7 @@ bool Sql_cmd_optimize_table::execute(THD *thd) FALSE, UINT_MAX, FALSE)) goto error; /* purecov: inspected */ + WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table); res= (specialflag & SPECIAL_NO_NEW_FUNC) ? mysql_recreate_table(thd, first_table, true) : mysql_admin_table(thd, first_table, &m_lex->check_opt, @@ -1569,6 +1514,9 @@ bool Sql_cmd_optimize_table::execute(THD *thd) m_lex->first_select_lex()->table_list.first= first_table; m_lex->query_tables= first_table; +#ifdef WITH_WSREP +wsrep_error_label: +#endif /* WITH_WSREP */ error: DBUG_RETURN(res); } @@ -1584,6 +1532,7 @@ bool Sql_cmd_repair_table::execute(THD *thd) if (check_table_access(thd, SELECT_ACL | INSERT_ACL, first_table, FALSE, UINT_MAX, FALSE)) goto error; /* purecov: inspected */ + WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table); res= mysql_admin_table(thd, first_table, &m_lex->check_opt, &msg_repair, TL_WRITE, 1, MY_TEST(m_lex->check_opt.sql_flags & TT_USEFRM), @@ -1593,6 +1542,9 @@ bool Sql_cmd_repair_table::execute(THD *thd) m_lex->first_select_lex()->table_list.first= first_table; m_lex->query_tables= first_table; +#ifdef WITH_WSREP +wsrep_error_label: +#endif /* WITH_WSREP */ error: DBUG_RETURN(res); } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 414bb5efa25..d75b3e0dcaf 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -4476,6 +4476,7 @@ restart: { enum_sql_command sql_command= thd->lex->sql_command; bool is_dml_stmt= thd->get_command() != COM_STMT_PREPARE && + !thd->stmt_arena->is_stmt_prepare() && (sql_command == SQLCOM_INSERT || sql_command == SQLCOM_INSERT_SELECT || sql_command == SQLCOM_REPLACE || @@ -6425,8 +6426,9 @@ find_field_in_tables(THD *thd, Item_ident *item, TRUE, &(item->cached_field_index)); #ifndef NO_EMBEDDED_ACCESS_CHECKS /* Check if there are sufficient access rights to the found field. */ - if (found && check_privileges && - check_column_grant_in_table_ref(thd, table_ref, name, length, found)) + if (found && check_privileges && !is_temporary_table(table_ref) && + check_column_grant_in_table_ref(thd, table_ref, name, length, + found)) found= WRONG_GRANT; #endif } @@ -6896,7 +6898,6 @@ set_new_item_local_context(THD *thd, Item_ident *item, TABLE_LIST *table_ref) if (!(context= new (thd->mem_root) Name_resolution_context)) return TRUE; context->init(); - context->select_lex= table_ref->select_lex; context->first_name_resolution_table= context->last_name_resolution_table= table_ref; item->context= context; diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 49f42eb95c5..646544c12fe 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1415,6 +1415,8 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) flags.client_long_flag= MY_TEST(thd->client_capabilities & CLIENT_LONG_FLAG); flags.client_protocol_41= MY_TEST(thd->client_capabilities & CLIENT_PROTOCOL_41); + flags.client_extended_metadata= MY_TEST(thd->client_capabilities & + MARIADB_CLIENT_EXTENDED_METADATA); flags.client_depr_eof= MY_TEST(thd->client_capabilities & CLIENT_DEPRECATE_EOF); /* @@ -1447,12 +1449,13 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) flags.div_precision_increment= thd->variables.div_precincrement; flags.default_week_format= thd->variables.default_week_format; DBUG_PRINT("qcache", ("\ -long %d, 4.1: %d, eof: %d, bin_proto: %d, more results %d, pkt_nr: %d, \ +long %d, 4.1: %d, ex metadata: %d, eof: %d, bin_proto: %d, more results %d, pkt_nr: %d, \ CS client: %u, CS result: %u, CS conn: %u, limit: %llu, TZ: %p, \ sql mode: 0x%llx, sort len: %llu, concat len: %u, div_precision: %zu, \ def_week_frmt: %zu, in_trans: %d, autocommit: %d", (int)flags.client_long_flag, (int)flags.client_protocol_41, + (int)flags.client_extended_metadata, (int)flags.client_depr_eof, (int)flags.protocol_type, (int)flags.more_results_exists, @@ -1924,6 +1927,8 @@ Query_cache::send_result_to_client(THD *thd, char *org_sql, uint query_length) flags.client_long_flag= MY_TEST(thd->client_capabilities & CLIENT_LONG_FLAG); flags.client_protocol_41= MY_TEST(thd->client_capabilities & CLIENT_PROTOCOL_41); + flags.client_extended_metadata= MY_TEST(thd->client_capabilities & + MARIADB_CLIENT_EXTENDED_METADATA); flags.client_depr_eof= MY_TEST(thd->client_capabilities & CLIENT_DEPRECATE_EOF); flags.protocol_type= (unsigned int) thd->protocol->type(); @@ -1947,12 +1952,13 @@ Query_cache::send_result_to_client(THD *thd, char *org_sql, uint query_length) flags.default_week_format= thd->variables.default_week_format; flags.lc_time_names= thd->variables.lc_time_names; DBUG_PRINT("qcache", ("\ -long %d, 4.1: %d, eof: %d, bin_proto: %d, more results %d, pkt_nr: %d, \ +long %d, 4.1: %d, ex metadata: %d, eof: %d, bin_proto: %d, more results %d, pkt_nr: %d, \ CS client: %u, CS result: %u, CS conn: %u, limit: %llu, TZ: %p, \ sql mode: 0x%llx, sort len: %llu, concat len: %u, div_precision: %zu, \ def_week_frmt: %zu, in_trans: %d, autocommit: %d", (int)flags.client_long_flag, (int)flags.client_protocol_41, + (int)flags.client_extended_metadata, (int)flags.client_depr_eof, (int)flags.protocol_type, (int)flags.more_results_exists, diff --git a/sql/sql_cache.h b/sql/sql_cache.h index 196acf6fa2e..372d697015e 100644 --- a/sql/sql_cache.h +++ b/sql/sql_cache.h @@ -549,6 +549,7 @@ struct Query_cache_query_flags { unsigned int client_long_flag:1; unsigned int client_protocol_41:1; + unsigned int client_extended_metadata:1; unsigned int client_depr_eof:1; unsigned int protocol_type:2; unsigned int more_results_exists:1; diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 29824301e9d..19318bb1387 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -3845,9 +3845,10 @@ void Query_arena::set_query_arena(Query_arena *set) } -void Query_arena::cleanup_stmt(bool /*restore_set_statement_vars*/) +bool Query_arena::cleanup_stmt(bool /*restore_set_statement_vars*/) { DBUG_ASSERT(! "Query_arena::cleanup_stmt() not implemented"); + return false; } /* diff --git a/sql/sql_class.h b/sql/sql_class.h index df9d89b5aff..a8c37a23fcd 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1232,7 +1232,7 @@ public: void free_items(); /* Close the active state associated with execution of this statement */ - virtual void cleanup_stmt(bool /*restore_set_statement_vars*/); + virtual bool cleanup_stmt(bool /*restore_set_statement_vars*/); }; @@ -5374,9 +5374,9 @@ public: thr_timer_end(&query_timer); #endif } - void restore_set_statement_var() + bool restore_set_statement_var() { - main_lex.restore_set_statement_var(); + return main_lex.restore_set_statement_var(); } /* Copy relevant `stmt` transaction flags to `all` transaction. */ void merge_unsafe_rollback_flags() diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc index 0324e9691e8..0add5845558 100644 --- a/sql/sql_cursor.cc +++ b/sql/sql_cursor.cc @@ -197,7 +197,7 @@ int mysql_open_cursor(THD *thd, select_result *result, } *pcursor= materialized_cursor; - thd->stmt_arena->cleanup_stmt(true); + rc|= (thd->stmt_arena->cleanup_stmt(true)? 1 : 0); } end: diff --git a/sql/sql_i_s.h b/sql/sql_i_s.h index 60a91205bbf..bed2e886718 100644 --- a/sql/sql_i_s.h +++ b/sql/sql_i_s.h @@ -45,13 +45,6 @@ enum enum_show_open_table }; -enum enum_show_default -{ - DEFAULT_TYPE_IMPLICIT= 0, - DEFAULT_NONE -}; - - namespace Show { class Type { @@ -97,29 +90,24 @@ class ST_FIELD_INFO: public Show::Type protected: LEX_CSTRING m_name; // I_S column name enum_nullability m_nullability; // NULLABLE or NOT NULL - enum_show_default m_def; // Whether has a DEFAULT value LEX_CSTRING m_old_name; // SHOW column name enum_show_open_table m_open_method; public: ST_FIELD_INFO(const LEX_CSTRING &name, const Type &type, enum_nullability nullability, - enum_show_default def, LEX_CSTRING &old_name, enum_show_open_table open_method) :Type(type), m_name(name), m_nullability(nullability), - m_def(def), m_old_name(old_name), m_open_method(open_method) { } ST_FIELD_INFO(const char *name, const Type &type, enum_nullability nullability, - enum_show_default def, const char *old_name, enum_show_open_table open_method) :Type(type), m_nullability(nullability), - m_def(def), m_open_method(open_method) { m_name.str= name; @@ -129,7 +117,6 @@ public: } const LEX_CSTRING &name() const { return m_name; } bool nullable() const { return m_nullability == NULLABLE; } - enum_show_default def() const { return m_def; } const LEX_CSTRING &old_name() const { return m_old_name; } enum_show_open_table open_method() const { return m_open_method; } bool end_marker() const { return m_name.str == NULL; } @@ -300,27 +287,15 @@ class Column: public ST_FIELD_INFO public: Column(const char *name, const Type &type, enum_nullability nullability, - enum_show_default def, - const char *old_name, - enum_show_open_table open_method= SKIP_OPEN_TABLE) - :ST_FIELD_INFO(name, type, nullability, def, old_name, open_method) - { } - Column(const char *name, const Type &type, enum_nullability nullability, - enum_show_default def, - enum_show_open_table open_method= SKIP_OPEN_TABLE) - :ST_FIELD_INFO(name, type, nullability, def, NullS, open_method) - { } - Column(const char *name, const Type &type, - enum_nullability nullability, const char *old_name, enum_show_open_table open_method= SKIP_OPEN_TABLE) - :ST_FIELD_INFO(name, type, nullability, DEFAULT_TYPE_IMPLICIT, + :ST_FIELD_INFO(name, type, nullability, old_name, open_method) { } Column(const char *name, const Type &type, enum_nullability nullability, enum_show_open_table open_method= SKIP_OPEN_TABLE) - :ST_FIELD_INFO(name, type, nullability, DEFAULT_TYPE_IMPLICIT, + :ST_FIELD_INFO(name, type, nullability, NullS, open_method) { } }; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 707b8a0d3bf..aecd70f1810 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -2525,6 +2525,11 @@ bool delayed_get_table(THD *thd, MDL_request *grl_protection_request, di->table_list.alias.length= di->table_list.table_name.length= di->thd.query_length(); di->table_list.db= di->thd.db; /* + Nulify select_lex because, if the thread that spawned the current one + disconnects, the select_lex will point to freed memory. + */ + di->table_list.select_lex= NULL; + /* We need the tickets so that they can be cloned in handle_delayed_insert */ @@ -3183,6 +3188,8 @@ pthread_handler_t handle_delayed_insert(void *arg) di->handler_thread_initialized= TRUE; di->table_list.mdl_request.ticket= NULL; + thd->set_query_id(next_query_id()); + if (di->open_and_lock_table()) goto err; @@ -3301,6 +3308,7 @@ pthread_handler_t handle_delayed_insert(void *arg) if (di->tables_in_use && ! thd->lock && (!thd->killed || di->stacked_inserts)) { + thd->set_query_id(next_query_id()); /* Request for new delayed insert. Lock the table, but avoid to be blocked by a global read lock. diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index b5f8cf4a886..3a38824e819 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -5902,18 +5902,19 @@ void LEX::free_arena_for_set_stmt() DBUG_VOID_RETURN; } -void LEX::restore_set_statement_var() +bool LEX::restore_set_statement_var() { + bool err= false; DBUG_ENTER("LEX::restore_set_statement_var"); if (!old_var_list.is_empty()) { DBUG_PRINT("info", ("vars: %d", old_var_list.elements)); - sql_set_variables(thd, &old_var_list, false); + err= sql_set_variables(thd, &old_var_list, false); old_var_list.empty(); free_arena_for_set_stmt(); } DBUG_ASSERT(!is_arena_for_set_stmt()); - DBUG_VOID_RETURN; + DBUG_RETURN(err); } unit_common_op st_select_lex_unit::common_op() diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 14cf90caa04..79d48528574 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -3793,7 +3793,7 @@ public: int print_explain(select_result_sink *output, uint8 explain_flags, bool is_analyze, bool *printed_anything); - void restore_set_statement_var(); + bool restore_set_statement_var(); void init_last_field(Column_definition *field, const LEX_CSTRING *name, const CHARSET_INFO *cs); diff --git a/sql/sql_locale.cc b/sql/sql_locale.cc index 45f81da80c9..fb7fa26f245 100644 --- a/sql/sql_locale.cc +++ b/sql/sql_locale.cc @@ -563,8 +563,8 @@ MY_LOCALE my_locale_es_ES 10, 9, ',', /* decimal point es_ES */ - '\0', /* thousands_sep es_ES */ - "\x80\x80", /* grouping es_ES */ + '.', /* thousands_sep es_ES */ + "\x03\x03", /* grouping es_ES */ &global_errmsgs[es_ES] ); /***** LOCALE END es_ES *****/ @@ -2649,8 +2649,8 @@ MY_LOCALE my_locale_es_BO 10, 9, ',', /* decimal point es_BO */ - '\0', /* thousands_sep es_BO */ - "\x80\x80", /* grouping es_BO */ + '.', /* thousands_sep es_BO */ + "\x03\x03", /* grouping es_BO */ &global_errmsgs[es_ES] ); /***** LOCALE END es_BO *****/ @@ -2669,8 +2669,8 @@ MY_LOCALE my_locale_es_CL 10, 9, ',', /* decimal point es_CL */ - '\0', /* thousands_sep es_CL */ - "\x80\x80", /* grouping es_CL */ + '.', /* thousands_sep es_CL */ + "\x03\x03", /* grouping es_CL */ &global_errmsgs[es_ES] ); /***** LOCALE END es_CL *****/ @@ -2689,8 +2689,8 @@ MY_LOCALE my_locale_es_CO 10, 9, ',', /* decimal point es_CO */ - '\0', /* thousands_sep es_CO */ - "\x80\x80", /* grouping es_CO */ + '.', /* thousands_sep es_CO */ + "\x03\x03", /* grouping es_CO */ &global_errmsgs[es_ES] ); /***** LOCALE END es_CO *****/ @@ -2708,9 +2708,9 @@ MY_LOCALE my_locale_es_CR &my_locale_typelib_ab_day_names_es_ES, 10, 9, - '.', /* decimal point es_CR */ - '\0', /* thousands_sep es_CR */ - "\x80\x80", /* grouping es_CR */ + ',', /* decimal point es_CR */ + ' ', /* thousands_sep es_CR */ + "\x03\x03", /* grouping es_CR */ &global_errmsgs[es_ES] ); /***** LOCALE END es_CR *****/ @@ -2729,8 +2729,8 @@ MY_LOCALE my_locale_es_DO 10, 9, '.', /* decimal point es_DO */ - '\0', /* thousands_sep es_DO */ - "\x80\x80", /* grouping es_DO */ + ',', /* thousands_sep es_DO */ + "\x03\x03", /* grouping es_DO */ &global_errmsgs[es_ES] ); /***** LOCALE END es_DO *****/ @@ -2749,8 +2749,8 @@ MY_LOCALE my_locale_es_EC 10, 9, ',', /* decimal point es_EC */ - '\0', /* thousands_sep es_EC */ - "\x80\x80", /* grouping es_EC */ + '.', /* thousands_sep es_EC */ + "\x03\x03", /* grouping es_EC */ &global_errmsgs[es_ES] ); /***** LOCALE END es_EC *****/ @@ -2769,8 +2769,8 @@ MY_LOCALE my_locale_es_GT 10, 9, '.', /* decimal point es_GT */ - '\0', /* thousands_sep es_GT */ - "\x80\x80", /* grouping es_GT */ + ',', /* thousands_sep es_GT */ + "\x03\x03", /* grouping es_GT */ &global_errmsgs[es_ES] ); /***** LOCALE END es_GT *****/ @@ -2789,8 +2789,8 @@ MY_LOCALE my_locale_es_HN 10, 9, '.', /* decimal point es_HN */ - '\0', /* thousands_sep es_HN */ - "\x80\x80", /* grouping es_HN */ + ',', /* thousands_sep es_HN */ + "\x03\x03", /* grouping es_HN */ &global_errmsgs[es_ES] ); /***** LOCALE END es_HN *****/ @@ -2809,8 +2809,8 @@ MY_LOCALE my_locale_es_MX 10, 9, '.', /* decimal point es_MX */ - '\0', /* thousands_sep es_MX */ - "\x80\x80", /* grouping es_MX */ + ',', /* thousands_sep es_MX */ + "\x03\x03", /* grouping es_MX */ &global_errmsgs[es_ES] ); /***** LOCALE END es_MX *****/ @@ -2829,8 +2829,8 @@ MY_LOCALE my_locale_es_NI 10, 9, '.', /* decimal point es_NI */ - '\0', /* thousands_sep es_NI */ - "\x80\x80", /* grouping es_NI */ + ',', /* thousands_sep es_NI */ + "\x03\x03", /* grouping es_NI */ &global_errmsgs[es_ES] ); /***** LOCALE END es_NI *****/ @@ -2849,8 +2849,8 @@ MY_LOCALE my_locale_es_PA 10, 9, '.', /* decimal point es_PA */ - '\0', /* thousands_sep es_PA */ - "\x80\x80", /* grouping es_PA */ + ',', /* thousands_sep es_PA */ + "\x03\x03", /* grouping es_PA */ &global_errmsgs[es_ES] ); /***** LOCALE END es_PA *****/ @@ -2869,8 +2869,8 @@ MY_LOCALE my_locale_es_PE 10, 9, '.', /* decimal point es_PE */ - '\0', /* thousands_sep es_PE */ - "\x80\x80", /* grouping es_PE */ + ',', /* thousands_sep es_PE */ + "\x03\x03", /* grouping es_PE */ &global_errmsgs[es_ES] ); /***** LOCALE END es_PE *****/ @@ -2889,8 +2889,8 @@ MY_LOCALE my_locale_es_PR 10, 9, '.', /* decimal point es_PR */ - '\0', /* thousands_sep es_PR */ - "\x80\x80", /* grouping es_PR */ + ',', /* thousands_sep es_PR */ + "\x03\x03", /* grouping es_PR */ &global_errmsgs[es_ES] ); /***** LOCALE END es_PR *****/ @@ -2909,8 +2909,8 @@ MY_LOCALE my_locale_es_PY 10, 9, ',', /* decimal point es_PY */ - '\0', /* thousands_sep es_PY */ - "\x80\x80", /* grouping es_PY */ + '.', /* thousands_sep es_PY */ + "\x03\x03", /* grouping es_PY */ &global_errmsgs[es_ES] ); /***** LOCALE END es_PY *****/ @@ -2929,8 +2929,8 @@ MY_LOCALE my_locale_es_SV 10, 9, '.', /* decimal point es_SV */ - '\0', /* thousands_sep es_SV */ - "\x80\x80", /* grouping es_SV */ + ',', /* thousands_sep es_SV */ + "\x03\x03", /* grouping es_SV */ &global_errmsgs[es_ES] ); /***** LOCALE END es_SV *****/ @@ -2969,8 +2969,8 @@ MY_LOCALE my_locale_es_UY 10, 9, ',', /* decimal point es_UY */ - '\0', /* thousands_sep es_UY */ - "\x80\x80", /* grouping es_UY */ + '.', /* thousands_sep es_UY */ + "\x03\x03", /* grouping es_UY */ &global_errmsgs[es_ES] ); /***** LOCALE END es_UY *****/ @@ -2989,8 +2989,8 @@ MY_LOCALE my_locale_es_VE 10, 9, ',', /* decimal point es_VE */ - '\0', /* thousands_sep es_VE */ - "\x80\x80", /* grouping es_VE */ + '.', /* thousands_sep es_VE */ + "\x03\x03", /* grouping es_VE */ &global_errmsgs[es_ES] ); /***** LOCALE END es_VE *****/ diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index e3ddd14fe6a..1f12ed1dcf9 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -233,7 +233,7 @@ static struct /* support for Services */ -#include "sql_plugin_services.ic" +#include "sql_plugin_services.inl" /* A mutex LOCK_plugin must be acquired before accessing the diff --git a/sql/sql_plugin_services.ic b/sql/sql_plugin_services.inl index 3dd41ffbed9..3dd41ffbed9 100644 --- a/sql/sql_plugin_services.ic +++ b/sql/sql_plugin_services.inl diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 68dd670787c..09e0556c7d0 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -202,7 +202,7 @@ public: virtual ~Prepared_statement(); void setup_set_params(); virtual Query_arena::Type type() const; - virtual void cleanup_stmt(bool restore_set_statement_vars); + virtual bool cleanup_stmt(bool restore_set_statement_vars) override; bool set_name(const LEX_CSTRING *name); inline void close_cursor() { delete cursor; cursor= 0; } inline bool is_in_use() { return flags & (uint) IS_IN_USE; } @@ -3139,7 +3139,6 @@ void reinit_stmt_before_use(THD *thd, LEX *lex) } for (; sl; sl= sl->next_select_in_list()) { - sl->parent_lex->in_sum_func= NULL; if (sl->changed_elements & TOUCHED_SEL_COND) { /* remove option which was put by mysql_explain_union() */ @@ -3274,6 +3273,7 @@ void reinit_stmt_before_use(THD *thd, LEX *lex) lex->result->set_thd(thd); } lex->allow_sum_func.clear_all(); + lex->in_sum_func= NULL; DBUG_VOID_RETURN; } @@ -4217,19 +4217,20 @@ Query_arena::Type Prepared_statement::type() const } -void Prepared_statement::cleanup_stmt(bool restore_set_statement_vars) +bool Prepared_statement::cleanup_stmt(bool restore_set_statement_vars) { + bool error= false; DBUG_ENTER("Prepared_statement::cleanup_stmt"); DBUG_PRINT("enter",("stmt: %p", this)); if (restore_set_statement_vars) - lex->restore_set_statement_var(); + error= lex->restore_set_statement_var(); thd->rollback_item_tree_changes(); cleanup_items(free_list); thd->cleanup_after_query(); - DBUG_VOID_RETURN; + DBUG_RETURN(error); } @@ -4465,7 +4466,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len) Pass the value true to restore original values of variables modified on handling SET STATEMENT clause. */ - cleanup_stmt(true); + error|= cleanup_stmt(true); thd->restore_backup_statement(this, &stmt_backup); thd->stmt_arena= old_stmt_arena; @@ -5274,7 +5275,8 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) */ log_slow_statement(thd); - lex->restore_set_statement_var(); + error|= lex->restore_set_statement_var(); + /* EXECUTE command has its own dummy "explain data". We don't need it, @@ -5318,7 +5320,7 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) } error: - thd->lex->restore_set_statement_var(); + error|= thd->lex->restore_set_statement_var(); flags&= ~ (uint) IS_IN_USE; return error; } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index ae5cd82da4c..be920851757 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -3262,6 +3262,14 @@ setup_subq_exit: } if (make_aggr_tables_info()) DBUG_RETURN(1); + + /* + It could be that we've only done optimization stage 1 for + some of the derived tables, and never did stage 2. + Do it now, otherwise Explain data structure will not be complete. + */ + if (select_lex->handle_derived(thd->lex, DT_OPTIMIZE)) + DBUG_RETURN(1); } /* Even with zero matching rows, subqueries in the HAVING clause may @@ -10711,7 +10719,10 @@ bool JOIN::get_best_combination() if (!(join_tab= (JOIN_TAB*) thd->alloc(sizeof(JOIN_TAB)* (top_join_tab_count + aggr_tables)))) DBUG_RETURN(TRUE); - + + if (inject_splitting_cond_for_all_tables_with_split_opt()) + DBUG_RETURN(TRUE); + JOIN_TAB_RANGE *root_range; if (!(root_range= new (thd->mem_root) JOIN_TAB_RANGE)) DBUG_RETURN(TRUE); @@ -14761,8 +14772,6 @@ return_zero_rows(JOIN *join, select_result *result, List<TABLE_LIST> &tables, DBUG_RETURN(0); } - join->join_free(); - if (send_row) { /* @@ -14809,6 +14818,14 @@ return_zero_rows(JOIN *join, select_result *result, List<TABLE_LIST> &tables, if (likely(!send_error)) result->send_eof(); // Should be safe } + /* + JOIN::join_free() must be called after the virtual method + select::send_result_set_metadata() returned control since + implementation of this method could use data strutcures + that are released by the method JOIN::join_free(). + */ + join->join_free(); + DBUG_RETURN(0); } @@ -18540,7 +18557,7 @@ Field *create_tmp_field(TABLE *table, Item *item, make_copy_field); Field *result= item->create_tmp_field_ex(table->in_use->mem_root, table, &src, &prm); - if (item->is_json_type() && make_json_valid_expr(table, result)) + if (is_json_type(item) && make_json_valid_expr(table, result)) result= NULL; *from_field= src.field(); @@ -18987,7 +19004,7 @@ bool Create_tmp_table::add_fields(THD *thd, item->marker == MARKER_NULL_KEY || param->bit_fields_as_long, param->force_copy_fields); - if (!new_field) + if (unlikely(!new_field)) { if (unlikely(thd->is_fatal_error)) goto err; // Got OOM @@ -19582,16 +19599,7 @@ bool Create_tmp_table::add_schema_fields(THD *thd, TABLE *table, DBUG_RETURN(true); // EOM } field->init(table); - switch (def.def()) { - case DEFAULT_NONE: - field->flags|= NO_DEFAULT_VALUE_FLAG; - break; - case DEFAULT_TYPE_IMPLICIT: - break; - default: - DBUG_ASSERT(0); - break; - } + field->flags|= NO_DEFAULT_VALUE_FLAG; add_field(table, field, fieldnr, param->force_not_null_cols); } @@ -21327,11 +21335,8 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab, */ if (shortcut_for_distinct && found_records != join->found_records) DBUG_RETURN(NESTED_LOOP_NO_MORE_ROWS); - } - else - { - join->thd->get_stmt_da()->inc_current_row_for_warning(); - join_tab->read_record.unlock_row(join_tab); + + DBUG_RETURN(NESTED_LOOP_OK); } } else @@ -21341,9 +21346,11 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab, with the beginning coinciding with the current partial join. */ join->join_examined_rows++; - join->thd->get_stmt_da()->inc_current_row_for_warning(); - join_tab->read_record.unlock_row(join_tab); } + + join->thd->get_stmt_da()->inc_current_row_for_warning(); + join_tab->read_record.unlock_row(join_tab); + DBUG_RETURN(NESTED_LOOP_OK); } @@ -23147,21 +23154,6 @@ make_cond_for_table_from_pred(THD *thd, Item *root_cond, Item *cond, cond->marker= MARKER_CHECK_ON_READ; // Checked when read return (COND*) 0; } - /* - If cond is an equality injected for split optimization then - a. when retain_ref_cond == false : cond is removed unconditionally - (cond that supports ref access is removed by the preceding code) - b. when retain_ref_cond == true : cond is removed if it does not - support ref access - */ - if (left_item->type() == Item::FIELD_ITEM && - is_eq_cond_injected_for_split_opt((Item_func_eq *) cond) && - (!retain_ref_cond || - !test_if_ref(root_cond, (Item_field*) left_item,right_item))) - { - cond->marker= MARKER_CHECK_ON_READ; - return (COND*) 0; - } } cond->marker= MARKER_PROCESSED; cond->set_join_tab_idx((uint8) join_tab_idx_arg); @@ -29520,6 +29512,12 @@ AGGR_OP::end_send() table->reginfo.lock_type= TL_UNLOCK; bool in_first_read= true; + + /* + Reset the counter before copying rows from internal temporary table to + INSERT table. + */ + join_tab->join->thd->get_stmt_da()->reset_current_row_for_warning(1); while (rc == NESTED_LOOP_OK) { int error; diff --git a/sql/sql_select.h b/sql/sql_select.h index d4e06f42249..c8efb26684c 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -1728,6 +1728,7 @@ public: void add_keyuses_for_splitting(); bool inject_best_splitting_cond(table_map remaining_tables); bool fix_all_splittings_in_plan(); + bool inject_splitting_cond_for_all_tables_with_split_opt(); void make_notnull_conds_for_range_scans(); bool transform_in_predicates_into_in_subq(THD *thd); diff --git a/sql/sql_sequence.cc b/sql/sql_sequence.cc index 307a0b29c57..91ee97f7822 100644 --- a/sql/sql_sequence.cc +++ b/sql/sql_sequence.cc @@ -365,9 +365,14 @@ bool sequence_insert(THD *thd, LEX *lex, TABLE_LIST *org_table_list) seq->reserved_until= seq->start; error= seq->write_initial_sequence(table); - - if (trans_commit_stmt(thd)) - error= 1; + { + uint save_unsafe_rollback_flags= + thd->transaction->stmt.m_unsafe_rollback_flags; + if (trans_commit_stmt(thd)) + error= 1; + thd->transaction->stmt.m_unsafe_rollback_flags= + save_unsafe_rollback_flags; + } if (trans_commit_implicit(thd)) error= 1; @@ -905,6 +910,13 @@ bool Sql_cmd_alter_sequence::execute(THD *thd) if (check_grant(thd, ALTER_ACL, first_table, FALSE, 1, FALSE)) DBUG_RETURN(TRUE); /* purecov: inspected */ +#ifdef WITH_WSREP + if (WSREP_ON && WSREP(thd) && + wsrep_to_isolation_begin(thd, first_table->db.str, + first_table->table_name.str, + first_table)) + DBUG_RETURN(TRUE); +#endif /* WITH_WSREP */ if (if_exists()) thd->push_internal_handler(&no_such_table_handler); error= open_and_lock_tables(thd, first_table, FALSE, 0); diff --git a/sql/sql_show.cc b/sql/sql_show.cc index d01f84fe7d1..f289c1a3a02 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -9220,7 +9220,7 @@ ST_FIELD_INFO stat_fields_info[]= Column("INDEX_NAME", Name(), NOT_NULL, "Key_name", OPEN_FRM_ONLY), Column("SEQ_IN_INDEX", SLonglong(2),NOT_NULL, "Seq_in_index",OPEN_FRM_ONLY), Column("COLUMN_NAME", Name(), NOT_NULL, "Column_name", OPEN_FRM_ONLY), - Column("COLLATION", Varchar(1), NULLABLE, "Collation", OPEN_FRM_ONLY), + Column("COLLATION", Varchar(1), NULLABLE, "Collation", OPEN_FULL_TABLE), Column("CARDINALITY", SLonglong(), NULLABLE, "Cardinality", OPEN_FULL_TABLE), Column("SUB_PART", SLonglong(3),NULLABLE, "Sub_part", OPEN_FRM_ONLY), Column("PACKED", Varchar(10), NULLABLE, "Packed", OPEN_FRM_ONLY), diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 7d9fd0c516d..aecdf9832d4 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1,6 +1,6 @@ /* Copyright (c) 2000, 2019, Oracle and/or its affiliates. - Copyright (c) 2010, 2021, MariaDB + Copyright (c) 2010, 2022, 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 @@ -5248,8 +5248,15 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, #ifdef WITH_PARTITION_STORAGE_ENGINE /* Partition info is not handled by mysql_prepare_alter_table() call. */ if (src_table->table->part_info) - thd->work_part_info= src_table->table->part_info->get_clone(thd); -#endif + { + /* + The CREATE TABLE LIKE should not inherit the DATA DIRECTORY + and INDEX DIRECTORY from the base table. + So that TRUE argument for the get_clone. + */ + thd->work_part_info= src_table->table->part_info->get_clone(thd, TRUE); + } +#endif /*WITH_PARTITION_STORAGE_ENGINE*/ /* Adjust description of source table before using it for creation of @@ -7978,9 +7985,14 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, def->invisible= INVISIBLE_SYSTEM; alter_info->flags|= ALTER_CHANGE_COLUMN; if (field->flags & VERS_ROW_START) - create_info->vers_info.as_row.start= def->field_name= Vers_parse_info::default_start; + create_info->vers_info.period.start= + create_info->vers_info.as_row.start= + def->field_name= Vers_parse_info::default_start; + else - create_info->vers_info.as_row.end= def->field_name= Vers_parse_info::default_end; + create_info->vers_info.period.end= + create_info->vers_info.as_row.end= + def->field_name= Vers_parse_info::default_end; new_create_list.push_back(def, thd->mem_root); dropped_sys_vers_fields|= field->flags; drop_it.remove(); @@ -8009,9 +8021,15 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, def->field_name= alter->new_name; column_rename_param.fields.push_back(def); if (field->flags & VERS_ROW_START) + { create_info->vers_info.as_row.start= alter->new_name; + create_info->vers_info.period.start= alter->new_name; + } else if (field->flags & VERS_ROW_END) + { create_info->vers_info.as_row.end= alter->new_name; + create_info->vers_info.period.end= alter->new_name; + } if (table->s->period.name) { if (field == table->period_start_field()) @@ -11901,20 +11919,30 @@ bool Sql_cmd_create_table_like::execute(THD *thd) tables, like mysql replication does. Also check if the requested engine is allowed/supported. */ - if (WSREP(thd) && - !check_engine(thd, create_table->db.str, create_table->table_name.str, - &create_info) && - (!thd->is_current_stmt_binlog_format_row() || - !create_info.tmp_table())) - { + if (WSREP(thd)) + { + handlerton *orig_ht= create_info.db_type; + if (!check_engine(thd, create_table->db.str, + create_table->table_name.str, + &create_info) && + (!thd->is_current_stmt_binlog_format_row() || + !create_info.tmp_table())) + { #ifdef WITH_WSREP - WSREP_TO_ISOLATION_BEGIN_ALTER(create_table->db.str, create_table->table_name.str, - first_table, &alter_info, NULL, &create_info) - { - WSREP_WARN("CREATE TABLE isolation failure"); - DBUG_RETURN(true); - } + WSREP_TO_ISOLATION_BEGIN_ALTER(create_table->db.str, + create_table->table_name.str, + first_table, &alter_info, NULL, + &create_info) + { + WSREP_WARN("CREATE TABLE isolation failure"); + DBUG_RETURN(true); + } #endif /* WITH_WSREP */ + } + // check_engine will set db_type to NULL if e.g. TEMPORARY is + // not supported by the storage engine, this case is checked + // again in mysql_create_table + create_info.db_type= orig_ht; } /* Regular CREATE TABLE */ res= mysql_create_table(thd, create_table, &create_info, &alter_info); diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index 7b3db324db7..cce426b842f 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -313,7 +313,7 @@ class Deprecated_trigger_syntax_handler : public Internal_error_handler private: char m_message[MYSQL_ERRMSG_SIZE]; - LEX_CSTRING *m_trigger_name; + const LEX_CSTRING *m_trigger_name; public: @@ -329,8 +329,23 @@ public: if (sql_errno != EE_OUTOFMEMORY && sql_errno != ER_OUT_OF_RESOURCES) { + // Check if the current LEX contains a non-empty spname if(thd->lex->spname) m_trigger_name= &thd->lex->spname->m_name; + else if (thd->lex->sphead) + { + /* + Some SP statements, for example IF, create their own local LEX. + All LEX instances are available in the LEX stack in sphead::m_lex. + Let's find the one that contains a non-zero spname. + Note, although a parse error has happened, the LEX instances + in sphead::m_lex are not freed yet at this point. The first + found non-zero spname contains the valid trigger name. + */ + const sp_name *spname= thd->lex->sphead->find_spname_recursive(); + if (spname) + m_trigger_name= &spname->m_name; + } if (m_trigger_name) my_snprintf(m_message, sizeof(m_message), ER_THD(thd, ER_ERROR_IN_TRIGGER_BODY), @@ -343,7 +358,7 @@ public: return false; } - LEX_CSTRING *get_trigger_name() { return m_trigger_name; } + const LEX_CSTRING *get_trigger_name() { return m_trigger_name; } char *get_error_message() { return m_message; } }; @@ -1669,7 +1684,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const LEX_CSTRING *db, if (unlikely(parse_error)) { - LEX_CSTRING *name; + const LEX_CSTRING *name; /* In case of errors, disable all triggers for the table, but keep diff --git a/sql/sql_type.cc b/sql/sql_type.cc index 0764265f978..adfe02e633b 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2015, 2020, MariaDB + Copyright (c) 2015, 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 @@ -1761,16 +1761,21 @@ const Type_handler *Type_handler_typelib::cast_to_int_type_handler() const bool Type_handler_hybrid_field_type::aggregate_for_result(const Type_handler *other) { - const Type_handler *hres; - const Type_collection *c; - if (!(c= Type_handler::type_collection_for_aggregation(m_type_handler, other)) || - !(hres= c->aggregate_for_result(m_type_handler, other))) - hres= type_handler_data-> - m_type_aggregator_for_result.find_handler(m_type_handler, other); - if (!hres) - return true; - m_type_handler= hres; - return false; + Type_handler_pair tp(m_type_handler, other); + do + { + const Type_handler *hres; + const Type_collection *c; + if (((c= Type_handler::type_collection_for_aggregation(tp.a(), tp.b())) && + (hres= c->aggregate_for_result(tp.a(), tp.b()))) || + (hres= type_handler_data-> + m_type_aggregator_for_result.find_handler(tp.a(), tp.b()))) + { + m_type_handler= hres; + return false; + } + } while (tp.to_base()); + return true; } @@ -1973,26 +1978,29 @@ Type_collection_std::aggregate_for_comparison(const Type_handler *ha, bool Type_handler_hybrid_field_type::aggregate_for_min_max(const Type_handler *h) { - const Type_handler *hres; - const Type_collection *c; - if (!(c= Type_handler::type_collection_for_aggregation(m_type_handler, h))|| - !(hres= c->aggregate_for_min_max(m_type_handler, h))) + Type_handler_pair tp(m_type_handler, h); + do { - /* - For now we suppose that these two expressions: - - LEAST(type1, type2) - - COALESCE(type1, type2) - return the same data type (or both expressions return error) - if type1 and/or type2 are non-traditional. - This may change in the future. - */ - hres= type_handler_data-> - m_type_aggregator_for_result.find_handler(m_type_handler, h); - } - if (!hres) - return true; - m_type_handler= hres; - return false; + const Type_handler *hres; + const Type_collection *c; + if (((c= Type_handler::type_collection_for_aggregation(tp.a(), tp.b())) && + (hres= c->aggregate_for_min_max(tp.a(), tp.b()))) || + (hres= type_handler_data-> + m_type_aggregator_for_result.find_handler(tp.a(), tp.b()))) + { + /* + For now we suppose that these two expressions: + - LEAST(type1, type2) + - COALESCE(type1, type2) + return the same data type (or both expressions return error) + if type1 and/or type2 are non-traditional. + This may change in the future. + */ + m_type_handler= hres; + return false; + } + } while (tp.to_base()); + return true; } @@ -2131,15 +2139,20 @@ Type_handler_hybrid_field_type::aggregate_for_num_op(const Type_aggregator *agg, const Type_handler *h0, const Type_handler *h1) { - const Type_handler *hres; - const Type_collection *c; - if (!(c= Type_handler::type_collection_for_aggregation(h0, h1)) || - !(hres= c->aggregate_for_num_op(h0, h1))) - hres= agg->find_handler(h0, h1); - if (!hres) - return true; - m_type_handler= hres; - return false; + Type_handler_pair tp(h0, h1); + do + { + const Type_handler *hres; + const Type_collection *c; + if (((c= Type_handler::type_collection_for_aggregation(tp.a(), tp.b())) && + (hres= c->aggregate_for_num_op(tp.a(), tp.b()))) || + (hres= agg->find_handler(tp.a(), tp.b()))) + { + m_type_handler= hres; + return false; + } + } while (tp.to_base()); + return true; } diff --git a/sql/sql_type.h b/sql/sql_type.h index 44225b41609..0f74489719a 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -2,7 +2,7 @@ #define SQL_TYPE_H_INCLUDED /* Copyright (c) 2015 MariaDB Foundation. - Copyright (c) 2015, 2020, MariaDB Corporation. + Copyright (c) 2015, 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 @@ -45,6 +45,7 @@ class Item_param; class Item_cache; class Item_copy; class Item_func_or_sum; +class Item_sum; class Item_sum_hybrid; class Item_sum_sum; class Item_sum_avg; @@ -3767,6 +3768,19 @@ public: incompatible data type. */ virtual bool is_param_long_data_type() const { return false; } + /* + The base type handler "this" is derived from. + "This" inherits aggregation rules from the base type handler. + */ + virtual const Type_handler *type_handler_base() const + { + return NULL; + } + const Type_handler *type_handler_base_or_self() const + { + const Type_handler *res= type_handler_base(); + return res ? res : this; + } virtual const Type_handler *type_handler_for_comparison() const= 0; virtual const Type_handler *type_handler_for_native_format() const { @@ -7475,6 +7489,41 @@ public: const Type_handler *h0, const Type_handler *h1); }; + +class Type_handler_pair +{ + const Type_handler *m_a; + const Type_handler *m_b; +public: + Type_handler_pair(const Type_handler *a, + const Type_handler *b) + :m_a(a), m_b(b) + { } + const Type_handler *a() const { return m_a; } + const Type_handler *b() const { return m_b; } + /* + Change both handlers to their parent data type handlers, if available. + For example, VARCHAR/JSON -> VARCHAR. + @returns The number of handlers changed (0,1 or 2). + */ + bool to_base() + { + bool rc= false; + const Type_handler *na= m_a->type_handler_base(); + const Type_handler *nb= m_b->type_handler_base(); + if (na) + { + m_a= na; rc= true; + } + if (nb) + { + m_b= nb; rc= true; + } + return rc; + } +}; + + /* Helper template to simplify creating builtin types with names. Plugin types inherit from Type_handler_xxx types that do not set the name in diff --git a/sql/sql_type_fixedbin.h b/sql/sql_type_fixedbin.h index 332b712db31..236241f67b7 100644 --- a/sql/sql_type_fixedbin.h +++ b/sql/sql_type_fixedbin.h @@ -1410,7 +1410,8 @@ public: Mixing of two different non-traditional types is currently prevented. This may change in the future. */ - DBUG_ASSERT(item->type_handler()->is_traditional_scalar_type() || + DBUG_ASSERT(item->type_handler()->type_handler_base_or_self()-> + is_traditional_scalar_type() || item->type_handler() == type_handler()); return true; } @@ -1424,7 +1425,8 @@ public: bool is_eq_func) const override { // See the DBUG_ASSERT comment in can_optimize_keypart_ref() - DBUG_ASSERT(item->type_handler()->is_traditional_scalar_type() || + DBUG_ASSERT(item->type_handler()->type_handler_base_or_self()-> + is_traditional_scalar_type() || item->type_handler() == type_handler()); return true; } diff --git a/sql/sql_type_json.cc b/sql/sql_type_json.cc index a804366ec03..c12b868e6b9 100644 --- a/sql/sql_type_json.cc +++ b/sql/sql_type_json.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2019, MariaDB + Copyright (c) 2019, 2021 MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -20,17 +20,111 @@ #include "sql_class.h" -Type_handler_json_longtext type_handler_json_longtext; +Named_type_handler<Type_handler_string_json> + type_handler_string_json("char/json"); + +Named_type_handler<Type_handler_varchar_json> + type_handler_varchar_json("varchar/json"); + +Named_type_handler<Type_handler_tiny_blob_json> + type_handler_tiny_blob_json("tinyblob/json"); + +Named_type_handler<Type_handler_blob_json> + type_handler_blob_json("blob/json"); + +Named_type_handler<Type_handler_medium_blob_json> + type_handler_medium_blob_json("mediumblob/json"); + +Named_type_handler<Type_handler_long_blob_json> + type_handler_long_blob_json("longblob/json"); + + +// Convert general purpose string type handlers to their JSON counterparts +const Type_handler * +Type_handler_json_common::json_type_handler_from_generic(const Type_handler *th) +{ + // Test in the order of likelyhood. + if (th == &type_handler_long_blob) + return &type_handler_long_blob_json; + if (th == &type_handler_varchar) + return &type_handler_varchar_json; + if (th == &type_handler_blob) + return &type_handler_blob_json; + if (th == &type_handler_tiny_blob) + return &type_handler_tiny_blob_json; + if (th == &type_handler_medium_blob) + return &type_handler_medium_blob_json; + if (th == &type_handler_string) + return &type_handler_string_json; + DBUG_ASSERT(is_json_type_handler(th)); + return th; +} + + +/* + This method resembles what Type_handler::string_type_handler() + does for general purpose string type handlers. +*/ +const Type_handler * +Type_handler_json_common::json_type_handler(uint max_octet_length) +{ + if (max_octet_length >= 16777216) + return &type_handler_long_blob_json; + else if (max_octet_length >= 65536) + return &type_handler_medium_blob_json; + else if (max_octet_length >= MAX_FIELD_VARCHARLENGTH) + return &type_handler_blob_json; + return &type_handler_varchar_json; +} + + +/* + This method resembles what Field_blob::type_handler() + does for general purpose BLOB type handlers. +*/ +const Type_handler * +Type_handler_json_common::json_blob_type_handler_by_length_bytes(uint len) +{ + switch (len) { + case 1: return &type_handler_tiny_blob_json; + case 2: return &type_handler_blob_json; + case 3: return &type_handler_medium_blob_json; + } + return &type_handler_long_blob_json; +} + + +/* + This method resembles what Item_sum_group_concat::type_handler() + does for general purpose string type handlers. +*/ +const Type_handler * +Type_handler_json_common::json_type_handler_sum(const Item_sum *item) +{ + if (item->too_big_for_varchar()) + return &type_handler_blob_json; + return &type_handler_varchar_json; +} + + +bool Type_handler_json_common::has_json_valid_constraint(const Field *field) +{ + return field->check_constraint && + field->check_constraint->expr && + field->check_constraint->expr->type() == Item::FUNC_ITEM && + static_cast<const Item_func *>(field->check_constraint->expr)-> + functype() == Item_func::JSON_VALID_FUNC; +} /** Create JSON_VALID(field_name) expression */ + Virtual_column_info * -Type_handler_json_longtext::make_json_valid_expr(THD *thd, - const LEX_CSTRING *field_name) - const +Type_handler_json_common::make_json_valid_expr(THD *thd, + const LEX_CSTRING *field_name) { Lex_ident_sys_st str; Item *field, *expr; @@ -46,12 +140,118 @@ Type_handler_json_longtext::make_json_valid_expr(THD *thd, } -bool Type_handler_json_longtext:: - Column_definition_validate_check_constraint(THD *thd, - Column_definition * c) const +bool Type_handler_json_common::make_json_valid_expr_if_needed(THD *thd, + Column_definition *c) +{ + return !c->check_constraint && + !(c->check_constraint= make_json_valid_expr(thd, &c->field_name)); +} + + +class Type_collection_json: public Type_collection +{ + const Type_handler *aggregate_common(const Type_handler *a, + const Type_handler *b) const + { + if (a == b) + return a; + if (a == &type_handler_null) + return b; + if (b == &type_handler_null) + return a; + return NULL; + } + + /* + Aggregate two JSON type handlers for result. + If one of the handlers is not JSON, NULL is returned. + */ + const Type_handler *aggregate_json_for_result(const Type_handler *a, + const Type_handler *b) const + { + if (!Type_handler_json_common::is_json_type_handler(a) || + !Type_handler_json_common::is_json_type_handler(b)) + return NULL; + // Here we have two JSON data types. Let's aggregate their base types. + const Type_handler *a0= a->type_handler_base(); + const Type_handler *b0= b->type_handler_base(); + // Base types are expected to belong to type_collection_std: + DBUG_ASSERT(a0->type_collection() == type_handler_null.type_collection()); + DBUG_ASSERT(b0->type_collection() == type_handler_null.type_collection()); + const Type_handler *c= a0->type_collection()->aggregate_for_result(a0, b0); + return Type_handler_json_common::json_type_handler_from_generic(c); + } +public: + const Type_handler *aggregate_for_result(const Type_handler *a, + const Type_handler *b) + const override + { + const Type_handler *h; + if ((h= aggregate_common(a, b)) || + (h= aggregate_json_for_result(a, b))) + return h; + /* + One of the types is not JSON. + Let the caller aggregate according to the derived rules: + COALESCE(VARCHAR/JSON, TEXT) -> COALESCE(VARCHAR, TEXT) + */ + return NULL; + } + + const Type_handler *aggregate_for_min_max(const Type_handler *a, + const Type_handler *b) + const override + { + /* + No JSON specific rules. + Let the caller aggregate according to the derived rules: + LEAST(VARCHAR/JSON, TEXT/JSON) -> LEAST(VARCHAR, TEXT) + */ + return NULL; + } + + const Type_handler *aggregate_for_comparison(const Type_handler *a, + const Type_handler *b) + const override + { + /* + All JSON types return &type_handler_long_blob + in type_handler_for_comparison(). We should not get here. + */ + DBUG_ASSERT(0); + return NULL; + } + + const Type_handler *aggregate_for_num_op(const Type_handler *a, + const Type_handler *b) + const override + { + /* + No JSON specific rules. + Let the caller aggregate according to the derived rules: + (VARCHAR/JSON + TEXT/JSON) -> (VARCHAR + TEXT) + */ + return NULL; + } + + const Type_handler *handler_by_name(const LEX_CSTRING &name) const override + { + /* + Name resolution is not needed yet. + JSON is not fully pluggable at the moment: + - It is parsed using a hard-coded rule in sql_yacc.yy + - It does not store extended data type information into + FRM file yet. JSON is detected by CHECK(JSON_VALID(col)) + and this detection is also hard-coded. + This will change in the future. + */ + return NULL; + } +}; + + +const Type_collection *Type_handler_json_common::type_collection() { - if (!c->check_constraint && - !(c->check_constraint= make_json_valid_expr(thd, &c->field_name))) - return true; - return Type_handler::Column_definition_validate_check_constraint(thd, c); + static Type_collection_json type_collection_json; + return &type_collection_json; } diff --git a/sql/sql_type_json.h b/sql/sql_type_json.h index 6c4ee8cb2eb..b7fe5c8aa64 100644 --- a/sql/sql_type_json.h +++ b/sql/sql_type_json.h @@ -1,7 +1,7 @@ #ifndef SQL_TYPE_JSON_INCLUDED #define SQL_TYPE_JSON_INCLUDED /* - Copyright (c) 2019, MariaDB + Copyright (c) 2019, 2021 MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -21,18 +21,145 @@ #include "mariadb.h" #include "sql_type.h" -class Type_handler_json_longtext: public Type_handler_long_blob + +class Type_handler_json_common +{ +public: + static Virtual_column_info *make_json_valid_expr(THD *thd, + const LEX_CSTRING *field_name); + static bool make_json_valid_expr_if_needed(THD *thd, Column_definition *c); + static bool set_format_name(Send_field_extended_metadata *to) + { + static const Lex_cstring fmt(STRING_WITH_LEN("json")); + return to->set_format_name(fmt); + } + static const Type_handler *json_type_handler(uint max_octet_length); + static const Type_handler *json_blob_type_handler_by_length_bytes(uint len); + static const Type_handler *json_type_handler_sum(const Item_sum *sum); + static const Type_handler *json_type_handler_from_generic(const Type_handler *th); + static bool has_json_valid_constraint(const Field *field); + static const Type_collection *type_collection(); + static bool is_json_type_handler(const Type_handler *handler) + { + return handler->type_collection() == type_collection(); + } +}; + + +template <class BASE, const Named_type_handler<BASE> &thbase> +class Type_handler_general_purpose_string_to_json: + public BASE, + public Type_handler_json_common { - Virtual_column_info *make_json_valid_expr(THD *thd, - const LEX_CSTRING *field_name) - const; public: - virtual ~Type_handler_json_longtext() {} + const Type_handler *type_handler_base() const override + { + return &thbase; + } + const Type_collection *type_collection() const override + { + return Type_handler_json_common::type_collection(); + } bool Column_definition_validate_check_constraint(THD *thd, - Column_definition *c) const; + Column_definition *c) + const override + { + return make_json_valid_expr_if_needed(thd, c) || + BASE::Column_definition_validate_check_constraint(thd, c); + } + bool Column_definition_data_type_info_image(Binary_string *to, + const Column_definition &def) + const override + { + /* + Override the inherited method to avoid JSON type handlers writing any + extended metadata to FRM. JSON type handlers are currently detected + only by CHECK(JSON_VALID()) constraint. This may change in the future + to do write extended metadata to FRM, for more reliable detection. + */ + return false; + } + + bool Item_append_extended_type_info(Send_field_extended_metadata *to, + const Item *item) const override + { + return set_format_name(to); // Send "format=json" in the protocol + } + + bool Item_hybrid_func_fix_attributes(THD *thd, + const LEX_CSTRING &name, + Type_handler_hybrid_field_type *hybrid, + Type_all_attributes *attr, + Item **items, uint nitems) + const override + { + if (BASE::Item_hybrid_func_fix_attributes(thd, name, hybrid, attr, + items, nitems)) + return true; + /* + The above call can change the type handler on "hybrid", e.g. + choose a proper BLOB type handler according to the calculated max_length. + Convert general purpose string type handler to its JSON counterpart. + This makes hybrid functions preserve JSON data types, e.g.: + COALESCE(json_expr1, json_expr2) -> JSON + */ + hybrid->set_handler(json_type_handler_from_generic(hybrid->type_handler())); + return false; + } }; + +class Type_handler_string_json: + public Type_handler_general_purpose_string_to_json<Type_handler_string, + type_handler_string> +{ }; + + +class Type_handler_varchar_json: + public Type_handler_general_purpose_string_to_json<Type_handler_varchar, + type_handler_varchar> +{ }; + +class Type_handler_tiny_blob_json: + public Type_handler_general_purpose_string_to_json<Type_handler_tiny_blob, + type_handler_tiny_blob> +{ }; + +class Type_handler_blob_json: + public Type_handler_general_purpose_string_to_json<Type_handler_blob, + type_handler_blob> +{ }; + + +class Type_handler_medium_blob_json: + public Type_handler_general_purpose_string_to_json<Type_handler_medium_blob, + type_handler_medium_blob> +{ }; + +class Type_handler_long_blob_json: + public Type_handler_general_purpose_string_to_json<Type_handler_long_blob, + type_handler_long_blob> +{ }; + + + +extern MYSQL_PLUGIN_IMPORT + Named_type_handler<Type_handler_string_json> type_handler_string_json; + +extern MYSQL_PLUGIN_IMPORT + Named_type_handler<Type_handler_varchar_json> type_handler_varchar_json; + extern MYSQL_PLUGIN_IMPORT - Type_handler_json_longtext type_handler_json_longtext; + Named_type_handler<Type_handler_tiny_blob_json> type_handler_tiny_blob_json; + +extern MYSQL_PLUGIN_IMPORT + Named_type_handler<Type_handler_blob_json> type_handler_blob_json; + +extern MYSQL_PLUGIN_IMPORT + Named_type_handler<Type_handler_medium_blob_json> type_handler_medium_blob_json; + +extern MYSQL_PLUGIN_IMPORT + Named_type_handler<Type_handler_long_blob_json> type_handler_long_blob_json; + #endif // SQL_TYPE_JSON_INCLUDED diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 20ac4b086bb..e5bea13896a 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -412,8 +412,18 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views, bool res= FALSE; DBUG_ENTER("mysql_create_view"); - /* This is ensured in the parser. */ - DBUG_ASSERT(!lex->proc_list.first && !lex->result && + /* + This is ensured in the parser. + NOTE: Originally, the assert below contained the extra condition + && !lex->result + but in this form the assert is failed in case CREATE VIEW run under + cursor (the case when the byte 'flags' in the COM_STMT_EXECUTE packet has + the flag CURSOR_TYPE_READ_ONLY set). For the cursor use case + thd->lex->result is assigned a pointer to the class Select_materialize + inside the function mysql_open_cursor() just before handling of a statement + will be started and the function mysql_create_view() called. + */ + DBUG_ASSERT(!lex->proc_list.first && !lex->param_list.elements); bzero(&ddl_log_state, sizeof(ddl_log_state)); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 8ebefbb3d82..7ae1fd68ce2 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -200,17 +200,6 @@ void _CONCAT_UNDERSCORED(turn_parser_debug_on,yyparse)() MYSQL_YYABORT; \ } while(0) -#define set_collation(X) \ - do { \ - if (X) \ - { \ - if (unlikely(Lex->charset && !my_charset_same(Lex->charset,X))) \ - my_yyabort_error((ER_COLLATION_CHARSET_MISMATCH, MYF(0), \ - X->coll_name.str,Lex->charset->cs_name.str)); \ - Lex->charset= X; \ - } \ - } while(0) - %} %union { @@ -1584,6 +1573,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %type <charset> opt_collate + collate charset_name charset_or_alias charset_name_or_default @@ -6159,7 +6149,7 @@ field_type_lob: | JSON_SYM opt_compressed { Lex->charset= &my_charset_utf8mb4_bin; - $$.set(&type_handler_json_longtext); + $$.set(&type_handler_long_blob_json); } ; @@ -6486,10 +6476,7 @@ charset_or_alias: } ; -collate: COLLATE_SYM collation_name_or_default - { - Lex->charset= $2; - } +collate: COLLATE_SYM collation_name_or_default { $$= $2; } ; opt_binary: @@ -6504,11 +6491,12 @@ binary: | BINARY charset_or_alias { bincmp_collation($2, true); } | charset_or_alias collate { - if (!my_charset_same(Lex->charset, $1)) + if (!my_charset_same($2, $1)) my_yyabort_error((ER_COLLATION_CHARSET_MISMATCH, MYF(0), - Lex->charset->coll_name.str, $1->cs_name.str)); + $2->coll_name.str, $1->cs_name.str)); + Lex->charset= $2; } - | collate { } + | collate { Lex->charset= $1; } ; opt_bin_mod: @@ -11351,7 +11339,7 @@ json_table_column_type: Lex->last_field->set_attributes(thd, $1, Lex->charset, COLUMN_DEFINITION_TABLE_FIELD); if (Lex->json_table->m_cur_json_table_column-> - set(thd, Json_table_column::PATH, $3)) + set(thd, Json_table_column::PATH, $3, Lex->charset)) { MYSQL_YYABORT; } @@ -11361,23 +11349,15 @@ json_table_column_type: Lex->last_field->set_attributes(thd, $1, Lex->charset, COLUMN_DEFINITION_TABLE_FIELD); Lex->json_table->m_cur_json_table_column-> - set(thd, Json_table_column::EXISTS_PATH, $4); + set(thd, Json_table_column::EXISTS_PATH, $4, Lex->charset); } ; json_table_field_type: field_type_numeric | field_type_temporal - | field_type_string opt_collate - { - set_collation($2); - Lex->json_table->m_cur_json_table_column->m_explicit_cs= Lex->charset; - } - | field_type_lob opt_collate - { - set_collation($2); - Lex->json_table->m_cur_json_table_column->m_explicit_cs= Lex->charset; - } + | field_type_string + | field_type_lob ; json_opt_on_empty_or_error: diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 7127cbc00f6..9629d27150e 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2002, 2015, Oracle and/or its affiliates. - Copyright (c) 2012, 2021, MariaDB Corporation. + Copyright (c) 2012, 2022, 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 @@ -34,7 +34,7 @@ #include "sql_plugin.h" #include "sql_priv.h" #include "sql_class.h" // set_var.h: THD -#include "sys_vars.ic" +#include "sys_vars.inl" #include "my_sys.h" #include "events.h" @@ -3273,6 +3273,21 @@ static Sys_var_charptr_fscs Sys_secure_file_priv( PREALLOCATED READ_ONLY GLOBAL_VAR(opt_secure_file_priv), CMD_LINE(REQUIRED_ARG), DEFAULT(0)); +static bool check_server_id(sys_var *self, THD *thd, set_var *var) +{ +#ifdef WITH_WSREP + if (WSREP_ON && WSREP_PROVIDER_EXISTS && !wsrep_new_cluster && wsrep_gtid_mode) + { + push_warning(thd, Sql_condition::WARN_LEVEL_WARN, + ER_WRONG_VALUE_FOR_VAR, + "Can't change server_id because wsrep and wsrep_gtid_mode is set." + " You can set server_id only with wsrep_new_cluster. "); + return true; + } +#endif /* WITH_WSREP */ + return false; +} + static bool fix_server_id(sys_var *self, THD *thd, enum_var_type type) { if (type == OPT_GLOBAL) @@ -3297,7 +3312,7 @@ Sys_server_id( "replication partners", SESSION_VAR(server_id), CMD_LINE(REQUIRED_ARG, OPT_SERVER_ID), VALID_RANGE(1, UINT_MAX32), DEFAULT(1), BLOCK_SIZE(1), NO_MUTEX_GUARD, - NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_server_id)); + NOT_IN_BINLOG, ON_CHECK(check_server_id), ON_UPDATE(fix_server_id)); static Sys_var_on_access_global<Sys_var_mybool, PRIV_SET_SYSTEM_GLOBAL_VAR_SLAVE_COMPRESSED_PROTOCOL> diff --git a/sql/sys_vars.ic b/sql/sys_vars.inl index 97e3a28b67e..97e3a28b67e 100644 --- a/sql/sys_vars.ic +++ b/sql/sys_vars.inl diff --git a/sql/table.cc b/sql/table.cc index b1a7b6bfe2b..4e858cdb24c 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -8989,14 +8989,18 @@ void TABLE::vers_update_fields() return; } - if (versioned(VERS_TIMESTAMP) && - vers_start_field()->store_timestamp(in_use->query_start(), - in_use->query_start_sec_part())) + if (versioned(VERS_TIMESTAMP)) { - DBUG_ASSERT(0); + if (vers_start_field()->store_timestamp(in_use->query_start(), + in_use->query_start_sec_part())) + { + DBUG_ASSERT(0); + } + vers_start_field()->set_has_explicit_value(); } vers_end_field()->set_max(); + vers_end_field()->set_has_explicit_value(); bitmap_set_bit(read_set, vers_end_field()->field_index); file->column_bitmaps_signal(); if (vfield) @@ -9009,6 +9013,7 @@ void TABLE::vers_update_end() if (vers_end_field()->store_timestamp(in_use->query_start(), in_use->query_start_sec_part())) DBUG_ASSERT(0); + vers_end_field()->set_has_explicit_value(); } /** @@ -9318,6 +9323,24 @@ void TABLE_LIST::wrap_into_nested_join(List<TABLE_LIST> &join_list) /** + Check whether optimization has been performed and a derived table either + been merged to upper select level or materialized. + + @param table a TABLE_LIST object containing a derived table + + @return true in case the derived table has been merged to surrounding select, + false otherwise +*/ + +static inline bool derived_table_optimization_done(TABLE_LIST *table) +{ + return table->derived && + (table->derived->is_excluded() || + table->is_materialized_derived()); +} + + +/** @brief Initialize this derived table/view @@ -9367,13 +9390,15 @@ bool TABLE_LIST::init_derived(THD *thd, bool init_view) } } - if (init_view && !view) + if (init_view && !view && + !derived_table_optimization_done(this)) { /* This is all what we can do for a derived table for now. */ set_derived(); } - if (!is_view()) + if (!is_view() && + !derived_table_optimization_done(this)) { /* A subquery might be forced to be materialized due to a side-effect. */ if (!is_materialized_derived() && first_select->is_mergeable() && diff --git a/sql/table.h b/sql/table.h index 6aa75df39c6..88216c788d4 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1774,7 +1774,9 @@ public: bool vers_check_update(List<Item> &items); static bool check_period_overlaps(const KEY &key, const uchar *lhs, const uchar *rhs); int delete_row(); + /* Used in majority of DML (called from fill_record()) */ void vers_update_fields(); + /* Used in DELETE, DUP REPLACE and insert history row */ void vers_update_end(); void find_constraint_correlated_indexes(); diff --git a/sql/tztime.cc b/sql/tztime.cc index 1f393e24ec2..e4b7cc731f2 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -2638,24 +2638,33 @@ static struct my_option my_long_options[] = {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef DBUG_OFF - {"debug", '#', "This is a non-debug version. Catch this and exit", + {"debug", '#', "This is a non-debug version. Catch this and exit.", 0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, #else {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"leap", 'l', "Print the leap second information from the given time zone file. By convention, when --leap is used the next argument is the timezonefile", + {"leap", 'l', "Print the leap second information from the given time zone file. By convention, when --leap is used the next argument is the timezonefile.", &opt_leap, &opt_leap, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"verbose", 'v', "Write non critical warnings", + {"verbose", 'v', "Write non critical warnings.", &opt_verbose, &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"skip-write-binlog", 'S', "Do not replicate changes to time zone tables to other nodes in a Galera cluster", + {"skip-write-binlog", 'S', "Do not replicate changes to time zone tables to the binary log, or to other nodes in a Galera cluster (if wsrep_on=ON).", &opt_skip_write_binlog,&opt_skip_write_binlog, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; +static char **default_argv; + +static void free_allocated_data() +{ + free_defaults(default_argv); + my_end(0); +} + + C_MODE_START static my_bool get_one_option(const struct my_option *, const char *, const char *); @@ -2667,11 +2676,21 @@ static void print_version(void) MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); } +static const char *default_timezone_dir= "/usr/share/zoneinfo/"; + + static void print_usage(void) { - fprintf(stderr, "Usage:\n"); - fprintf(stderr, " %s [options] timezonedir\n", my_progname); - fprintf(stderr, " %s [options] timezonefile timezonename\n", my_progname); + fprintf(stdout, "Create SQL commands for loading system timezeone data for " + "MariaDB\n\n"); + fprintf(stdout, "Usage:\n"); + fprintf(stdout, " %s [options] timezonedir\n", my_progname); + fprintf(stdout, "or\n"); + fprintf(stdout, " %s [options] timezonefile timezonename\n", my_progname); + + fprintf(stdout, "\nA typical place for the system timezone directory is " + "\"%s\"\n", default_timezone_dir); + print_defaults("my",load_default_groups); puts(""); my_print_help(my_long_options); @@ -2692,19 +2711,33 @@ get_one_option(const struct my_option *opt, const char *argument, const char *) print_version(); puts(""); print_usage(); + free_allocated_data(); exit(0); case 'V': print_version(); + free_allocated_data(); exit(0); } return 0; } +static const char *lock_tables= + "LOCK TABLES time_zone WRITE,\n" + " time_zone_leap_second WRITE,\n" + " time_zone_name WRITE,\n" + " time_zone_transition WRITE,\n" + " time_zone_transition_type WRITE;\n"; +static const char *trunc_tables_const= + "TRUNCATE TABLE time_zone;\n" + "TRUNCATE TABLE time_zone_name;\n" + "TRUNCATE TABLE time_zone_transition;\n" + "TRUNCATE TABLE time_zone_transition_type;\n"; + int main(int argc, char **argv) { - char **default_argv; + const char *trunc_tables; MY_INIT(argv[0]); load_defaults_or_exit("my", load_default_groups, &argc, &argv); @@ -2716,34 +2749,42 @@ main(int argc, char **argv) if ((argc != 1 && argc != 2) || (opt_leap && argc != 1)) { print_usage(); - free_defaults(default_argv); + free_allocated_data(); return 1; } + if (!(argc == 1 && !opt_leap)) + trunc_tables= "SELECT 'skip truncate tables';\n"; // No-op - needed for ELSE clause + else + trunc_tables= trunc_tables_const; + if (opt_skip_write_binlog) - { /* If skip_write_binlog is set and wsrep is compiled in we disable sql_log_bin and wsrep_on to avoid Galera replicating below - truncate table clauses. This will allow user to set different + TRUNCATE TABLE clauses. This will allow user to set different time zones to nodes in Galera cluster. */ printf("set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');\n" "prepare set_wsrep_write_binlog from @prep1;\n" - "set @toggle=0; execute set_wsrep_write_binlog using @toggle;\n"); - } + "set @toggle=0; execute set_wsrep_write_binlog using @toggle;\n" + "%s%s", trunc_tables, lock_tables); else - { - // Alter time zone tables to InnoDB if wsrep_on is enabled - // to allow changes to them to replicate with Galera - printf("\\d |\n" - "IF (select count(*) from information_schema.global_variables where\n" - "variable_name='wsrep_on' and variable_value='ON') = 1 THEN\n" - "ALTER TABLE time_zone ENGINE=InnoDB;\n" - "ALTER TABLE time_zone_name ENGINE=InnoDB;\n" - "ALTER TABLE time_zone_transition ENGINE=InnoDB;\n" - "ALTER TABLE time_zone_transition_type ENGINE=InnoDB;\n" - "END IF|\n" - "\\d ;\n"); - } + // Alter time zone tables to InnoDB if wsrep_on is enabled + // to allow changes to them to replicate with Galera + printf("\\d |\n" + "IF (select count(*) from information_schema.global_variables where\n" + "variable_name='wsrep_on' and variable_value='ON') = 1 THEN\n" + "ALTER TABLE time_zone ENGINE=InnoDB;\n" + "ALTER TABLE time_zone_name ENGINE=InnoDB;\n" + "ALTER TABLE time_zone_transition ENGINE=InnoDB;\n" + "ALTER TABLE time_zone_transition_type ENGINE=InnoDB;\n" + "%s" + "START TRANSACTION;\n" + "ELSE\n%s" + "END IF|\n" + "\\d ;\n", + trunc_tables, trunc_tables); + // Ideally we'd like to put lock_tables in the ELSE branch however + // "ERROR 1314 (0A000) at line 2: LOCK is not allowed in stored procedures" if (argc == 1 && !opt_leap) { @@ -2751,12 +2792,6 @@ main(int argc, char **argv) root_name_end= strmake_buf(fullname, argv[0]); - printf("TRUNCATE TABLE time_zone;\n"); - printf("TRUNCATE TABLE time_zone_name;\n"); - printf("TRUNCATE TABLE time_zone_transition;\n"); - printf("TRUNCATE TABLE time_zone_transition_type;\n"); - printf("START TRANSACTION;\n"); - if (scan_tz_dir(root_name_end, 0, opt_verbose)) { printf("ROLLBACK;\n"); @@ -2767,7 +2802,8 @@ main(int argc, char **argv) return 1; } - printf("COMMIT;\n"); + printf("UNLOCK TABLES;\n" + "COMMIT;\n"); printf("ALTER TABLE time_zone_transition " "ORDER BY Time_zone_id, Transition_time;\n"); printf("ALTER TABLE time_zone_transition_type " @@ -2791,25 +2827,24 @@ main(int argc, char **argv) print_tz_leaps_as_sql(&tz_info); else print_tz_as_sql(argv[1], &tz_info); - + printf("UNLOCK TABLES;\n" + "COMMIT;\n"); free_root(&tz_storage, MYF(0)); } if(!opt_skip_write_binlog) - { - // Fall back to Aria - printf("\\d |\n" - "IF (select count(*) from information_schema.global_variables where\n" - "variable_name='wsrep_on' and variable_value='ON') = 1 THEN\n" - "ALTER TABLE time_zone ENGINE=Aria;\n" - "ALTER TABLE time_zone_name ENGINE=Aria;\n" - "ALTER TABLE time_zone_transition ENGINE=Aria;\n" - "ALTER TABLE time_zone_transition_type ENGINE=Aria;\n" - "END IF|\n" - "\\d ;\n"); - } - - free_defaults(default_argv); + // Fall back to Aria + printf("\\d |\n" + "IF (select count(*) from information_schema.global_variables where\n" + "variable_name='wsrep_on' and variable_value='ON') = 1 THEN\n" + "ALTER TABLE time_zone ENGINE=Aria;\n" + "ALTER TABLE time_zone_name ENGINE=Aria;\n" + "ALTER TABLE time_zone_transition ENGINE=Aria, ORDER BY Time_zone_id, Transition_time;\n" + "ALTER TABLE time_zone_transition_type ENGINE=Aria, ORDER BY Time_zone_id, Transition_type_id;\n" + "END IF|\n" + "\\d ;\n"); + + free_allocated_data(); my_end(0); return 0; } diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 641e203d442..7caea70f685 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -1,5 +1,5 @@ -/* Copyright 2008-2021 Codership Oy <http://www.codership.com> - Copyright (c) 2020, 2021, MariaDB +/* Copyright (c) 2008, 2022 Codership Oy <http://www.codership.com> + Copyright (c) 2020, 2022, 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 @@ -800,7 +800,6 @@ int wsrep_init_server() void wsrep_init_globals() { - wsrep_gtid_server.domain_id= wsrep_gtid_domain_id; wsrep_init_sidno(Wsrep_server_state::instance().connected_gtid().id()); /* Recover last written wsrep gtid */ wsrep_init_gtid(); @@ -815,6 +814,13 @@ void wsrep_init_globals() wsrep_get_binlog_gtid_seqno(new_gtid); wsrep_gtid_server.gtid(new_gtid); } + else + { + if (wsrep_gtid_mode && wsrep_gtid_server.server_id != global_system_variables.server_id) + { + WSREP_WARN("Ignoring server id for non bootstrap node."); + } + } wsrep_init_schema(); if (WSREP_ON) { @@ -1140,6 +1146,15 @@ bool wsrep_start_replication(const char *wsrep_cluster_address) DBUG_ASSERT(wsrep_cluster_address[0]); + // --wsrep-new-cluster flag is not used, checking wsrep_cluster_address + // it should match gcomm:// only to be considered as bootstrap node. + // This logic is used in galera. + if (!wsrep_new_cluster && (strlen(wsrep_cluster_address) == 8) && + !strncmp(wsrep_cluster_address, "gcomm://", 8)) + { + wsrep_new_cluster= true; + } + bool const bootstrap(TRUE == wsrep_new_cluster); WSREP_INFO("Start replication"); @@ -1605,20 +1620,29 @@ wsrep_append_fk_parent_table(THD* thd, TABLE_LIST* tables, wsrep::key_array* key TABLE_LIST *table; TABLE_LIST *table_last_in_list; + for (table= tables; table; table= table->next_local) + { + if (is_temporary_table(table)) + { + WSREP_DEBUG("Temporary table %s.%s already opened query=%s", table->db.str, + table->table_name.str, wsrep_thd_query(thd)); + return false; + } + } + thd->release_transactional_locks(); uint counter; MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint(); - for (table_last_in_list= tables;;table_last_in_list= table_last_in_list->next_local) { + for (table_last_in_list= tables;;table_last_in_list= table_last_in_list->next_local) { if (!table_last_in_list->next_local) { break; } } - if (thd->open_temporary_tables(tables) || - open_tables(thd, &tables, &counter, MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL)) + if (open_tables(thd, &tables, &counter, MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL)) { - WSREP_DEBUG("unable to open table for FK checks for %s", thd->query()); + WSREP_DEBUG("Unable to open table for FK checks for %s", wsrep_thd_query(thd)); fail= true; goto exit; } @@ -3318,21 +3342,17 @@ bool wsrep_create_like_table(THD* thd, TABLE_LIST* table, } else { - /* here we have CREATE TABLE LIKE <temporary table> - the temporary table definition will be needed in slaves to - enable the create to succeed - */ - TABLE_LIST tbl; - bzero((void*) &tbl, sizeof(tbl)); - tbl.db= src_table->db; - tbl.table_name= tbl.alias= src_table->table_name; - tbl.table= src_table->table; + /* Non-MERGE tables ignore this call. */ + if (src_table->table->file->extra(HA_EXTRA_ADD_CHILDREN_LIST)) + return (true); + char buf[2048]; String query(buf, sizeof(buf), system_charset_info); query.length(0); // Have to zero it since constructor doesn't - (void) show_create_table(thd, &tbl, &query, NULL, WITH_DB_NAME); - WSREP_DEBUG("TMP TABLE: %s", query.ptr()); + int result __attribute__((unused))= + show_create_table(thd, src_table, &query, NULL, WITH_DB_NAME); + WSREP_DEBUG("TMP TABLE: %s ret_code %d", query.ptr(), result); thd->wsrep_TOI_pre_query= query.ptr(); thd->wsrep_TOI_pre_query_len= query.length(); @@ -3341,6 +3361,9 @@ bool wsrep_create_like_table(THD* thd, TABLE_LIST* table, thd->wsrep_TOI_pre_query= NULL; thd->wsrep_TOI_pre_query_len= 0; + + /* Non-MERGE tables ignore this call. */ + src_table->table->file->extra(HA_EXTRA_DETACH_CHILDREN); } return(false); diff --git a/sql/wsrep_schema.cc b/sql/wsrep_schema.cc index 48077040f88..3d90f425ec8 100644 --- a/sql/wsrep_schema.cc +++ b/sql/wsrep_schema.cc @@ -623,9 +623,11 @@ static int init_for_index_scan(TABLE* table, const uchar* key, */ static int end_index_scan(TABLE* table) { int error; - if ((error= table->file->ha_index_end())) { - WSREP_ERROR("Failed to end scan: %d", error); - return 1; + if (table->file->inited) { + if ((error= table->file->ha_index_end())) { + WSREP_ERROR("Failed to end scan: %d", error); + return 1; + } } return 0; } diff --git a/storage/columnstore/CMakeLists.txt b/storage/columnstore/CMakeLists.txt index 6669862f038..f2af02c2366 100644 --- a/storage/columnstore/CMakeLists.txt +++ b/storage/columnstore/CMakeLists.txt @@ -13,6 +13,11 @@ macro(APPEND_FOR_CPACK V) set(${V} "${var}${ARGN}" PARENT_SCOPE) endmacro() +# don't use compression providers, there are standalone executables below +GET_PROPERTY(dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES) +LIST(REMOVE_ITEM dirs ${CMAKE_SOURCE_DIR}/include/providers) +SET_PROPERTY(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "${dirs}") + IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") diff --git a/storage/columnstore/columnstore b/storage/columnstore/columnstore -Subproject 4dc5d3af0579a50ac1b4d158d2ff0bcdf960ac0 +Subproject f6dcc41519bcea7cecb103fd280c3c2812e1e2b diff --git a/storage/connect/bsonudf.cpp b/storage/connect/bsonudf.cpp index f513ffbdeab..95d117113a2 100644 --- a/storage/connect/bsonudf.cpp +++ b/storage/connect/bsonudf.cpp @@ -203,7 +203,7 @@ my_bool BJNX::SetArrayOptions(PGLOBAL g, char* p, int i, PSZ nm) p[--n] = 0; } else if (!IsNum(p)) { // Wrong array specification - sprintf(g->Message, "Invalid array specification %s", p); + snprintf(g->Message, sizeof(g->Message), "Invalid array specification %s", p); return true; } // endif p diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 17e50b5c56b..bc3e9b0cbc7 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -5721,10 +5721,10 @@ static int connect_assisted_discovery(handlerton *, THD* thd, if (ttp == TAB_UNDEF && !topt->http) { topt->type= (src) ? "MYSQL" : (tab) ? "PROXY" : "DOS"; ttp= GetTypeID(topt->type); - sprintf(g->Message, "No table_type. Was set to %s", topt->type); + snprintf(g->Message, sizeof(g->Message), "No table_type. Was set to %s", topt->type); push_warning(thd, Sql_condition::WARN_LEVEL_NOTE, ER_UNKNOWN_ERROR, g->Message); } else if (ttp == TAB_NIY) { - sprintf(g->Message, "Unsupported table type %s", topt->type); + snprintf(g->Message, sizeof(g->Message), "Unsupported table type %s", topt->type); rc= HA_ERR_INTERNAL_ERROR; goto err; #if defined(REST_SUPPORT) diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp index 4a92990d233..2b77061df5d 100644 --- a/storage/connect/jsonudf.cpp +++ b/storage/connect/jsonudf.cpp @@ -124,7 +124,7 @@ my_bool JSNX::SetArrayOptions(PGLOBAL g, char *p, int i, PSZ nm) p[--n] = 0; } else if (!IsNum(p)) { // Wrong array specification - sprintf(g->Message, "Invalid array specification %s", p); + snprintf(g->Message, sizeof(g->Message), "Invalid array specification %s", p); return true; } // endif p diff --git a/storage/connect/myconn.cpp b/storage/connect/myconn.cpp index f8d56f76524..f5f105d457c 100644 --- a/storage/connect/myconn.cpp +++ b/storage/connect/myconn.cpp @@ -399,15 +399,19 @@ PQRYRES SrcColumns(PGLOBAL g, const char *host, const char *db, int w; MYSQLC myc; PQRYRES qrp = NULL; + const char *p; if (!port) port = mysqld_port; if (!strnicmp(srcdef, "select ", 7) || strstr(srcdef, "%s")) { - query = (char *)PlugSubAlloc(g, NULL, strlen(srcdef) + 10); + query = (char *)PlugSubAlloc(g, NULL, strlen(srcdef) + 10); - if (strstr(srcdef, "%s")) - sprintf(query, srcdef, "1=1"); // dummy where clause + if ((p= strstr(srcdef, "%s"))) + { + /* Replace %s with 1=1 */ + sprintf(query, "%.*s1=1%s", (int) (p - srcdef), srcdef, p + 2); // dummy where clause + } else strcpy(query, srcdef); diff --git a/storage/connect/mysql-test/connect/r/misc.result b/storage/connect/mysql-test/connect/r/misc.result new file mode 100644 index 00000000000..6b6372f6e41 --- /dev/null +++ b/storage/connect/mysql-test/connect/r/misc.result @@ -0,0 +1,54 @@ +execute immediate concat('create table t engine=CONNECT table_type=JSON',REPEAT('1',5000), +' FILE_NAME=''users.json'' HTTP=''http://localhost:4142'' URI=''/users'''); +ERROR HY000: Unsupported table type JSON1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 +execute immediate concat('create table t engine=CONNECT table_type=OEM module=''libname'' +Option_list=''Myopt=foo'' subtype=''MYTYPE',REPEAT('1', 10000), ''''); +ERROR HY000: Subtype string too long +execute immediate concat('create table t engine=CONNECT table_type=DBF file_name=''', +REPLACE(@@secure_file_priv,'\\','/'),'cust.dbf', REPEAT('1', 10000), ''''); +ERROR HY000: Cannot open +create table t engine=connect table_type=mysql +CONNECTION='mysql://root@localhost:MASTER_MYPORT/test/foobar' + SRCDEF='SELECT 1,''%n'' FROM DUAL WHERE %s'; +select *from t; +ERROR HY000: Got error 174 'MakeSQL: Wrong place holders specification' from CONNECT +drop table t; +create table t engine=connect table_type=mysql +CONNECTION='mysql://root@localhost:MASTER_MYPORT/test/foobar' + SRCDEF='SELECT 1,%n FROM DUAL WHERE %s'; +ERROR HY000: (1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '%n FROM DUAL WHERE 1=1 LIMIT 0' at line 1 [SELECT 1,%n FROM DUAL WHERE 1=1 LIMIT 0] +create table t engine=connect table_type=mysql +CONNECTION='mysql://root@localhost:MASTER_MYPORT/test/foobar' + SRCDEF='SELECT 1 FROM DUAL WHERE %s'; +select *from t; +1 +1 +drop table t; +create table beers ( +`Name` char(16) xpath='brandName', +`Origin` char(16) xpath='origin', +`Description` char(32) xpath='details') +engine=CONNECT table_type=XML file_name='MYSQLTEST_VARDIR/tmp/beer.xml' +tabname='table' option_list='rownode=tr,colnode=td%n'; +select * from beers; +Name Origin Description +NULL NULL NULL +NULL NULL NULL +drop table beers; +create table beers ( +`Name` char(16) xpath='brandName', +`Origin` char(16) xpath='origin', +`Description` char(32) xpath='details') +engine=CONNECT table_type=XML file_name='MYSQLTEST_VARDIR/tmp/beer.xml' +tabname='table' option_list='rownode=tr,colnode=td'; +insert into beers values('11','22','33'); +drop table beers; +execute immediate CONCAT('create table jsampall +(Author char(128) jpath=''$.AUTHOR["', REPEAT('a',10000),'"]'') +engine=CONNECT table_type=JSON +file_name=''',REPLACE(@@secure_file_priv,'\\','/'),'tmp/test.json'''); +select author from jsampall; +author +Jean-Christophe Bernadacaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +William J. Pardi +drop table jsampall; diff --git a/storage/connect/mysql-test/connect/t/misc.test b/storage/connect/mysql-test/connect/t/misc.test new file mode 100644 index 00000000000..4dc8dded651 --- /dev/null +++ b/storage/connect/mysql-test/connect/t/misc.test @@ -0,0 +1,141 @@ + +# Overlong table type +--error ER_UNKNOWN_ERROR +execute immediate concat('create table t engine=CONNECT table_type=JSON',REPEAT('1',5000), +' FILE_NAME=''users.json'' HTTP=''http://localhost:4142'' URI=''/users'''); + +# Overlong subtype +--error ER_UNKNOWN_ERROR +execute immediate concat('create table t engine=CONNECT table_type=OEM module=''libname'' +Option_list=''Myopt=foo'' subtype=''MYTYPE',REPEAT('1', 10000), ''''); + + +# Overlong filename +--error ER_UNKNOWN_ERROR +execute immediate concat('create table t engine=CONNECT table_type=DBF file_name=''', + REPLACE(@@secure_file_priv,'\\','/'),'cust.dbf', REPEAT('1', 10000), ''''); + + +# Format string in SRCDEF +--replace_result $MASTER_MYPORT MASTER_MYPORT +eval create table t engine=connect table_type=mysql + CONNECTION='mysql://root@localhost:$MASTER_MYPORT/test/foobar' + SRCDEF='SELECT 1,''%n'' FROM DUAL WHERE %s'; +--error ER_GET_ERRMSG +select *from t; +drop table t; + +--replace_result $MASTER_MYPORT MASTER_MYPORT +--error ER_UNKNOWN_ERROR +eval create table t engine=connect table_type=mysql + CONNECTION='mysql://root@localhost:$MASTER_MYPORT/test/foobar' + SRCDEF='SELECT 1,%n FROM DUAL WHERE %s'; + +--replace_result $MASTER_MYPORT MASTER_MYPORT +eval create table t engine=connect table_type=mysql + CONNECTION='mysql://root@localhost:$MASTER_MYPORT/test/foobar' + SRCDEF='SELECT 1 FROM DUAL WHERE %s'; +select *from t; +drop table t; + +write_file $MYSQLTEST_VARDIR/tmp/beer.xml; +<?xml version="1.0"?> +<Beers> + <table> + <th><td>Name</td><td>Origin</td><td>Description</td></th> + <tr> + <td><brandName>Huntsman</brandName></td> + <td><origin>Bath, UK</origin></td> + <td><details>Wonderful hop, light alcohol</details></td> + </tr> + <tr> + <td><brandName>Tuborg</brandName></td> + <td><origin>Danmark</origin></td> + <td><details>In small bottles</details></td> + </tr> + </table> +</Beers> +EOF + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +# Format string in colnode +eval create table beers ( +`Name` char(16) xpath='brandName', +`Origin` char(16) xpath='origin', +`Description` char(32) xpath='details') +engine=CONNECT table_type=XML file_name='$MYSQLTEST_VARDIR/tmp/beer.xml' +tabname='table' option_list='rownode=tr,colnode=td%n'; +select * from beers; +drop table beers; + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval create table beers ( +`Name` char(16) xpath='brandName', +`Origin` char(16) xpath='origin', +`Description` char(32) xpath='details') +engine=CONNECT table_type=XML file_name='$MYSQLTEST_VARDIR/tmp/beer.xml' +tabname='table' option_list='rownode=tr,colnode=td'; +insert into beers values('11','22','33'); +drop table beers; + +remove_file $MYSQLTEST_VARDIR/tmp/beer.xml; + +write_file $MYSQLTEST_VARDIR/tmp/test.json; +[ + { + "ISBN": "9782212090819", + "LANG": "fr", + "SUBJECT": "applications", + "AUTHOR": [ + { + "FIRSTNAME": "Jean-Christophe", + "LASTNAME": "Bernadac" + }, + { + "FIRSTNAME": "François", + "LASTNAME": "Knab" + } + ], + "TITLE": "Construire une application XML", + "PUBLISHER": { + "NAME": "Eyrolles", + "PLACE": "Paris" + }, + "DATEPUB": 1999 + }, + { + "ISBN": "9782840825685", + "LANG": "fr", + "SUBJECT": "applications", + "AUTHOR": [ + { + "FIRSTNAME": "William J.", + "LASTNAME": "Pardi" + } + ], + "TITLE": "XML en Action", + "TRANSLATED": { + "PREFIX": "adapté de l'anglais par", + "TRANSLATOR": { + "FIRSTNAME": "James", + "LASTNAME": "Guerin" + } + }, + "PUBLISHER": { + "NAME": "Microsoft Press", + "PLACE": "Paris" + }, + "DATEPUB": 1999 + } +] +EOF + +execute immediate CONCAT('create table jsampall +(Author char(128) jpath=''$.AUTHOR["', REPEAT('a',10000),'"]'') +engine=CONNECT table_type=JSON +file_name=''',REPLACE(@@secure_file_priv,'\\','/'),'tmp/test.json'''); + +select author from jsampall; +drop table jsampall; +remove_file $MYSQLTEST_VARDIR/tmp/test.json; + diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp index 50069b7433b..e8470628b6f 100644 --- a/storage/connect/odbconn.cpp +++ b/storage/connect/odbconn.cpp @@ -1422,7 +1422,7 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols) PGLOBAL& g = m_G; void *buffer; bool b; - UWORD n; + UWORD n, k; SWORD len, tp, ncol = 0; ODBCCOL *colp; RETCODE rc; @@ -1489,15 +1489,16 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols) } else { do { rc = SQLExecDirect(hstmt, (PUCHAR)sql, SQL_NTS); - } while (rc == SQL_STILL_EXECUTING); + } while (rc == SQL_STILL_EXECUTING); if (!Check(rc)) ThrowDBX(rc, "SQLExecDirect", hstmt); do { rc = SQLNumResultCols(hstmt, &ncol); - } while (rc == SQL_STILL_EXECUTING); + } while (rc == SQL_STILL_EXECUTING); + k = 0; // used for column number } // endif Srcdef for (n = 0, colp = tocols; colp; colp = (PODBCCOL)colp->GetNext()) @@ -1519,18 +1520,23 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols) sprintf(m_G->Message, MSG(INV_COLUMN_TYPE), colp->GetResultType(), SVP(colp->GetName())); ThrowDBX(m_G->Message); - } // endif tp + } // endif tp + + if (m_Tdb->Srcdef) + k = colp->GetIndex(); + else + k++; if (trace(1)) htrc("Binding col=%u type=%d buf=%p len=%d slen=%p\n", - n, tp, buffer, len, colp->GetStrLen()); + k, tp, buffer, len, colp->GetStrLen()); - rc = SQLBindCol(hstmt, colp->GetIndex(), tp, buffer, len, colp->GetStrLen()); + rc = SQLBindCol(hstmt, k, tp, buffer, len, colp->GetStrLen()); if (!Check(rc)) ThrowDBX(rc, "SQLBindCol", hstmt); - } // endif pcol + } // endif colp } catch(DBX *x) { if (trace(1)) diff --git a/storage/connect/plugutil.cpp b/storage/connect/plugutil.cpp index a63eee75c1b..f481cd1034b 100644 --- a/storage/connect/plugutil.cpp +++ b/storage/connect/plugutil.cpp @@ -259,6 +259,12 @@ LPCSTR PlugSetPath(LPSTR pBuff, LPCSTR prefix, LPCSTR FileName, LPCSTR defpath) if (trace(2)) htrc("prefix=%-.256s fn=%-.256s path=%-.256s\n", prefix, FileName, defpath); + if (strlen(FileName) >= _MAX_PATH) + { + *pBuff= 0; /* Hope this is treated as error of some kind*/ + return FileName; + } + if (!strncmp(FileName, "//", 2) || !strncmp(FileName, "\\\\", 2)) { strcpy(pBuff, FileName); // Remote file return pBuff; diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp index 954c6b67549..51fc176d8d6 100644 --- a/storage/connect/reldef.cpp +++ b/storage/connect/reldef.cpp @@ -93,7 +93,12 @@ PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char* tab, char* db, bool info) if (check_valid_path(module, strlen(module))) { strcpy(g->Message, "Module cannot contain a path"); return NULL; - } else + } + else if (strlen(subtype)+1+3 >= sizeof(getname)) { + strcpy(g->Message, "Subtype string too long"); + return NULL; + } + else PlugSetPath(soname, module, GetPluginDir()); // The exported name is always in uppercase diff --git a/storage/connect/tabbson.cpp b/storage/connect/tabbson.cpp index 871a54c8c94..23bac92efd8 100644 --- a/storage/connect/tabbson.cpp +++ b/storage/connect/tabbson.cpp @@ -1788,7 +1788,7 @@ bool BSONCOL::SetArrayOptions(PGLOBAL g, char* p, int i, PSZ nm) p[--n] = 0; } else if (!IsNum(p)) { // Wrong array specification - sprintf(g->Message, "Invalid array specification %s for %s", p, Name); + snprintf(g->Message, sizeof(g->Message), "Invalid array specification %s for %s", p, Name); return true; } // endif p diff --git a/storage/connect/tabext.cpp b/storage/connect/tabext.cpp index 212d27f06d1..4dc0f4e86d9 100644 --- a/storage/connect/tabext.cpp +++ b/storage/connect/tabext.cpp @@ -142,8 +142,14 @@ bool EXTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) Username = GetStringCatInfo(g, "User", NULL); Password = GetStringCatInfo(g, "Password", NULL); - if ((Srcdef = GetStringCatInfo(g, "Srcdef", NULL))) + // Memory was Boolean, it is now integer + if (!(Memory = GetIntCatInfo("Memory", 0))) + Memory = GetBoolCatInfo("Memory", false) ? 1 : 0; + + if ((Srcdef = GetStringCatInfo(g, "Srcdef", NULL))) { Read_Only = true; + if (Memory == 2) Memory = 1; + } // endif Srcdef Qrystr = GetStringCatInfo(g, "Query_String", "?"); Sep = GetStringCatInfo(g, "Separator", NULL); @@ -166,10 +172,6 @@ bool EXTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) if (Catfunc == FNC_TABLE) Tabtyp = GetStringCatInfo(g, "Tabtype", NULL); - // Memory was Boolean, it is now integer - if (!(Memory = GetIntCatInfo("Memory", 0))) - Memory = GetBoolCatInfo("Memory", false) ? 1 : 0; - Pseudo = 2; // FILID is Ok but not ROWID return false; } // end of DefineAM @@ -284,6 +286,37 @@ int TDBEXT::Decode(PCSZ txt, char *buf, size_t n) return 0; } // end of Decode +/* + Count number of %s placeholders in string. + Returns -1 if other sprintf placeholders are found, .g %d +*/ +static int count_placeholders(const char *fmt) +{ + int cnt= 0; + for (const char *p=fmt; *p; p++) + { + if (*p == '%') + { + switch (p[1]) + { + case 's': + /* %s found */ + cnt++; + p++; + break; + case '%': + /* masking char for % found */ + p++; + break; + default: + /* some other placeholder found */ + return -1; + } + } + } + return cnt; +} + /***********************************************************************/ /* MakeSrcdef: make the SQL statement from SRDEF option. */ /***********************************************************************/ @@ -308,16 +341,29 @@ bool TDBEXT::MakeSrcdef(PGLOBAL g) ? To_CondFil->Having : PlugDup(g, "1=1"); } // endif ph - if (!stricmp(ph, "W")) { + int n_placeholders = count_placeholders(Srcdef); + if (n_placeholders < 0) + { + strcpy(g->Message, "MakeSQL: Wrong place holders specification"); + return true; + } + + if (!stricmp(ph, "W") && n_placeholders <= 1) { Query = new(g)STRING(g, strlen(Srcdef) + strlen(fil1)); Query->SetLength(sprintf(Query->GetStr(), Srcdef, fil1)); - } else if (!stricmp(ph, "WH")) { + } + else if (!stricmp(ph, "WH") && n_placeholders <= 2) + { Query = new(g)STRING(g, strlen(Srcdef) + strlen(fil1) + strlen(fil2)); Query->SetLength(sprintf(Query->GetStr(), Srcdef, fil1, fil2)); - } else if (!stricmp(ph, "H")) { + } + else if (!stricmp(ph, "H") && n_placeholders <= 1) + { Query = new(g)STRING(g, strlen(Srcdef) + strlen(fil2)); Query->SetLength(sprintf(Query->GetStr(), Srcdef, fil2)); - } else if (!stricmp(ph, "HW")) { + } + else if (!stricmp(ph, "HW") && n_placeholders <= 2) + { Query = new(g)STRING(g, strlen(Srcdef) + strlen(fil1) + strlen(fil2)); Query->SetLength(sprintf(Query->GetStr(), Srcdef, fil2, fil1)); } else { diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp index 07a4712e8b0..8f1d9e1e0e5 100644 --- a/storage/connect/tabjson.cpp +++ b/storage/connect/tabjson.cpp @@ -1383,7 +1383,7 @@ bool JSONCOL::SetArrayOptions(PGLOBAL g, char *p, int i, PSZ nm) p[--n] = 0; } else if (!IsNum(p)) { // Wrong array specification - sprintf(g->Message, "Invalid array specification %s for %s", p, Name); + snprintf(g->Message, sizeof(g->Message), "Invalid array specification %s for %s", p, Name); return true; } // endif p diff --git a/storage/connect/tabmysql.cpp b/storage/connect/tabmysql.cpp index b14b0b14231..fb5d1b35bc2 100644 --- a/storage/connect/tabmysql.cpp +++ b/storage/connect/tabmysql.cpp @@ -904,6 +904,11 @@ bool TDBMYSQL::OpenDB(PGLOBAL g) /*********************************************************************/ if (Mode == MODE_READ || Mode == MODE_READX) { MakeSelect(g, Mode == MODE_READX); + if (Mode == MODE_READ && !Query) + { + Myc.Close(); + return true; + } m_Rc = (Mode == MODE_READ) ? Myc.ExecSQL(g, Query->GetStr()) : RC_OK; diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index c56f2bea110..ceba0a25ef7 100644 --- a/storage/connect/tabxml.cpp +++ b/storage/connect/tabxml.cpp @@ -1519,9 +1519,13 @@ bool XMLCOL::ParseXpath(PGLOBAL g, bool mode) if (!mode) // Take care of an eventual extra column node a la html if (Tdbp->Colname) { - sprintf(pbuf, Tdbp->Colname, Rank + ((Tdbp->Usedom) ? 0 : 1)); - strcat(pbuf, "/"); - } // endif Colname + char *p = strstr(Tdbp->Colname, "%d"); + if (p) + snprintf(pbuf, len + 3, "%.*s%d%s/", (int) (p - Tdbp->Colname), Tdbp->Colname, + Rank + (Tdbp->Usedom ? 0 : 1), p + 2); + else + snprintf(pbuf, len + 3, "%s/", Tdbp->Colname); + } // endif Colname if (Xname) { if (Type == 2) { @@ -1811,6 +1815,9 @@ void XMLCOL::WriteColumn(PGLOBAL g) else if (Tdbp->Clist) ColNode = NULL; + // refresh CList in case its Listp was freed in SelectSingleNode above + if (Tdbp->Clist) + Tdbp->RowNode->SelectNodes(g, Tdbp->Colname, Tdbp->Clist); } // endfor i /*********************************************************************/ diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h index 2e785f87858..0c6285f3ac6 100644 --- a/storage/federated/ha_federated.h +++ b/storage/federated/ha_federated.h @@ -146,7 +146,7 @@ public: HA_NO_PREFIX_CHAR_KEYS | HA_PRIMARY_KEY_REQUIRED_FOR_DELETE | HA_NO_TRANSACTIONS /* until fixed by WL#2952 */ | HA_PARTIAL_COLUMN_READ | HA_NULL_IN_KEY | - HA_CAN_ONLINE_BACKUPS | + HA_CAN_ONLINE_BACKUPS | HA_NON_COMPARABLE_ROWID | HA_CAN_REPAIR); } /* @@ -238,6 +238,19 @@ public: int rnd_next_int(uchar *buf); int rnd_pos(uchar *buf, uchar *pos); //required void position(const uchar *record); //required + /* + A ref is a pointer inside a local buffer. It is not comparable to + other ref's. This is never called as HA_NON_COMPARABLE_ROWID is set. + */ + int cmp_ref(const uchar *ref1, const uchar *ref2) + { +#ifdef NOT_YET + DBUG_ASSERT(0); + return 0; +#else + return handler::cmp_ref(ref1,ref2); /* Works if table scan is used */ +#endif + } int info(uint); //required int extra(ha_extra_function operation); diff --git a/storage/federatedx/ha_federatedx.h b/storage/federatedx/ha_federatedx.h index 665cb303fba..377af888d79 100644 --- a/storage/federatedx/ha_federatedx.h +++ b/storage/federatedx/ha_federatedx.h @@ -336,7 +336,7 @@ public: | HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_CAN_INDEX_BLOBS | HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_CAN_REPAIR | HA_PRIMARY_KEY_REQUIRED_FOR_DELETE | HA_CAN_ONLINE_BACKUPS | - HA_PARTIAL_COLUMN_READ | HA_NULL_IN_KEY); + HA_PARTIAL_COLUMN_READ | HA_NULL_IN_KEY | HA_NON_COMPARABLE_ROWID); } /* This is a bitmap of flags that says how the storage engine @@ -426,6 +426,19 @@ public: int rnd_next(uchar *buf); //required int rnd_pos(uchar *buf, uchar *pos); //required void position(const uchar *record); //required + /* + A ref is a pointer inside a local buffer. It is not comparable to + other ref's. This is never called as HA_NON_COMPARABLE_ROWID is set. + */ + int cmp_ref(const uchar *ref1, const uchar *ref2) + { +#ifdef NOT_YET + DBUG_ASSERT(0); + return 0; +#else + return handler::cmp_ref(ref1,ref2); /* Works if table scan is used */ +#endif + } int info(uint); //required int extra(ha_extra_function operation); diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index 5c138d41f58..702bb843729 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -78,19 +78,19 @@ SET(INNOBASE_SOURCES handler/i_s.cc ibuf/ibuf0ibuf.cc include/btr0btr.h - include/btr0btr.ic + include/btr0btr.inl include/btr0bulk.h include/btr0cur.h - include/btr0cur.ic + include/btr0cur.inl include/btr0defragment.h include/btr0pcur.h - include/btr0pcur.ic + include/btr0pcur.inl include/btr0sea.h - include/btr0sea.ic + include/btr0sea.inl include/btr0types.h include/buf0buddy.h include/buf0buf.h - include/buf0buf.ic + include/buf0buf.inl include/buf0checksum.h include/buf0dblwr.h include/buf0dump.h @@ -99,36 +99,36 @@ SET(INNOBASE_SOURCES include/buf0rea.h include/buf0types.h include/data0data.h - include/data0data.ic + include/data0data.inl include/data0type.h - include/data0type.ic + include/data0type.inl include/data0types.h include/db0err.h include/dict0boot.h include/dict0crea.h - include/dict0crea.ic + include/dict0crea.inl include/dict0defrag_bg.h include/dict0dict.h - include/dict0dict.ic + include/dict0dict.inl include/dict0load.h include/dict0mem.h - include/dict0mem.ic + include/dict0mem.inl include/dict0pagecompress.h - include/dict0pagecompress.ic + include/dict0pagecompress.inl include/dict0stats.h - include/dict0stats.ic + include/dict0stats.inl include/dict0stats_bg.h include/dict0types.h include/dyn0buf.h include/dyn0types.h include/eval0eval.h - include/eval0eval.ic + include/eval0eval.inl include/eval0proc.h - include/eval0proc.ic + include/eval0proc.inl include/fil0crypt.h - include/fil0crypt.ic + include/fil0crypt.inl include/fil0fil.h - include/fil0fil.ic + include/fil0fil.inl include/fil0pagecompress.h include/fsp0file.h include/fsp0fsp.h @@ -142,97 +142,97 @@ SET(INNOBASE_SOURCES include/fts0pars.h include/fts0plugin.h include/fts0priv.h - include/fts0priv.ic + include/fts0priv.inl include/fts0tlex.h include/fts0tokenize.h include/fts0types.h - include/fts0types.ic + include/fts0types.inl include/fts0vlc.h include/fut0fut.h include/fut0lst.h include/gis0geo.h include/gis0rtree.h - include/gis0rtree.ic + include/gis0rtree.inl include/gis0type.h include/ha_prototypes.h include/ha0ha.h - include/ha0ha.ic + include/ha0ha.inl include/ha0storage.h - include/ha0storage.ic + include/ha0storage.inl include/handler0alter.h include/hash0hash.h include/ibuf0ibuf.h - include/ibuf0ibuf.ic + include/ibuf0ibuf.inl/ include/ibuf0types.h include/lock0iter.h include/lock0lock.h - include/lock0lock.ic + include/lock0lock.inl include/lock0prdt.h include/lock0priv.h - include/lock0priv.ic + include/lock0priv.inl include/lock0types.h include/log0crypt.h include/log0log.h - include/log0log.ic + include/log0log.inl include/log0recv.h include/log0types.h include/mach0data.h - include/mach0data.ic + include/mach0data.inl include/mem0mem.h - include/mem0mem.ic + include/mem0mem.inl include/mtr0log.h include/mtr0mtr.h - include/mtr0mtr.ic + include/mtr0mtr.inl include/mtr0types.h include/os0file.h - include/os0file.ic + include/os0file.inl include/os0thread.h include/page0cur.h - include/page0cur.ic + include/page0cur.inl include/page0page.h - include/page0page.ic + include/page0page.inl include/page0types.h include/page0zip.h - include/page0zip.ic + include/page0zip.inl include/pars0grm.h include/pars0opt.h include/pars0pars.h include/pars0sym.h include/pars0types.h include/que0que.h - include/que0que.ic + include/que0que.inl include/que0types.h include/read0types.h include/rem0cmp.h - include/rem0cmp.ic + include/rem0cmp.inl include/rem0rec.h - include/rem0rec.ic + include/rem0rec.inl include/rem0types.h include/row0ext.h - include/row0ext.ic + include/row0ext.inl include/row0ftsort.h include/row0import.h include/row0ins.h include/row0log.h - include/row0log.ic + include/row0log.inl include/row0merge.h include/row0mysql.h include/row0purge.h include/row0quiesce.h include/row0row.h - include/row0row.ic + include/row0row.inl include/row0sel.h - include/row0sel.ic + include/row0sel.inl include/row0types.h include/row0uins.h include/row0umod.h include/row0undo.h include/row0upd.h - include/row0upd.ic + include/row0upd.inl include/row0vers.h include/rw_lock.h include/srv0mon.h - include/srv0mon.ic + include/srv0mon.inl include/srv0srv.h include/srv0start.h include/srw_lock.h @@ -240,38 +240,38 @@ SET(INNOBASE_SOURCES include/trx0i_s.h include/trx0purge.h include/trx0rec.h - include/trx0rec.ic + include/trx0rec.inl include/trx0roll.h include/trx0rseg.h - include/trx0rseg.ic + include/trx0rseg.inl include/trx0sys.h include/trx0trx.h - include/trx0trx.ic + include/trx0trx.inl include/trx0types.h include/trx0undo.h - include/trx0undo.ic + include/trx0undo.inl include/trx0xa.h include/univ.i include/ut0byte.h - include/ut0byte.ic + include/ut0byte.inl include/ut0counter.h include/ut0dbg.h include/ut0list.h - include/ut0list.ic + include/ut0list.inl include/ut0lst.h include/ut0mem.h - include/ut0mem.ic + include/ut0mem.inl include/ut0new.h include/ut0pool.h include/ut0rbt.h include/ut0rnd.h - include/ut0rnd.ic + include/ut0rnd.inl include/ut0sort.h include/ut0stage.h include/ut0ut.h - include/ut0ut.ic + include/ut0ut.inl include/ut0vec.h - include/ut0vec.ic + include/ut0vec.inl include/ut0wqueue.h lock/lock0iter.cc lock/lock0prdt.cc diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 88493e2b54d..e15d7b7140a 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -2647,7 +2647,6 @@ loop: } } else { buf_read_ahead_random(page_id, zip_size, ibuf_inside(mtr)); - retries = 0; } ut_d(if (!(++buf_dbg_counter % 5771)) buf_pool.validate()); @@ -2666,15 +2665,45 @@ ignore_block: return nullptr; } - if (UNIV_LIKELY(block->page.frame != nullptr)) { - /* A read-fix is released after block->page.lock - in buf_page_t::read_complete() or - buf_pool_t::corrupted_evict(), or - after buf_zip_decompress() in this function. */ - block->page.lock.s_lock(); - state = block->page.state(); - block->page.lock.s_unlock(); - ut_ad(state < buf_page_t::READ_FIX); + /* A read-fix is released after block->page.lock + in buf_page_t::read_complete() or + buf_pool_t::corrupted_evict(), or + after buf_zip_decompress() in this function. */ + block->page.lock.s_lock(); + state = block->page.state(); + ut_ad(state < buf_page_t::READ_FIX); + const page_id_t id{block->page.id()}; + block->page.lock.s_unlock(); + + if (UNIV_UNLIKELY(id != page_id)) { + ut_ad(id == page_id_t{~0ULL}); + block->page.unfix(); + if (++retries < BUF_PAGE_READ_MAX_RETRIES) { + goto loop; + } + + if (err) { + *err = DB_PAGE_CORRUPTED; + } + + if (page_id.space() == TRX_SYS_SPACE) { + } else if (page_id.space() == SRV_TMP_SPACE_ID) { + } else if (fil_space_t* space = + fil_space_t::get(page_id.space())) { + bool set = dict_set_corrupted_by_space(space); + space->release(); + if (set) { + return nullptr; + } + } + + ib::fatal() << "Unable to read page " << page_id + << " into the buffer pool after " + << BUF_PAGE_READ_MAX_RETRIES + << ". The most probable cause" + " of this error may be that the" + " table has been corrupted." + " See https://mariadb.com/kb/en/library/innodb-recovery-modes/"; } } else if (mode == BUF_PEEK_IF_IN_POOL) { if (UNIV_UNLIKELY(!block->page.frame)) { diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 28f03eedac9..fdc73128bb7 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -83,12 +83,6 @@ static struct ulint flush_pass; } page_cleaner; -/** If LRU list of a buf_pool is less than this size then LRU eviction -should not happen. This is because when we do LRU flushing we also put -the blocks on free list. If LRU list is very small then we can end up -in thrashing. */ -#define BUF_LRU_MIN_LEN 256 - /* @} */ #ifdef UNIV_DEBUG @@ -1234,9 +1228,11 @@ static void buf_flush_LRU_list_batch(ulint max, flush_counters_t *n) static_assert(FIL_NULL > SRV_SPACE_ID_UPPER_BOUND, "consistency"); for (buf_page_t *bpage= UT_LIST_GET_LAST(buf_pool.LRU); - bpage && n->flushed + n->evicted < max && - UT_LIST_GET_LEN(buf_pool.LRU) > BUF_LRU_MIN_LEN && - UT_LIST_GET_LEN(buf_pool.free) < free_limit; ++scanned) + bpage && + ((UT_LIST_GET_LEN(buf_pool.LRU) > BUF_LRU_MIN_LEN && + UT_LIST_GET_LEN(buf_pool.free) < free_limit && + n->flushed + n->evicted < max) || + recv_recovery_is_on()); ++scanned) { buf_page_t *prev= UT_LIST_GET_PREV(LRU, bpage); const lsn_t oldest_modification= bpage->oldest_modification(); diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index a990a518d5b..bb820374266 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -2,7 +2,7 @@ Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. -Copyright (c) 2013, 2021, MariaDB Corporation. +Copyright (c) 2013, 2022, 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 @@ -4269,8 +4269,6 @@ dict_index_set_merge_threshold( mtr.start(); - dict_sys.lock(SRW_LOCK_CALL); - sys_index = UT_LIST_GET_FIRST(dict_sys.sys_indexes->indexes); /* Find the index row in SYS_INDEXES */ @@ -4306,8 +4304,6 @@ dict_index_set_merge_threshold( mtr_commit(&mtr); mem_heap_free(heap); - - dict_sys.unlock(); } #ifdef UNIV_DEBUG diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc index 1a8d5764d0f..f4a42555f1d 100644 --- a/storage/innobase/dict/dict0mem.cc +++ b/storage/innobase/dict/dict0mem.cc @@ -1197,8 +1197,9 @@ bool dict_foreign_t::affects_fulltext() const return false; } -/** Reconstruct the clustered index fields. */ -inline void dict_index_t::reconstruct_fields() +/** Reconstruct the clustered index fields. +@return whether metadata is incorrect */ +inline bool dict_index_t::reconstruct_fields() { DBUG_ASSERT(is_primary()); @@ -1232,10 +1233,14 @@ inline void dict_index_t::reconstruct_fields() fields + n_first, fields + n_fields, [c](const dict_field_t& o) { return o.col->ind == c.ind(); }); + + if (old >= fields + n_fields + || old->prefix_len + || old->col != &table->cols[c.ind()]) { + return true; + } + ut_ad(old >= &fields[n_first]); - ut_ad(old < &fields[n_fields]); - DBUG_ASSERT(!old->prefix_len); - DBUG_ASSERT(old->col == &table->cols[c.ind()]); f = *old; } @@ -1248,6 +1253,8 @@ inline void dict_index_t::reconstruct_fields() fields = tfields; n_core_null_bytes = static_cast<byte>(UT_BITS_IN_BYTES(n_core_null)); + + return false; } /** Reconstruct dropped or reordered columns. @@ -1312,8 +1319,7 @@ bool dict_table_t::deserialise_columns(const byte* metadata, ulint len) } DBUG_ASSERT(col == &dropped_cols[n_dropped_cols]); - UT_LIST_GET_FIRST(indexes)->reconstruct_fields(); - return false; + return UT_LIST_GET_FIRST(indexes)->reconstruct_fields(); } /** Check if record in clustered index is historical row. diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 0007fde5f43..37ac293c259 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -2059,6 +2059,9 @@ err_exit: } } + DBUG_EXECUTE_IF("checkpoint_after_file_create", + log_make_checkpoint();); + if (fil_space_t* space = fil_space_t::create(space_id, flags, FIL_TYPE_TABLESPACE, crypt_data, mode)) { @@ -2403,6 +2406,7 @@ fil_ibd_discover( switch (srv_operation) { case SRV_OPERATION_BACKUP: case SRV_OPERATION_RESTORE_DELTA: + case SRV_OPERATION_BACKUP_NO_DEFER: ut_ad(0); break; case SRV_OPERATION_RESTORE_EXPORT: diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc index b7af3dab2c4..6f9cdfbedb7 100644 --- a/storage/innobase/fts/fts0fts.cc +++ b/storage/innobase/fts/fts0fts.cc @@ -32,7 +32,7 @@ Full Text Search interface #include "fts0fts.h" #include "fts0priv.h" #include "fts0types.h" -#include "fts0types.ic" +#include "fts0types.inl" #include "fts0vlc.h" #include "fts0plugin.h" #include "dict0stats.h" @@ -223,9 +223,7 @@ ulint fts_add_doc_by_id( /*==============*/ fts_trx_table_t*ftt, /*!< in: FTS trx table */ - doc_id_t doc_id, /*!< in: doc id */ - ib_vector_t* fts_indexes MY_ATTRIBUTE((unused))); - /*!< in: affected fts indexes */ + doc_id_t doc_id); /*!< in: doc id */ /******************************************************************//** Update the last document id. This function could create a new transaction to update the last document id. @@ -2775,7 +2773,7 @@ fts_add( ut_a(row->state == FTS_INSERT || row->state == FTS_MODIFY); - fts_add_doc_by_id(ftt, doc_id, row->fts_indexes); + fts_add_doc_by_id(ftt, doc_id); mysql_mutex_lock(&table->fts->cache->deleted_lock); ++table->fts->cache->added; @@ -3331,9 +3329,7 @@ ulint fts_add_doc_by_id( /*==============*/ fts_trx_table_t*ftt, /*!< in: FTS trx table */ - doc_id_t doc_id, /*!< in: doc id */ - ib_vector_t* fts_indexes MY_ATTRIBUTE((unused))) - /*!< in: affected fts indexes */ + doc_id_t doc_id) /*!< in: doc id */ { mtr_t mtr; mem_heap_t* heap; @@ -4570,7 +4566,7 @@ fts_tokenize_add_word_for_parser( ut_ad(boolean_info->position >= 0); position = boolean_info->position + fts_param->add_pos; */ - position = fts_param->add_pos; + position = fts_param->add_pos++; fts_add_token(result_doc, str, position); diff --git a/storage/innobase/gis/gis0rtree.cc b/storage/innobase/gis/gis0rtree.cc index 8097fbe2011..f389851a4ea 100644 --- a/storage/innobase/gis/gis0rtree.cc +++ b/storage/innobase/gis/gis0rtree.cc @@ -1169,15 +1169,6 @@ after_insert: page_zip = buf_block_get_page_zip(root_block); page_set_ssn_id(root_block, page_zip, next_ssn, mtr); - /* Insert fit on the page: update the free bits for the - left and right pages in the same mtr */ - - if (page_is_leaf(page)) { - ibuf_update_free_bits_for_two_pages_low( - block, new_block, mtr); - } - - /* If the new res insert fail, we need to do another split again. */ if (!rec) { diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 6c4487f20f0..56bea723dc8 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -3671,6 +3671,59 @@ static int innodb_init_abort() DBUG_RETURN(1); } +/** Return the minimum buffer pool size based on page size */ +static inline ulint min_buffer_pool_size() +{ + ulint s= (BUF_LRU_MIN_LEN + BUF_LRU_MIN_LEN / 4) * srv_page_size; + /* buf_pool_chunk_size minimum is 1M, so round up to a multiple */ + ulint alignment= 1U << 20; + return UT_CALC_ALIGN(s, alignment); +} + +/** Validate the requested buffer pool size. Also, reserve the necessary +memory needed for buffer pool resize. +@param[in] thd thread handle +@param[in] var pointer to system variable +@param[out] save immediate result for update function +@param[in] value incoming string +@return 0 on success, 1 on failure. +*/ +static +int +innodb_buffer_pool_size_validate( + THD* thd, + struct st_mysql_sys_var* var, + void* save, + struct st_mysql_value* value); + +/** Update the system variable innodb_buffer_pool_size using the "saved" +value. This function is registered as a callback with MySQL. +@param[in] thd thread handle +@param[in] var pointer to system variable +@param[out] var_ptr where the formal string goes +@param[in] save immediate result from check function */ +static +void +innodb_buffer_pool_size_update( + THD* thd, + struct st_mysql_sys_var* var, + void* var_ptr, + const void* save); + +/* If the default value of innodb_buffer_pool_size is increased to be more than +BUF_POOL_SIZE_THRESHOLD (srv/srv0start.cc), then srv_buf_pool_instances_default +can be removed and 8 used instead. The problem with the current setup is that +with 128MiB default buffer pool size and 8 instances by default we would emit +a warning when no options are specified. */ +static MYSQL_SYSVAR_ULONGLONG(buffer_pool_size, innobase_buffer_pool_size, + PLUGIN_VAR_RQCMDARG, + "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.", + innodb_buffer_pool_size_validate, + innodb_buffer_pool_size_update, + 128ULL << 20, + 2ULL << 20, + LLONG_MAX, 1024*1024L); + /****************************************************************//** Gives the file extension of an InnoDB single-table tablespace. */ static const char* ha_innobase_exts[] = { @@ -3773,12 +3826,15 @@ static int innodb_init_params() /* The buffer pool needs to be able to accommodate enough many pages, even for larger pages */ - if (srv_page_size > UNIV_PAGE_SIZE_DEF - && innobase_buffer_pool_size < (24 * 1024 * 1024)) { + MYSQL_SYSVAR_NAME(buffer_pool_size).min_val= min_buffer_pool_size(); + + if (innobase_buffer_pool_size < MYSQL_SYSVAR_NAME(buffer_pool_size).min_val) { ib::error() << "innodb_page_size=" << srv_page_size << " requires " - << "innodb_buffer_pool_size > 24M current " - << innobase_buffer_pool_size; + << "innodb_buffer_pool_size >= " + << (MYSQL_SYSVAR_NAME(buffer_pool_size).min_val >> 20) + << "MiB current " << (innobase_buffer_pool_size >> 20) + << "MiB"; DBUG_RETURN(HA_ERR_INITIALIZATION); } @@ -11180,9 +11236,12 @@ create_table_info_t::create_options_are_invalid() break; } - if (m_create_info->data_file_name - && m_create_info->data_file_name[0] != '\0' - && !create_option_data_directory_is_valid()) { + if (!m_create_info->data_file_name + || !m_create_info->data_file_name[0]) { + } else if (!my_use_symdir) { + my_error(WARN_OPTION_IGNORED, MYF(ME_WARNING), + "DATA DIRECTORY"); + } else if (!create_option_data_directory_is_valid()) { ret = "DATA DIRECTORY"; } @@ -11454,7 +11513,8 @@ create_table_info_t::parse_table_name( CREATE TABLE ... DATA DIRECTORY={path} TABLESPACE={name}... ; we ignore the DATA DIRECTORY. */ if (m_create_info->data_file_name - && m_create_info->data_file_name[0] != '\0') { + && m_create_info->data_file_name[0] + && my_use_symdir) { if (!create_option_data_directory_is_valid()) { push_warning_printf( m_thd, Sql_condition::WARN_LEVEL_WARN, @@ -11914,8 +11974,9 @@ create_table_info_t::set_tablespace_type( used with TEMPORARY tables. */ m_use_data_dir = m_use_file_per_table - && (m_create_info->data_file_name != NULL) - && (m_create_info->data_file_name[0] != '\0'); + && m_create_info->data_file_name + && m_create_info->data_file_name[0] + && my_use_symdir; } /** Initialize the create_table_info_t object. @@ -19031,31 +19092,6 @@ static MYSQL_SYSVAR_UINT(autoextend_increment, "Data file autoextend increment in megabytes", NULL, NULL, 64, 1, 1000, 0); -/** Validate the requested buffer pool size. Also, reserve the necessary -memory needed for buffer pool resize. -@param[in] thd thread handle -@param[in] var pointer to system variable -@param[out] save immediate result for update function -@param[in] value incoming string -@return 0 on success, 1 on failure. -*/ -static -int -innodb_buffer_pool_size_validate( - THD* thd, - struct st_mysql_sys_var* var, - void* save, - struct st_mysql_value* value); - -static MYSQL_SYSVAR_ULONGLONG(buffer_pool_size, innobase_buffer_pool_size, - PLUGIN_VAR_RQCMDARG, - "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.", - innodb_buffer_pool_size_validate, - innodb_buffer_pool_size_update, - srv_buf_pool_def_size, - srv_buf_pool_min_size, - LLONG_MAX, 1024*1024L); - static MYSQL_SYSVAR_ULONG(buffer_pool_chunk_size, srv_buf_pool_chunk_unit, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, "Size of a single memory chunk" @@ -19580,8 +19616,8 @@ static MYSQL_SYSVAR_BOOL(read_only, srv_read_only_mode, static MYSQL_SYSVAR_BOOL(read_only_compressed, innodb_read_only_compressed, PLUGIN_VAR_OPCMDARG, - "Make ROW_FORMAT=COMPRESSED tables read-only (ON by default)", - NULL, NULL, TRUE); + "Make ROW_FORMAT=COMPRESSED tables read-only", + NULL, NULL, FALSE); static MYSQL_SYSVAR_BOOL(cmp_per_index_enabled, srv_cmp_per_index_enabled, PLUGIN_VAR_OPCMDARG, @@ -20842,8 +20878,19 @@ innodb_buffer_pool_size_validate( struct st_mysql_value* value) { longlong intbuf; + value->val_int(value, &intbuf); + if (static_cast<ulonglong>(intbuf) < MYSQL_SYSVAR_NAME(buffer_pool_size).min_val) { + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_WRONG_ARGUMENTS, + "innodb_buffer_pool_size must be at least" + " %lld for innodb_page_size=%lu", + MYSQL_SYSVAR_NAME(buffer_pool_size).min_val, + srv_page_size); + return(1); + } + if (!srv_was_started) { push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_WRONG_ARGUMENTS, @@ -21212,3 +21259,21 @@ void ins_node_t::vers_update_end(row_prebuilt_t *prebuilt, bool history_row) if (UNIV_LIKELY_NULL(local_heap)) mem_heap_free(local_heap); } + +/** Calculate aligned buffer pool size based on srv_buf_pool_chunk_unit, +if needed. +@param[in] size size in bytes +@return aligned size */ +ulint +buf_pool_size_align( + ulint size) +{ + const ulong m = srv_buf_pool_chunk_unit; + size = ut_max((size_t) size, (size_t) MYSQL_SYSVAR_NAME(buffer_pool_size).min_val); + + if (size % m == 0) { + return(size); + } else { + return (ulint)((size / m + 1) * m); + } +} diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 075239306b0..1965994ac37 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -8815,6 +8815,14 @@ free_and_exit: dict_sys.lock(SRW_LOCK_CALL); + if (ctx->add_vcol) + { + for (ulint i = 0; i < ctx->num_to_add_vcol; i++) + ctx->add_vcol[i].~dict_v_col_t(); + ctx->num_to_add_vcol= 0; + ctx->add_vcol= nullptr; + } + for (ulint i= 0; i < ctx->num_to_add_fk; i++) dict_foreign_free(ctx->add_fk[i]); /* Clear the to_be_dropped flags in the data dictionary cache. diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index 717427c9f38..3aeb54fb8d5 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -318,7 +318,7 @@ static ST_FIELD_INFO innodb_trx_fields_info[]= #define IDX_TRX_ISOLATION_LEVEL 16 Column("trx_isolation_level", - Enum(&isolation_level_values_typelib), NOT_NULL, DEFAULT_NONE), + Enum(&isolation_level_values_typelib), NOT_NULL), #define IDX_TRX_UNIQUE_CHECKS 17 Column("trx_unique_checks", SLong(1), NOT_NULL), @@ -596,10 +596,10 @@ static ST_FIELD_INFO innodb_locks_fields_info[]= Column("lock_trx_id", ULonglong(), NOT_NULL), #define IDX_LOCK_MODE 2 - Column("lock_mode", Enum(&lock_mode_values_typelib), NOT_NULL, DEFAULT_NONE), + Column("lock_mode", Enum(&lock_mode_values_typelib), NOT_NULL), #define IDX_LOCK_TYPE 3 - Column("lock_type", Enum(&lock_type_values_typelib), NOT_NULL, DEFAULT_NONE), + Column("lock_type", Enum(&lock_type_values_typelib), NOT_NULL), #define IDX_LOCK_TABLE 4 Column("lock_table", Varchar(1024), NOT_NULL), @@ -1882,7 +1882,7 @@ static ST_FIELD_INFO innodb_metrics_fields_info[]= Column("ENABLED", SLong(1), NOT_NULL), #define METRIC_TYPE 15 - Column("TYPE", Enum(&metric_type_values_typelib), NOT_NULL, DEFAULT_NONE), + Column("TYPE", Enum(&metric_type_values_typelib), NOT_NULL), #define METRIC_DESC 16 Column("COMMENT", Varchar(NAME_LEN + 1), NOT_NULL), @@ -3874,10 +3874,10 @@ static ST_FIELD_INFO i_s_innodb_buffer_page_fields_info[]= Column("COMPRESSED_SIZE", ULonglong(), NOT_NULL), #define IDX_BUFFER_PAGE_STATE 15 + I_S_AHI - Column("PAGE_STATE", Enum(&page_state_values_typelib), NOT_NULL, DEFAULT_NONE), + Column("PAGE_STATE", Enum(&page_state_values_typelib), NOT_NULL), #define IDX_BUFFER_PAGE_IO_FIX 16 + I_S_AHI - Column("IO_FIX", Enum(&io_values_typelib), NOT_NULL, DEFAULT_NONE), + Column("IO_FIX", Enum(&io_values_typelib), NOT_NULL), #define IDX_BUFFER_PAGE_IS_OLD 17 + I_S_AHI Column("IS_OLD", SLong(1), NOT_NULL), @@ -4391,7 +4391,7 @@ static ST_FIELD_INFO i_s_innodb_buf_page_lru_fields_info[] = Column("COMPRESSED", SLong(1), NOT_NULL), #define IDX_BUF_LRU_PAGE_IO_FIX 16 + I_S_AHI - Column("IO_FIX", Enum(&io_values_typelib), NOT_NULL, DEFAULT_NONE), + Column("IO_FIX", Enum(&io_values_typelib), NOT_NULL), #define IDX_BUF_LRU_PAGE_IS_OLD 17 + I_S_AHI Column("IS_OLD", SLong(1), NULLABLE), diff --git a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h index 95e148bee54..8644acb0831 100644 --- a/storage/innobase/include/btr0btr.h +++ b/storage/innobase/include/btr0btr.h @@ -676,7 +676,7 @@ btr_lift_page_up( #define BTR_N_LEAF_PAGES 1 #define BTR_TOTAL_SIZE 2 -#include "btr0btr.ic" +#include "btr0btr.inl" /**************************************************************** Global variable controlling if scrubbing should be performed */ diff --git a/storage/innobase/include/btr0btr.ic b/storage/innobase/include/btr0btr.inl index f92622cc400..f92622cc400 100644 --- a/storage/innobase/include/btr0btr.ic +++ b/storage/innobase/include/btr0btr.inl diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h index 778b8cd04e8..f5f1c972957 100644 --- a/storage/innobase/include/btr0cur.h +++ b/storage/innobase/include/btr0cur.h @@ -933,6 +933,6 @@ extern ulint btr_cur_n_sea_old; extern uint btr_cur_limit_optimistic_insert_debug; #endif /* UNIV_DEBUG */ -#include "btr0cur.ic" +#include "btr0cur.inl" #endif diff --git a/storage/innobase/include/btr0cur.ic b/storage/innobase/include/btr0cur.inl index 76a2d3be49c..76a2d3be49c 100644 --- a/storage/innobase/include/btr0cur.ic +++ b/storage/innobase/include/btr0cur.inl diff --git a/storage/innobase/include/btr0pcur.h b/storage/innobase/include/btr0pcur.h index 45406bd4b6f..56e482d55cc 100644 --- a/storage/innobase/include/btr0pcur.h +++ b/storage/innobase/include/btr0pcur.h @@ -497,6 +497,6 @@ inline rec_t *btr_pcur_get_rec(const btr_pcur_t *cursor) return cursor->btr_cur.page_cur.rec; } -#include "btr0pcur.ic" +#include "btr0pcur.inl" #endif diff --git a/storage/innobase/include/btr0pcur.ic b/storage/innobase/include/btr0pcur.inl index f5e59c7268e..f5e59c7268e 100644 --- a/storage/innobase/include/btr0pcur.ic +++ b/storage/innobase/include/btr0pcur.inl diff --git a/storage/innobase/include/btr0sea.h b/storage/innobase/include/btr0sea.h index b45183a6428..106582286a9 100644 --- a/storage/innobase/include/btr0sea.h +++ b/storage/innobase/include/btr0sea.h @@ -394,6 +394,6 @@ again set this much timeout. This is to reduce contention. */ #define BTR_SEA_TIMEOUT 10000 #endif /* BTR_CUR_HASH_ADAPT */ -#include "btr0sea.ic" +#include "btr0sea.inl" #endif diff --git a/storage/innobase/include/btr0sea.ic b/storage/innobase/include/btr0sea.inl index 5a8d648029a..5a8d648029a 100644 --- a/storage/innobase/include/btr0sea.ic +++ b/storage/innobase/include/btr0sea.inl diff --git a/storage/innobase/include/buf0buddy.h b/storage/innobase/include/buf0buddy.h index cba31074413..bb9994203d6 100644 --- a/storage/innobase/include/buf0buddy.h +++ b/storage/innobase/include/buf0buddy.h @@ -88,5 +88,4 @@ bool buf_buddy_realloc(void* buf, ulint size); /** Combine all pairs of free buddies. */ void buf_buddy_condense_free(); - #endif /* buf0buddy_h */ diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h index 3fb61639e84..703087d1b7f 100644 --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -68,6 +68,12 @@ struct fil_addr_t; #define BUF_EVICT_IF_IN_POOL 20 /*!< evict a clean block if found */ /* @} */ +/** If LRU list of a buf_pool is less than this size then LRU eviction +should not happen. This is because when we do LRU flushing we also put +the blocks on free list. If LRU list is very small then we can end up +in thrashing. */ +#define BUF_LRU_MIN_LEN 256 + /** This structure defines information we will fetch from each buffer pool. It will be used to print table IO stats */ struct buf_pool_info_t @@ -484,7 +490,6 @@ ATTRIBUTE_COLD void buf_page_monitor(const buf_page_t &bpage, bool read); if needed. @param[in] size size in bytes @return aligned size */ -UNIV_INLINE ulint buf_pool_size_align( ulint size); @@ -2194,7 +2199,7 @@ struct CheckUnzipLRUAndLRUList { }; #endif /* UNIV_DEBUG */ -#include "buf0buf.ic" +#include "buf0buf.inl" #endif /* !UNIV_INNOCHECKSUM */ diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.inl index 5baee629dde..3c4da98f83b 100644 --- a/storage/innobase/include/buf0buf.ic +++ b/storage/innobase/include/buf0buf.inl @@ -142,21 +142,3 @@ buf_block_get_modify_clock( return(block->modify_clock); } -/** Calculate aligned buffer pool size based on srv_buf_pool_chunk_unit, -if needed. -@param[in] size size in bytes -@return aligned size */ -UNIV_INLINE -ulint -buf_pool_size_align( - ulint size) -{ - const ulong m = srv_buf_pool_chunk_unit; - size = ut_max(size, srv_buf_pool_min_size); - - if (size % m == 0) { - return(size); - } else { - return (ulint)((size / m + 1) * m); - } -} diff --git a/storage/innobase/include/data0data.h b/storage/innobase/include/data0data.h index fc774b6ee60..c2b8c3e00b6 100644 --- a/storage/innobase/include/data0data.h +++ b/storage/innobase/include/data0data.h @@ -705,6 +705,6 @@ struct big_rec_t { ulint n_fld); }; -#include "data0data.ic" +#include "data0data.inl" #endif diff --git a/storage/innobase/include/data0data.ic b/storage/innobase/include/data0data.inl index 2d1bf5a2d50..2d1bf5a2d50 100644 --- a/storage/innobase/include/data0data.ic +++ b/storage/innobase/include/data0data.inl diff --git a/storage/innobase/include/data0type.h b/storage/innobase/include/data0type.h index 333210b4779..5c79458e5a9 100644 --- a/storage/innobase/include/data0type.h +++ b/storage/innobase/include/data0type.h @@ -588,6 +588,6 @@ static const byte REC_INFO_METADATA_ADD static const byte REC_INFO_METADATA_ALTER = REC_INFO_METADATA_ADD | REC_INFO_DELETED_FLAG; -#include "data0type.ic" +#include "data0type.inl" #endif diff --git a/storage/innobase/include/data0type.ic b/storage/innobase/include/data0type.inl index 06d90959855..06d90959855 100644 --- a/storage/innobase/include/data0type.ic +++ b/storage/innobase/include/data0type.inl diff --git a/storage/innobase/include/dict0crea.h b/storage/innobase/include/dict0crea.h index 0267f1bae69..cc7ccbfb9d8 100644 --- a/storage/innobase/include/dict0crea.h +++ b/storage/innobase/include/dict0crea.h @@ -272,6 +272,6 @@ dict_get_v_col_pos( #define INDEX_CREATE_INDEX_TREE 3 #define INDEX_ADD_TO_CACHE 4 -#include "dict0crea.ic" +#include "dict0crea.inl" #endif diff --git a/storage/innobase/include/dict0crea.ic b/storage/innobase/include/dict0crea.inl index 5641206d313..5641206d313 100644 --- a/storage/innobase/include/dict0crea.ic +++ b/storage/innobase/include/dict0crea.inl diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index 505fe76b008..7493359e16a 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -1814,6 +1814,6 @@ bool dict_table_have_virtual_index( dict_table_t* table); -#include "dict0dict.ic" +#include "dict0dict.inl" #endif diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.inl index 8af2d93f831..8af2d93f831 100644 --- a/storage/innobase/include/dict0dict.ic +++ b/storage/innobase/include/dict0dict.inl diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index 744ef5316ef..0b690bb865e 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -1307,8 +1307,9 @@ public: ulint get_new_n_vcol() const { return new_vcol_info ? new_vcol_info->n_v_col : 0; } - /** Reconstruct the clustered index fields. */ - inline void reconstruct_fields(); + /** Reconstruct the clustered index fields. + @return whether metadata is incorrect */ + inline bool reconstruct_fields(); /** Check if the index contains a column or a prefix of that column. @param[in] n column number @@ -2556,6 +2557,6 @@ inline void dict_stats_empty_defrag_stats(dict_index_t* index) index->stat_defrag_n_page_split = 0; } -#include "dict0mem.ic" +#include "dict0mem.inl" #endif /* dict0mem_h */ diff --git a/storage/innobase/include/dict0mem.ic b/storage/innobase/include/dict0mem.inl index d60ee5d9bf4..d60ee5d9bf4 100644 --- a/storage/innobase/include/dict0mem.ic +++ b/storage/innobase/include/dict0mem.inl diff --git a/storage/innobase/include/dict0pagecompress.h b/storage/innobase/include/dict0pagecompress.h index dfa6f2a244d..f1272dc447d 100644 --- a/storage/innobase/include/dict0pagecompress.h +++ b/storage/innobase/include/dict0pagecompress.h @@ -56,6 +56,6 @@ dict_table_page_compression_level( const dict_table_t* table) /*!< in: table */ __attribute__((const)); -#include "dict0pagecompress.ic" +#include "dict0pagecompress.inl" #endif diff --git a/storage/innobase/include/dict0pagecompress.ic b/storage/innobase/include/dict0pagecompress.inl index c959f9cada2..c959f9cada2 100644 --- a/storage/innobase/include/dict0pagecompress.ic +++ b/storage/innobase/include/dict0pagecompress.inl diff --git a/storage/innobase/include/dict0stats.h b/storage/innobase/include/dict0stats.h index cdc5ec1bffb..0dc1b984577 100644 --- a/storage/innobase/include/dict0stats.h +++ b/storage/innobase/include/dict0stats.h @@ -229,7 +229,7 @@ dberr_t dict_stats_report_error(dict_table_t* table, bool defragment = false) MY_ATTRIBUTE((nonnull, warn_unused_result)); -#include "dict0stats.ic" +#include "dict0stats.inl" #ifdef UNIV_ENABLE_UNIT_TEST_DICT_STATS void test_dict_stats_all(); diff --git a/storage/innobase/include/dict0stats.ic b/storage/innobase/include/dict0stats.inl index dd516275156..dd516275156 100644 --- a/storage/innobase/include/dict0stats.ic +++ b/storage/innobase/include/dict0stats.inl diff --git a/storage/innobase/include/eval0eval.h b/storage/innobase/include/eval0eval.h index ebd40924a49..a3ea046250b 100644 --- a/storage/innobase/include/eval0eval.h +++ b/storage/innobase/include/eval0eval.h @@ -104,6 +104,6 @@ eval_cmp( func_node_t* cmp_node); /*!< in: comparison node */ -#include "eval0eval.ic" +#include "eval0eval.inl" #endif diff --git a/storage/innobase/include/eval0eval.ic b/storage/innobase/include/eval0eval.inl index 0ea4057fdad..0ea4057fdad 100644 --- a/storage/innobase/include/eval0eval.ic +++ b/storage/innobase/include/eval0eval.inl diff --git a/storage/innobase/include/eval0proc.h b/storage/innobase/include/eval0proc.h index 71700bb5933..a93140bf053 100644 --- a/storage/innobase/include/eval0proc.h +++ b/storage/innobase/include/eval0proc.h @@ -89,6 +89,6 @@ return_step( /*========*/ que_thr_t* thr); /*!< in: query thread */ -#include "eval0proc.ic" +#include "eval0proc.inl" #endif diff --git a/storage/innobase/include/eval0proc.ic b/storage/innobase/include/eval0proc.inl index b0c5f75b94e..b0c5f75b94e 100644 --- a/storage/innobase/include/eval0proc.ic +++ b/storage/innobase/include/eval0proc.inl diff --git a/storage/innobase/include/fil0crypt.h b/storage/innobase/include/fil0crypt.h index cffb26b93ed..d5df0ca126a 100644 --- a/storage/innobase/include/fil0crypt.h +++ b/storage/innobase/include/fil0crypt.h @@ -368,7 +368,7 @@ Return crypt statistics @param[out] stat Crypt statistics */ void fil_crypt_total_stat(fil_crypt_stat_t *stat); -#include "fil0crypt.ic" +#include "fil0crypt.inl" #endif /* !UNIV_INNOCHECKSUM */ /** diff --git a/storage/innobase/include/fil0crypt.ic b/storage/innobase/include/fil0crypt.inl index cc59b394368..cc59b394368 100644 --- a/storage/innobase/include/fil0crypt.ic +++ b/storage/innobase/include/fil0crypt.inl diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index 6cdb954ec29..63f83ff0f96 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2021, MariaDB Corporation. +Copyright (c) 2013, 2022, 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 @@ -572,7 +572,7 @@ public: #if defined __GNUC__ && (defined __i386__ || defined __x86_64__) static_assert(NEEDS_FSYNC == 1U << 29, "compatibility"); __asm__ __volatile__("lock btrl $29, %0" : "+m" (n_pending)); -#elif defined _MSC_VER && (defined _M_IX86 || defined _M_IX64) +#elif defined _MSC_VER && (defined _M_IX86 || defined _M_X64) static_assert(NEEDS_FSYNC == 1U << 29, "compatibility"); _interlockedbittestandreset(reinterpret_cast<volatile long*> (&n_pending), 29); @@ -588,7 +588,7 @@ private: #if defined __GNUC__ && (defined __i386__ || defined __x86_64__) static_assert(CLOSING == 1U << 30, "compatibility"); __asm__ __volatile__("lock btrl $30, %0" : "+m" (n_pending)); -#elif defined _MSC_VER && (defined _M_IX86 || defined _M_IX64) +#elif defined _MSC_VER && (defined _M_IX86 || defined _M_X64) static_assert(CLOSING == 1U << 30, "compatibility"); _interlockedbittestandreset(reinterpret_cast<volatile long*> (&n_pending), 30); @@ -1489,7 +1489,7 @@ inline void fil_space_t::reacquire() inline bool fil_space_t::set_stopping_check() { mysql_mutex_assert_owner(&fil_system.mutex); -#if defined __clang_major__ && __clang_major__ < 10 +#if (defined __clang_major__ && __clang_major__ < 10) || defined __APPLE_CC__ /* Only clang-10 introduced support for asm goto */ return n_pending.fetch_or(STOPPING, std::memory_order_relaxed) & STOPPING; #elif defined __GNUC__ && (defined __i386__ || defined __x86_64__) @@ -1499,7 +1499,7 @@ inline bool fil_space_t::set_stopping_check() return true; not_stopped: return false; -#elif defined _MSC_VER && (defined _M_IX86 || defined _M_IX64) +#elif defined _MSC_VER && (defined _M_IX86 || defined _M_X64) static_assert(STOPPING == 1U << 31, "compatibility"); return _interlockedbittestandset(reinterpret_cast<volatile long*> (&n_pending), 31); @@ -1516,7 +1516,7 @@ inline void fil_space_t::set_stopping() #if defined __GNUC__ && (defined __i386__ || defined __x86_64__) static_assert(STOPPING == 1U << 31, "compatibility"); __asm__ __volatile__("lock btsl $31, %0" : "+m" (n_pending)); -#elif defined _MSC_VER && (defined _M_IX86 || defined _M_IX64) +#elif defined _MSC_VER && (defined _M_IX86 || defined _M_X64) static_assert(STOPPING == 1U << 31, "compatibility"); _interlockedbittestandset(reinterpret_cast<volatile long*>(&n_pending), 31); #else @@ -1828,7 +1828,7 @@ void test_make_filepath(); @return block size */ ulint fil_space_get_block_size(const fil_space_t* space, unsigned offset); -#include "fil0fil.ic" +#include "fil0fil.inl" #endif /* UNIV_INNOCHECKSUM */ #endif /* fil0fil_h */ diff --git a/storage/innobase/include/fil0fil.ic b/storage/innobase/include/fil0fil.inl index 3194e54c5b5..3194e54c5b5 100644 --- a/storage/innobase/include/fil0fil.ic +++ b/storage/innobase/include/fil0fil.inl diff --git a/storage/innobase/include/fts0priv.h b/storage/innobase/include/fts0priv.h index a8647b4dd1d..ae0bb036e37 100644 --- a/storage/innobase/include/fts0priv.h +++ b/storage/innobase/include/fts0priv.h @@ -480,6 +480,6 @@ fts_config_create_index_param_name( const dict_index_t* index) /*!< in: index for config */ MY_ATTRIBUTE((nonnull, malloc, warn_unused_result)); -#include "fts0priv.ic" +#include "fts0priv.inl" #endif /* INNOBASE_FTS0PRIV_H */ diff --git a/storage/innobase/include/fts0priv.ic b/storage/innobase/include/fts0priv.inl index da14cfcb013..da14cfcb013 100644 --- a/storage/innobase/include/fts0priv.ic +++ b/storage/innobase/include/fts0priv.inl diff --git a/storage/innobase/include/fts0types.h b/storage/innobase/include/fts0types.h index 0938514995b..41eacc21b81 100644 --- a/storage/innobase/include/fts0types.h +++ b/storage/innobase/include/fts0types.h @@ -350,6 +350,6 @@ fts_select_index( const byte* str, ulint len); -#include "fts0types.ic" +#include "fts0types.inl" #endif /* INNOBASE_FTS0TYPES_H */ diff --git a/storage/innobase/include/fts0types.ic b/storage/innobase/include/fts0types.inl index facc1e5c40b..facc1e5c40b 100644 --- a/storage/innobase/include/fts0types.ic +++ b/storage/innobase/include/fts0types.inl diff --git a/storage/innobase/include/gis0rtree.h b/storage/innobase/include/gis0rtree.h index 9f42e39bae8..de5a9075059 100644 --- a/storage/innobase/include/gis0rtree.h +++ b/storage/innobase/include/gis0rtree.h @@ -483,5 +483,5 @@ rtr_estimate_n_rows_in_range( const dtuple_t* tuple, page_cur_mode_t mode); -#include "gis0rtree.ic" +#include "gis0rtree.inl" #endif /*!< gis0rtree.h */ diff --git a/storage/innobase/include/gis0rtree.ic b/storage/innobase/include/gis0rtree.inl index 2564df7e0d6..2564df7e0d6 100644 --- a/storage/innobase/include/gis0rtree.ic +++ b/storage/innobase/include/gis0rtree.inl diff --git a/storage/innobase/include/ha0ha.h b/storage/innobase/include/ha0ha.h index 561c322521e..5aaa559b885 100644 --- a/storage/innobase/include/ha0ha.h +++ b/storage/innobase/include/ha0ha.h @@ -54,7 +54,7 @@ struct ha_node_t { const rec_t* data; /*!< pointer to the data */ }; -#include "ha0ha.ic" +#include "ha0ha.inl" #endif /* BTR_CUR_HASH_ADAPT */ #endif diff --git a/storage/innobase/include/ha0ha.ic b/storage/innobase/include/ha0ha.inl index 0b256257214..0b256257214 100644 --- a/storage/innobase/include/ha0ha.ic +++ b/storage/innobase/include/ha0ha.inl diff --git a/storage/innobase/include/ha0storage.h b/storage/innobase/include/ha0storage.h index db23ddc66ed..fdf50a2ee4a 100644 --- a/storage/innobase/include/ha0storage.h +++ b/storage/innobase/include/ha0storage.h @@ -132,6 +132,6 @@ ha_storage_get_size( /*================*/ const ha_storage_t* storage); /*!< in: hash storage */ -#include "ha0storage.ic" +#include "ha0storage.inl" #endif /* ha0storage_h */ diff --git a/storage/innobase/include/ha0storage.ic b/storage/innobase/include/ha0storage.inl index df9679cf997..df9679cf997 100644 --- a/storage/innobase/include/ha0storage.ic +++ b/storage/innobase/include/ha0storage.inl diff --git a/storage/innobase/include/ibuf0ibuf.h b/storage/innobase/include/ibuf0ibuf.h index 3ffa9facdbf..0bc36029d2f 100644 --- a/storage/innobase/include/ibuf0ibuf.h +++ b/storage/innobase/include/ibuf0ibuf.h @@ -402,6 +402,6 @@ for the file segment from which the pages for the ibuf tree are allocated */ /* The insert buffer tree itself is always located in space 0. */ #define IBUF_SPACE_ID static_cast<ulint>(0) -#include "ibuf0ibuf.ic" +#include "ibuf0ibuf.inl" #endif diff --git a/storage/innobase/include/ibuf0ibuf.ic b/storage/innobase/include/ibuf0ibuf.inl index 2c2620511c7..2c2620511c7 100644 --- a/storage/innobase/include/ibuf0ibuf.ic +++ b/storage/innobase/include/ibuf0ibuf.inl diff --git a/storage/innobase/include/lock0lock.h b/storage/innobase/include/lock0lock.h index f2b1dc488d6..b7ff8b61752 100644 --- a/storage/innobase/include/lock0lock.h +++ b/storage/innobase/include/lock0lock.h @@ -1233,6 +1233,6 @@ lock_rtr_move_rec_list( moved */ ulint num_move); /*!< in: num of rec to move */ -#include "lock0lock.ic" +#include "lock0lock.inl" #endif diff --git a/storage/innobase/include/lock0lock.ic b/storage/innobase/include/lock0lock.inl index 7d08cbb930c..7d08cbb930c 100644 --- a/storage/innobase/include/lock0lock.ic +++ b/storage/innobase/include/lock0lock.inl diff --git a/storage/innobase/include/lock0priv.h b/storage/innobase/include/lock0priv.h index b5ec7a0d29e..4e469c6598c 100644 --- a/storage/innobase/include/lock0priv.h +++ b/storage/innobase/include/lock0priv.h @@ -577,6 +577,6 @@ lock_table_has( const dict_table_t* table, /*!< in: table */ enum lock_mode mode); /*!< in: lock mode */ -#include "lock0priv.ic" +#include "lock0priv.inl" #endif /* lock0priv_h */ diff --git a/storage/innobase/include/lock0priv.ic b/storage/innobase/include/lock0priv.inl index 21e7c7c95dc..21e7c7c95dc 100644 --- a/storage/innobase/include/lock0priv.ic +++ b/storage/innobase/include/lock0priv.inl diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h index 76deace8fde..01635671e71 100644 --- a/storage/innobase/include/log0log.h +++ b/storage/innobase/include/log0log.h @@ -736,6 +736,6 @@ inline void log_t::file::set_lsn_offset(lsn_t a_lsn) lsn_offset= a_lsn; } -#include "log0log.ic" +#include "log0log.inl" #endif diff --git a/storage/innobase/include/log0log.ic b/storage/innobase/include/log0log.inl index 73434737925..73434737925 100644 --- a/storage/innobase/include/log0log.ic +++ b/storage/innobase/include/log0log.inl diff --git a/storage/innobase/include/log0recv.h b/storage/innobase/include/log0recv.h index 04b59f33f4e..9b4c2488f55 100644 --- a/storage/innobase/include/log0recv.h +++ b/storage/innobase/include/log0recv.h @@ -82,15 +82,19 @@ void recv_sys_justify_left_parsing_buf(); /** Report an operation to create, delete, or rename a file during backup. @param[in] space_id tablespace identifier -@param[in] create whether the file is being created +@param[in] type file operation redo log type @param[in] name file name (not NUL-terminated) @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)(uint32_t space_id, bool create, +extern void (*log_file_op)(uint32_t space_id, int type, const byte* name, ulint len, const byte* new_name, ulint new_len); +/** Report an operation which does INIT_PAGE for page0 during backup. +@param space_id tablespace identifier */ +extern void (*first_page_init)(uint32_t space_id); + /** Stored redo log record */ struct log_rec_t { diff --git a/storage/innobase/include/mach0data.h b/storage/innobase/include/mach0data.h index 4f4c9a4b596..79cbd7d18a1 100644 --- a/storage/innobase/include/mach0data.h +++ b/storage/innobase/include/mach0data.h @@ -370,6 +370,6 @@ mach_write_ulonglong( #endif /* !UNIV_INNOCHECKSUM */ -#include "mach0data.ic" +#include "mach0data.inl" #endif diff --git a/storage/innobase/include/mach0data.ic b/storage/innobase/include/mach0data.inl index 2f970fd27f0..2f970fd27f0 100644 --- a/storage/innobase/include/mach0data.ic +++ b/storage/innobase/include/mach0data.inl diff --git a/storage/innobase/include/mem0mem.h b/storage/innobase/include/mem0mem.h index b7fd9c098a6..959147a61fc 100644 --- a/storage/innobase/include/mem0mem.h +++ b/storage/innobase/include/mem0mem.h @@ -341,5 +341,5 @@ struct mem_block_info_t { #define MEM_BLOCK_HEADER_SIZE UT_CALC_ALIGN(sizeof(mem_block_info_t),\ UNIV_MEM_ALIGNMENT) -#include "mem0mem.ic" +#include "mem0mem.inl" #endif diff --git a/storage/innobase/include/mem0mem.ic b/storage/innobase/include/mem0mem.inl index 9906daf3eb9..9906daf3eb9 100644 --- a/storage/innobase/include/mem0mem.ic +++ b/storage/innobase/include/mem0mem.inl diff --git a/storage/innobase/include/mtr0mtr.h b/storage/innobase/include/mtr0mtr.h index 0b04c0729eb..ec67b9fabe4 100644 --- a/storage/innobase/include/mtr0mtr.h +++ b/storage/innobase/include/mtr0mtr.h @@ -700,6 +700,6 @@ private: range_set *m_freed_pages= nullptr; }; -#include "mtr0mtr.ic" +#include "mtr0mtr.inl" #endif /* mtr0mtr_h */ diff --git a/storage/innobase/include/mtr0mtr.ic b/storage/innobase/include/mtr0mtr.inl index 02ad88194fb..02ad88194fb 100644 --- a/storage/innobase/include/mtr0mtr.ic +++ b/storage/innobase/include/mtr0mtr.inl diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index ce26a0187a9..66d646cab7c 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -1234,6 +1234,6 @@ inline bool is_absolute_path(const char *path) return false; } -#include "os0file.ic" +#include "os0file.inl" #endif /* os0file_h */ diff --git a/storage/innobase/include/os0file.ic b/storage/innobase/include/os0file.inl index e88f94b8ff3..e88f94b8ff3 100644 --- a/storage/innobase/include/os0file.ic +++ b/storage/innobase/include/os0file.inl diff --git a/storage/innobase/include/page0cur.h b/storage/innobase/include/page0cur.h index c0f3bf6866e..6ce31dea0c1 100644 --- a/storage/innobase/include/page0cur.h +++ b/storage/innobase/include/page0cur.h @@ -345,6 +345,6 @@ struct page_cur_t{ buf_block_t* block; /*!< pointer to the block containing rec */ }; -#include "page0cur.ic" +#include "page0cur.inl" #endif diff --git a/storage/innobase/include/page0cur.ic b/storage/innobase/include/page0cur.inl index 5ee96dd716d..5ee96dd716d 100644 --- a/storage/innobase/include/page0cur.ic +++ b/storage/innobase/include/page0cur.inl diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h index 41e46c2d051..ff96202c1c2 100644 --- a/storage/innobase/include/page0page.h +++ b/storage/innobase/include/page0page.h @@ -1166,6 +1166,6 @@ page_find_rec_max_not_deleted( #endif /* !UNIV_INNOCHECKSUM */ -#include "page0page.ic" +#include "page0page.inl" #endif diff --git a/storage/innobase/include/page0page.ic b/storage/innobase/include/page0page.inl index 861bf4a53df..861bf4a53df 100644 --- a/storage/innobase/include/page0page.ic +++ b/storage/innobase/include/page0page.inl diff --git a/storage/innobase/include/page0zip.h b/storage/innobase/include/page0zip.h index 45b5482fdb2..3a28384138b 100644 --- a/storage/innobase/include/page0zip.h +++ b/storage/innobase/include/page0zip.h @@ -377,7 +377,7 @@ void page_zip_reset_stat_per_index(); /*===========================*/ -#include "page0zip.ic" +#include "page0zip.inl" #endif /* !UNIV_INNOCHECKSUM */ #endif /* page0zip_h */ diff --git a/storage/innobase/include/page0zip.ic b/storage/innobase/include/page0zip.inl index afc877c3720..afc877c3720 100644 --- a/storage/innobase/include/page0zip.ic +++ b/storage/innobase/include/page0zip.inl diff --git a/storage/innobase/include/que0que.h b/storage/innobase/include/que0que.h index f0aed6d22f4..c60f390a092 100644 --- a/storage/innobase/include/que0que.h +++ b/storage/innobase/include/que0que.h @@ -309,6 +309,6 @@ struct que_fork_t{ /* Flag which is ORed to control structure statement node types */ #define QUE_NODE_CONTROL_STAT 1024 -#include "que0que.ic" +#include "que0que.inl" #endif diff --git a/storage/innobase/include/que0que.ic b/storage/innobase/include/que0que.inl index e21cbad3815..e21cbad3815 100644 --- a/storage/innobase/include/que0que.ic +++ b/storage/innobase/include/que0que.inl diff --git a/storage/innobase/include/rem0cmp.h b/storage/innobase/include/rem0cmp.h index 8d770405fcc..6f2201971d1 100644 --- a/storage/innobase/include/rem0cmp.h +++ b/storage/innobase/include/rem0cmp.h @@ -258,6 +258,6 @@ cmp_dfield_dfield_like_prefix( const dfield_t* dfield1, const dfield_t* dfield2); -#include "rem0cmp.ic" +#include "rem0cmp.inl" #endif diff --git a/storage/innobase/include/rem0cmp.ic b/storage/innobase/include/rem0cmp.inl index 6e21382d187..6e21382d187 100644 --- a/storage/innobase/include/rem0cmp.ic +++ b/storage/innobase/include/rem0cmp.inl diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h index dbcff3e6fd6..c2ebad91ecd 100644 --- a/storage/innobase/include/rem0rec.h +++ b/storage/innobase/include/rem0rec.h @@ -1293,7 +1293,7 @@ int wsrep_rec_get_foreign_key( ibool new_protocol); /* in: protocol > 1 */ #endif /* WITH_WSREP */ -#include "rem0rec.ic" +#include "rem0rec.inl" #endif /* !UNIV_INNOCHECKSUM */ #endif /* rem0rec_h */ diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.inl index 30c72a7415a..30c72a7415a 100644 --- a/storage/innobase/include/rem0rec.ic +++ b/storage/innobase/include/rem0rec.inl diff --git a/storage/innobase/include/row0ext.h b/storage/innobase/include/row0ext.h index 251f3125667..78886332aa6 100644 --- a/storage/innobase/include/row0ext.h +++ b/storage/innobase/include/row0ext.h @@ -96,6 +96,6 @@ struct row_ext_t{ ulint len[1]; /*!< prefix lengths; 0 if not cached */ }; -#include "row0ext.ic" +#include "row0ext.inl" #endif diff --git a/storage/innobase/include/row0ext.ic b/storage/innobase/include/row0ext.inl index 913b51b34d2..913b51b34d2 100644 --- a/storage/innobase/include/row0ext.ic +++ b/storage/innobase/include/row0ext.inl diff --git a/storage/innobase/include/row0log.h b/storage/innobase/include/row0log.h index 9fcece5b990..732ef494326 100644 --- a/storage/innobase/include/row0log.h +++ b/storage/innobase/include/row0log.h @@ -263,6 +263,6 @@ row_log_estimate_work( const dict_index_t* index); #endif /* HAVE_PSI_STAGE_INTERFACE */ -#include "row0log.ic" +#include "row0log.inl" #endif /* row0log.h */ diff --git a/storage/innobase/include/row0log.ic b/storage/innobase/include/row0log.inl index f9f3dd006bf..f9f3dd006bf 100644 --- a/storage/innobase/include/row0log.ic +++ b/storage/innobase/include/row0log.inl diff --git a/storage/innobase/include/row0row.h b/storage/innobase/include/row0row.h index b4dab3c2f1b..1e0fdc65238 100644 --- a/storage/innobase/include/row0row.h +++ b/storage/innobase/include/row0row.h @@ -427,6 +427,6 @@ row_mtr_start(mtr_t* mtr, dict_index_t* index, bool pessimistic) log_free_check(); } -#include "row0row.ic" +#include "row0row.inl" #endif diff --git a/storage/innobase/include/row0row.ic b/storage/innobase/include/row0row.inl index e89adb581f4..e89adb581f4 100644 --- a/storage/innobase/include/row0row.ic +++ b/storage/innobase/include/row0row.inl diff --git a/storage/innobase/include/row0sel.h b/storage/innobase/include/row0sel.h index 6010771291f..eb83a4bcad6 100644 --- a/storage/innobase/include/row0sel.h +++ b/storage/innobase/include/row0sel.h @@ -477,6 +477,6 @@ row_sel_field_store_in_mysql_format_func( const byte* data, /*!< in: data to store */ ulint len); /*!< in: length of the data */ -#include "row0sel.ic" +#include "row0sel.inl" #endif diff --git a/storage/innobase/include/row0sel.ic b/storage/innobase/include/row0sel.inl index 7880605ca8f..7880605ca8f 100644 --- a/storage/innobase/include/row0sel.ic +++ b/storage/innobase/include/row0sel.inl diff --git a/storage/innobase/include/row0upd.h b/storage/innobase/include/row0upd.h index 58c60a0a4da..9ee5d77f5e5 100644 --- a/storage/innobase/include/row0upd.h +++ b/storage/innobase/include/row0upd.h @@ -563,6 +563,6 @@ public: changed in the update */ -#include "row0upd.ic" +#include "row0upd.inl" #endif diff --git a/storage/innobase/include/row0upd.ic b/storage/innobase/include/row0upd.inl index 13aacf3f003..13aacf3f003 100644 --- a/storage/innobase/include/row0upd.ic +++ b/storage/innobase/include/row0upd.inl diff --git a/storage/innobase/include/rw_lock.h b/storage/innobase/include/rw_lock.h index 0ae052fabe2..a9099d10670 100644 --- a/storage/innobase/include/rw_lock.h +++ b/storage/innobase/include/rw_lock.h @@ -56,7 +56,7 @@ protected: #if defined __GNUC__ && (defined __i386__ || defined __x86_64__) static_assert(WRITER_WAITING == 1U << 30, "compatibility"); __asm__ __volatile__("lock btsl $30, %0" : "+m" (lock)); -#elif defined _MSC_VER && (defined _M_IX86 || defined _M_IX64) +#elif defined _MSC_VER && (defined _M_IX86 || defined _M_X64) static_assert(WRITER_WAITING == 1U << 30, "compatibility"); _interlockedbittestandset(reinterpret_cast<volatile long*>(&lock), 30); #else diff --git a/storage/innobase/include/srv0mon.h b/storage/innobase/include/srv0mon.h index 32da0e4e2b4..fe6c83c458c 100644 --- a/storage/innobase/include/srv0mon.h +++ b/storage/innobase/include/srv0mon.h @@ -863,6 +863,6 @@ void srv_mon_default_on(void); /*====================*/ -#include "srv0mon.ic" +#include "srv0mon.inl" #endif diff --git a/storage/innobase/include/srv0mon.ic b/storage/innobase/include/srv0mon.inl index 158345b2f8c..158345b2f8c 100644 --- a/storage/innobase/include/srv0mon.ic +++ b/storage/innobase/include/srv0mon.inl diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index c936947db1c..a3ef106b847 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -309,11 +309,8 @@ void innodb_wait_allow_writes(); /** Requested size in bytes */ extern ulint srv_buf_pool_size; -/** Minimum pool size in bytes */ -extern const ulint srv_buf_pool_min_size; -/** Default pool size in bytes */ -extern const ulint srv_buf_pool_def_size; -/** Requested buffer pool chunk size */ +/** Requested buffer pool chunk size. Each buffer pool instance consists +of one or more chunks. */ extern ulong srv_buf_pool_chunk_unit; /** Scan depth for LRU flush batch i.e.: number of blocks scanned*/ extern ulong srv_LRU_scan_depth; @@ -419,7 +416,10 @@ enum srv_operation_mode { /** Mariabackup restoring the incremental part of a backup */ SRV_OPERATION_RESTORE_DELTA, /** Mariabackup restoring a backup for subsequent --export */ - SRV_OPERATION_RESTORE_EXPORT + SRV_OPERATION_RESTORE_EXPORT, + /** Mariabackup taking a backup and avoid deferring + any tablespace */ + SRV_OPERATION_BACKUP_NO_DEFER }; /** Current mode of operation */ diff --git a/storage/innobase/include/srw_lock.h b/storage/innobase/include/srw_lock.h index e8ed346d3ac..1705c63b8ad 100644 --- a/storage/innobase/include/srw_lock.h +++ b/storage/innobase/include/srw_lock.h @@ -224,7 +224,7 @@ public: void wr_lock() { writer.wr_lock(); -#if defined __i386__||defined __x86_64__||defined _M_IX86||defined _M_IX64 +#if defined __i386__||defined __x86_64__||defined _M_IX86||defined _M_X64 /* On IA-32 and AMD64, this type of fetch_or() can only be implemented as a loop around LOCK CMPXCHG. In this particular case, setting the most significant bit using fetch_add() is equivalent, and is diff --git a/storage/innobase/include/trx0rec.h b/storage/innobase/include/trx0rec.h index 5c7e468b936..86f305fe04b 100644 --- a/storage/innobase/include/trx0rec.h +++ b/storage/innobase/include/trx0rec.h @@ -336,6 +336,6 @@ inline table_id_t trx_undo_rec_get_table_id(const trx_undo_rec_t *rec) return mach_read_next_much_compressed(&rec); } -#include "trx0rec.ic" +#include "trx0rec.inl" #endif /* trx0rec_h */ diff --git a/storage/innobase/include/trx0rec.ic b/storage/innobase/include/trx0rec.inl index 02244d68b6f..02244d68b6f 100644 --- a/storage/innobase/include/trx0rec.ic +++ b/storage/innobase/include/trx0rec.inl diff --git a/storage/innobase/include/trx0rseg.h b/storage/innobase/include/trx0rseg.h index a9bcb0c3d51..a52d9779a51 100644 --- a/storage/innobase/include/trx0rseg.h +++ b/storage/innobase/include/trx0rseg.h @@ -104,7 +104,7 @@ private: __asm__ __volatile__("lock btsl $1, %0" : "+m" (ref)); else __asm__ __volatile__("lock btsl $0, %0" : "+m" (ref)); -#elif defined _MSC_VER && (defined _M_IX86 || defined _M_IX64) +#elif defined _MSC_VER && (defined _M_IX86 || defined _M_X64) _interlockedbittestandset(reinterpret_cast<volatile long*>(&ref), needs_purge); #else @@ -121,7 +121,7 @@ private: __asm__ __volatile__("lock btrl $1, %0" : "+m" (ref)); else __asm__ __volatile__("lock btrl $0, %0" : "+m" (ref)); -#elif defined _MSC_VER && (defined _M_IX86 || defined _M_IX64) +#elif defined _MSC_VER && (defined _M_IX86 || defined _M_X64) _interlockedbittestandreset(reinterpret_cast<volatile long*>(&ref), needs_purge); #else @@ -334,4 +334,4 @@ up to which replication has proceeded. void trx_rseg_update_binlog_offset(buf_block_t *rseg_header, const trx_t *trx, mtr_t *mtr); -#include "trx0rseg.ic" +#include "trx0rseg.inl" diff --git a/storage/innobase/include/trx0rseg.ic b/storage/innobase/include/trx0rseg.inl index af63d6acbf2..af63d6acbf2 100644 --- a/storage/innobase/include/trx0rseg.ic +++ b/storage/innobase/include/trx0rseg.inl diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index 33ed9aeb25c..24bafa61337 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -1207,6 +1207,6 @@ struct commit_node_t{ }; -#include "trx0trx.ic" +#include "trx0trx.inl" #endif diff --git a/storage/innobase/include/trx0trx.ic b/storage/innobase/include/trx0trx.inl index b063c920e2f..b063c920e2f 100644 --- a/storage/innobase/include/trx0trx.ic +++ b/storage/innobase/include/trx0trx.inl diff --git a/storage/innobase/include/trx0undo.h b/storage/innobase/include/trx0undo.h index 4d6caa89811..62662ffe221 100644 --- a/storage/innobase/include/trx0undo.h +++ b/storage/innobase/include/trx0undo.h @@ -457,7 +457,7 @@ which purge would not result in removing delete-marked records. */ with the XA XID */ /* @} */ -#include "trx0undo.ic" +#include "trx0undo.inl" #endif /* !UNIV_INNOCHECKSUM */ #endif diff --git a/storage/innobase/include/trx0undo.ic b/storage/innobase/include/trx0undo.inl index 1a9c7774580..1a9c7774580 100644 --- a/storage/innobase/include/trx0undo.ic +++ b/storage/innobase/include/trx0undo.inl diff --git a/storage/innobase/include/ut0byte.h b/storage/innobase/include/ut0byte.h index 1a428d73d23..7ed64c61c4b 100644 --- a/storage/innobase/include/ut0byte.h +++ b/storage/innobase/include/ut0byte.h @@ -112,6 +112,6 @@ ut_bit_set_nth( ulint n, /*!< in: nth bit requested */ ibool val); /*!< in: value for the bit to set */ -#include "ut0byte.ic" +#include "ut0byte.inl" #endif diff --git a/storage/innobase/include/ut0byte.ic b/storage/innobase/include/ut0byte.inl index a4b5d4a7d8f..a4b5d4a7d8f 100644 --- a/storage/innobase/include/ut0byte.ic +++ b/storage/innobase/include/ut0byte.inl diff --git a/storage/innobase/include/ut0list.h b/storage/innobase/include/ut0list.h index 7e27e10884b..765f6a2a339 100644 --- a/storage/innobase/include/ut0list.h +++ b/storage/innobase/include/ut0list.h @@ -141,6 +141,6 @@ struct ib_list_helper_t { void* data; /*!< user data */ }; -#include "ut0list.ic" +#include "ut0list.inl" #endif diff --git a/storage/innobase/include/ut0list.ic b/storage/innobase/include/ut0list.inl index 3bdba52bfaa..3bdba52bfaa 100644 --- a/storage/innobase/include/ut0list.ic +++ b/storage/innobase/include/ut0list.inl diff --git a/storage/innobase/include/ut0mem.h b/storage/innobase/include/ut0mem.h index 2fc864d49a2..a5ed72f9f02 100644 --- a/storage/innobase/include/ut0mem.h +++ b/storage/innobase/include/ut0mem.h @@ -71,6 +71,6 @@ ut_str_sql_format( ulint buf_size); /*!< in: output buffer size in bytes */ -#include "ut0mem.ic" +#include "ut0mem.inl" #endif diff --git a/storage/innobase/include/ut0mem.ic b/storage/innobase/include/ut0mem.inl index cc95a03642e..cc95a03642e 100644 --- a/storage/innobase/include/ut0mem.ic +++ b/storage/innobase/include/ut0mem.inl diff --git a/storage/innobase/include/ut0rnd.h b/storage/innobase/include/ut0rnd.h index bcf47fa9c41..511eb21fd11 100644 --- a/storage/innobase/include/ut0rnd.h +++ b/storage/innobase/include/ut0rnd.h @@ -123,6 +123,6 @@ ut_fold_binary( ulint len) /*!< in: length */ MY_ATTRIBUTE((pure)); -#include "ut0rnd.ic" +#include "ut0rnd.inl" #endif diff --git a/storage/innobase/include/ut0rnd.ic b/storage/innobase/include/ut0rnd.inl index 37da323f8f3..37da323f8f3 100644 --- a/storage/innobase/include/ut0rnd.ic +++ b/storage/innobase/include/ut0rnd.inl diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h index 69abd932375..89ff0ca709f 100644 --- a/storage/innobase/include/ut0ut.h +++ b/storage/innobase/include/ut0ut.h @@ -428,7 +428,7 @@ private: } // namespace ib -#include "ut0ut.ic" +#include "ut0ut.inl" #endif diff --git a/storage/innobase/include/ut0ut.ic b/storage/innobase/include/ut0ut.inl index 73feaf82c6a..73feaf82c6a 100644 --- a/storage/innobase/include/ut0ut.ic +++ b/storage/innobase/include/ut0ut.inl diff --git a/storage/innobase/include/ut0vec.h b/storage/innobase/include/ut0vec.h index cfdaee607be..f4660f9646c 100644 --- a/storage/innobase/include/ut0vec.h +++ b/storage/innobase/include/ut0vec.h @@ -280,6 +280,6 @@ struct ib_vector_t { ulint sizeof_value; }; -#include "ut0vec.ic" +#include "ut0vec.inl" #endif /* IB_VECTOR_H */ diff --git a/storage/innobase/include/ut0vec.ic b/storage/innobase/include/ut0vec.inl index 531f0f22ae0..531f0f22ae0 100644 --- a/storage/innobase/include/ut0vec.ic +++ b/storage/innobase/include/ut0vec.inl diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 5a7a6076322..8af6ab6521d 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -941,15 +941,17 @@ fail: /** Report an operation to create, delete, or rename a file during backup. @param[in] space_id tablespace identifier -@param[in] create whether the file is being created +@param[in] type redo log type @param[in] name file name (not NUL-terminated) @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)(uint32_t space_id, bool create, +void (*log_file_op)(uint32_t space_id, int type, const byte* name, ulint len, const byte* new_name, ulint new_len); +void (*first_page_init)(uint32_t space_id); + /** Information about initializing page contents during redo log processing. FIXME: Rely on recv_sys.pages! */ class mlog_init_t @@ -1153,7 +1155,8 @@ void 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) { + if (srv_operation == SRV_OPERATION_BACKUP + || srv_operation == SRV_OPERATION_BACKUP_NO_DEFER) { return; } @@ -2115,6 +2118,8 @@ static void store_freed_or_init_rec(page_id_t page_id, bool freed) { uint32_t space_id= page_id.space(); uint32_t page_no= page_id.page_no(); + if (!freed && page_no == 0 && first_page_init) + first_page_init(space_id); if (is_predefined_tablespace(space_id)) { if (!srv_immediate_scrub_data_uncompressed) @@ -2595,8 +2600,8 @@ same_page: if (fn2) fil_name_process(const_cast<char*>(fn2), fn2end - fn2, space_id, false, start_lsn, store); - if ((b & 0xf0) < FILE_MODIFY && log_file_op) - log_file_op(space_id, (b & 0xf0) == FILE_CREATE, + if ((b & 0xf0) < FILE_CHECKPOINT && log_file_op) + log_file_op(space_id, b & 0xf0, l, static_cast<ulint>(fnend - fn), reinterpret_cast<const byte*>(fn2), fn2 ? static_cast<ulint>(fn2end - fn2) : 0); @@ -2936,35 +2941,33 @@ func_exit: ut_ad(mtr.has_committed()); } -/** Reads in pages which have hashed log records, from an area around a given -page number. -@param[in] page_id page id */ +/** Read pages for which log needs to be applied. +@param page_id first page identifier to read +@param i iterator to recv_sys.pages */ TRANSACTIONAL_TARGET -static void recv_read_in_area(page_id_t page_id) +static void recv_read_in_area(page_id_t page_id, recv_sys_t::map::iterator i) { - uint32_t page_nos[32]; - page_id.set_page_no(ut_2pow_round(page_id.page_no(), 32U)); - const uint32_t up_limit = page_id.page_no() + 32; - uint32_t* p = page_nos; - - for (recv_sys_t::map::iterator i= recv_sys.pages.lower_bound(page_id); - i != recv_sys.pages.end() - && i->first.space() == page_id.space() - && i->first.page_no() < up_limit; i++) { - if (i->second.state == page_recv_t::RECV_NOT_PROCESSED - && !buf_pool.page_hash_contains( - i->first, - buf_pool.page_hash.cell_get(i->first.fold()))) { - i->second.state = page_recv_t::RECV_BEING_READ; - *p++ = i->first.page_no(); - } - } + uint32_t page_nos[32]; + ut_ad(page_id == i->first); + page_id.set_page_no(ut_2pow_round(page_id.page_no(), 32U)); + const page_id_t up_limit{page_id + 31}; + uint32_t* p= page_nos; - if (p != page_nos) { - mysql_mutex_unlock(&recv_sys.mutex); - buf_read_recv_pages(page_id.space(), {page_nos, p}); - mysql_mutex_lock(&recv_sys.mutex); - } + for (; i != recv_sys.pages.end() && i->first <= up_limit; i++) + { + if (i->second.state == page_recv_t::RECV_NOT_PROCESSED) + { + i->second.state= page_recv_t::RECV_BEING_READ; + *p++= i->first.page_no(); + } + } + + if (p != page_nos) + { + mysql_mutex_unlock(&recv_sys.mutex); + buf_read_recv_pages(page_id.space(), {page_nos, p}); + mysql_mutex_lock(&recv_sys.mutex); + } } /** Attempt to initialize a page based on redo log records. @@ -3169,8 +3172,7 @@ void recv_sys_t::apply(bool last_batch) for (map::iterator p= pages.begin(); p != pages.end(); ) { const page_id_t page_id= p->first; - page_recv_t &recs= p->second; - ut_ad(!recs.log.empty()); + ut_ad(!p->second.log.empty()); const uint32_t space_id= page_id.space(); auto d= deferred_spaces.defers.find(space_id); @@ -3202,7 +3204,7 @@ erase_for_space: continue; } - switch (recs.state) { + switch (p->second.state) { case page_recv_t::RECV_BEING_READ: case page_recv_t::RECV_BEING_PROCESSED: p++; @@ -3214,33 +3216,17 @@ next_free_block: mysql_mutex_unlock(&mutex); free_block= buf_LRU_get_free_block(false); mysql_mutex_lock(&mutex); -next_page: - p= pages.lower_bound(page_id); - } - continue; - case page_recv_t::RECV_NOT_PROCESSED: - mtr.start(); - mtr.set_log_mode(MTR_LOG_NO_REDO); - if (buf_block_t *block= buf_page_get_low(page_id, 0, RW_X_LATCH, - nullptr, BUF_GET_IF_IN_POOL, - &mtr, nullptr, false)) - { - recv_recover_page(block, mtr, p); - ut_ad(mtr.has_committed()); - } - else - { - mtr.commit(); - recv_read_in_area(page_id); break; } - map::iterator r= p++; - r->second.log.clear(); - pages.erase(r); + ut_ad(p == pages.end() || p->first > page_id); continue; + case page_recv_t::RECV_NOT_PROCESSED: + recv_read_in_area(page_id, p); } - - goto next_page; + p= pages.lower_bound(page_id); + /* Ensure that progress will be made. */ + ut_ad(p == pages.end() || p->first > page_id || + p->second.state >= page_recv_t::RECV_BEING_READ); } buf_pool.free_block(free_block); diff --git a/storage/innobase/rem/rem0cmp.cc b/storage/innobase/rem/rem0cmp.cc index 70c0255d46a..6c42aaa0f38 100644 --- a/storage/innobase/rem/rem0cmp.cc +++ b/storage/innobase/rem/rem0cmp.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2020, MariaDB Corporation. +Copyright (c) 2020, 2022, 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 @@ -49,48 +49,25 @@ At the present, the comparison functions return 0 in the case, where two records disagree only in the way that one has more fields than the other. */ -/** Compare two data fields. -@param[in] prtype precise type -@param[in] a data field -@param[in] a_length length of a, in bytes (not UNIV_SQL_NULL) -@param[in] b data field -@param[in] b_length length of b, in bytes (not UNIV_SQL_NULL) -@return positive, 0, negative, if a is greater, equal, less than b, -respectively */ -UNIV_INLINE -int -innobase_mysql_cmp( - ulint prtype, - const byte* a, - ulint a_length, - const byte* b, - ulint b_length) +#ifndef DBUG_OFF +/** @return whether a data type is compatible with strnncoll() functions */ +static bool is_strnncoll_compatible(ulint type) { -#ifdef UNIV_DEBUG - switch (prtype & DATA_MYSQL_TYPE_MASK) { - case MYSQL_TYPE_BIT: - case MYSQL_TYPE_STRING: - case MYSQL_TYPE_VAR_STRING: - case MYSQL_TYPE_TINY_BLOB: - case MYSQL_TYPE_MEDIUM_BLOB: - case MYSQL_TYPE_BLOB: - case MYSQL_TYPE_LONG_BLOB: - case MYSQL_TYPE_VARCHAR: - break; - default: - ut_error; - } -#endif /* UNIV_DEBUG */ - - uint cs_num = (uint) dtype_get_charset_coll(prtype); - - if (CHARSET_INFO* cs = get_charset(cs_num, MYF(MY_WME))) { - return(cs->strnncollsp(a, a_length, b, b_length)); - } - - ib::fatal() << "Unable to find charset-collation " << cs_num; - return(0); + switch (type) { + case MYSQL_TYPE_BIT: + case MYSQL_TYPE_STRING: + case MYSQL_TYPE_VAR_STRING: + case MYSQL_TYPE_TINY_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_BLOB: + case MYSQL_TYPE_LONG_BLOB: + case MYSQL_TYPE_VARCHAR: + return true; + default: + return false; + } } +#endif /* DBUG_OFF */ /*************************************************************//** Returns TRUE if two columns are equal for comparison purposes. @@ -213,146 +190,123 @@ cmp_decimal(const byte* a, ulint a_length, const byte* b, ulint b_length) } /** Compare two data fields. -@param[in] mtype main type -@param[in] prtype precise type -@param[in] data1 data field -@param[in] len1 length of data1 in bytes, or UNIV_SQL_NULL -@param[in] data2 data field -@param[in] len2 length of data2 in bytes, or UNIV_SQL_NULL +@param mtype main type +@param prtype precise type +@param data1 data field +@param len1 length of data1 in bytes, or UNIV_SQL_NULL +@param data2 data field +@param len2 length of data2 in bytes, or UNIV_SQL_NULL @return the comparison result of data1 and data2 @retval 0 if data1 is equal to data2 @retval negative if data1 is less than data2 @retval positive if data1 is greater than data2 */ -inline -int -cmp_data( - ulint mtype, - ulint prtype, - const byte* data1, - ulint len1, - const byte* data2, - ulint len2) +static int cmp_data(ulint mtype, ulint prtype, const byte *data1, ulint len1, + const byte *data2, ulint len2) { - ut_ad(len1 != UNIV_SQL_DEFAULT); - ut_ad(len2 != UNIV_SQL_DEFAULT); - - if (len1 == UNIV_SQL_NULL || len2 == UNIV_SQL_NULL) { - if (len1 == len2) { - return(0); - } - - /* We define the SQL null to be the smallest possible - value of a field. */ - return(len1 == UNIV_SQL_NULL ? -1 : 1); - } - - ulint pad; - - switch (mtype) { - default: - ib::fatal() << "Unknown data type number " << mtype; - case DATA_FIXBINARY: - case DATA_BINARY: - if (dtype_get_charset_coll(prtype) - != DATA_MYSQL_BINARY_CHARSET_COLL) { - pad = 0x20; - break; - } - /* fall through */ - case DATA_INT: - case DATA_SYS_CHILD: - case DATA_SYS: - pad = ULINT_UNDEFINED; - break; - case DATA_GEOMETRY: - ut_ad(prtype & DATA_BINARY_TYPE); - if (prtype & DATA_GIS_MBR) { - ut_ad(len1 == DATA_MBR_LEN); - ut_ad(len2 == DATA_MBR_LEN); - return cmp_geometry_field(data1, data2); - } - pad = ULINT_UNDEFINED; - break; - case DATA_BLOB: - if (prtype & DATA_BINARY_TYPE) { - pad = ULINT_UNDEFINED; - break; - } - if (prtype & DATA_BINARY_TYPE) { - ib::error() << "Comparing a binary BLOB" - " using a character set collation!"; - ut_ad(0); - } - /* fall through */ - case DATA_VARMYSQL: - case DATA_MYSQL: - return innobase_mysql_cmp(prtype, data1, len1, data2, len2); - case DATA_VARCHAR: - case DATA_CHAR: - return my_charset_latin1.strnncollsp(data1, len1, data2, len2); - case DATA_DECIMAL: - return cmp_decimal(data1, len1, data2, len2); - case DATA_DOUBLE: - { - double d_1 = mach_double_read(data1); - double d_2 = mach_double_read(data2); - - if (d_1 > d_2) { - return 1; - } else if (d_2 > d_1) { - return -1; - } - } - return 0; - - case DATA_FLOAT: - float f_1 = mach_float_read(data1); - float f_2 = mach_float_read(data2); - - if (f_1 > f_2) { - return 1; - } else if (f_2 > f_1) { - return -1; - } - - return 0; - } - - ulint len = std::min(len1, len2); - int cmp = len ? memcmp(data1, data2, len) : 0; - - if (cmp) { - return (cmp); - } - - data1 += len; - data2 += len; - len1 -= len; - len2 -= len; - - cmp = (int) (len1 - len2); - - if (!cmp || pad == ULINT_UNDEFINED) { - return(cmp); - } - - len = 0; - - if (len1) { - do { - cmp = static_cast<int>( - mach_read_from_1(&data1[len++]) - pad); - } while (cmp == 0 && len < len1); - } else { - ut_ad(len2 > 0); - - do { - cmp = static_cast<int>( - pad - mach_read_from_1(&data2[len++])); - } while (cmp == 0 && len < len2); - } - - return(cmp); + ut_ad(len1 != UNIV_SQL_DEFAULT); + ut_ad(len2 != UNIV_SQL_DEFAULT); + + if (len1 == UNIV_SQL_NULL || len2 == UNIV_SQL_NULL) + { + if (len1 == len2) + return 0; + + /* We define the SQL null to be the smallest possible value of a field. */ + return len1 == UNIV_SQL_NULL ? -1 : 1; + } + + switch (mtype) { + default: + ib::fatal() << "Unknown data type number " << mtype; + case DATA_DECIMAL: + return cmp_decimal(data1, len1, data2, len2); + case DATA_DOUBLE: + { + const double af= mach_double_read(data1), bf= mach_double_read(data2); + return af > bf ? 1 : bf > af ? -1 : 0; + } + case DATA_FLOAT: + { + const float af= mach_float_read(data1), bf= mach_float_read(data2); + return af > bf ? 1 : bf > af ? -1 : 0; + } + case DATA_FIXBINARY: + case DATA_BINARY: + if (dtype_get_charset_coll(prtype) != DATA_MYSQL_BINARY_CHARSET_COLL) + { + if (ulint len= std::min(len1, len2)) + { + if (int cmp= memcmp(data1, data2, len)) + return cmp; + data1+= len; + data2+= len; + len1-= len; + len2-= len; + } + + int cmp= 0; + if (len1) + { + const byte *end= &data1[len1]; + do + cmp= static_cast<int>(*data1++ - byte{0x20}); + while (cmp == 0 && data1 < end); + } + else if (len2) + { + const byte *end= &data2[len2]; + do + cmp= static_cast<int>(byte{0x20} - *data2++); + while (cmp == 0 && data2 < end); + } + return cmp; + } + /* fall through */ + case DATA_INT: + case DATA_SYS_CHILD: + case DATA_SYS: + break; + case DATA_GEOMETRY: + ut_ad(prtype & DATA_BINARY_TYPE); + if (prtype & DATA_GIS_MBR) + { + ut_ad(len1 == DATA_MBR_LEN); + ut_ad(len2 == DATA_MBR_LEN); + return cmp_geometry_field(data1, data2); + } + break; + case DATA_BLOB: + if (prtype & DATA_BINARY_TYPE) + break; + /* fall through */ + case DATA_VARMYSQL: + DBUG_ASSERT(is_strnncoll_compatible(prtype & DATA_MYSQL_TYPE_MASK)); + if (CHARSET_INFO *cs= get_charset(dtype_get_charset_coll(prtype), + MYF(MY_WME))) + return cs->coll->strnncollsp(cs, data1, len1, data2, len2); + no_collation: + ib::fatal() << "Unable to find charset-collation for " << prtype; + case DATA_MYSQL: + DBUG_ASSERT(is_strnncoll_compatible(prtype & DATA_MYSQL_TYPE_MASK)); + if (CHARSET_INFO *cs= get_charset(dtype_get_charset_coll(prtype), + MYF(MY_WME))) + return cs->coll->strnncollsp_nchars(cs, data1, len1, data2, len2, + std::max(len1, len2)); + goto no_collation; + case DATA_VARCHAR: + case DATA_CHAR: + /* latin1_swedish_ci is treated as a special case in InnoDB. + Because it is a fixed-length encoding (mbminlen=mbmaxlen=1), + non-NULL CHAR(n) values will always occupy n bytes and we + can invoke strnncollsp() instead of strnncollsp_nchars(). */ + return my_charset_latin1.strnncollsp(data1, len1, data2, len2); + } + + if (ulint len= std::min(len1, len2)) + if (int cmp= memcmp(data1, data2, len)) + return cmp; + + return len1 > len2 ? 1 : len2 > len1 ? -1 : 0; } /** Compare two data fields. diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc index 0382b4abf4a..303f6265842 100644 --- a/storage/innobase/row/row0import.cc +++ b/storage/innobase/row/row0import.cc @@ -1351,15 +1351,7 @@ row_import::match_schema( { /* Do some simple checks. */ - if (m_table->n_cols != m_n_cols) { - ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH, - "Number of columns don't match, table has %u " - "columns but the tablespace meta-data file has " - ULINTPF " columns", - m_table->n_cols, m_n_cols); - - return(DB_ERROR); - } else if (UT_LIST_GET_LEN(m_table->indexes) != m_n_indexes) { + if (UT_LIST_GET_LEN(m_table->indexes) != m_n_indexes) { /* If the number of indexes don't match then it is better to abort the IMPORT. It is easy for the user to create a @@ -3239,7 +3231,10 @@ static dberr_t handle_instant_metadata(dict_table_t *table, } mem_heap_t *heap= NULL; - SCOPE_EXIT([&heap]() { mem_heap_free(heap); }); + SCOPE_EXIT([&heap]() { + if (heap) + mem_heap_free(heap); + }); while (btr_page_get_level(page.get()) != 0) { diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 595bc4237f0..fd30c70c313 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -188,10 +188,8 @@ with mysql_mutex_lock(), which will wait until it gets the mutex. */ /** copy of innodb_buffer_pool_size */ ulint srv_buf_pool_size; -const ulint srv_buf_pool_min_size = 5 * 1024 * 1024; -/** Default pool size in bytes */ -const ulint srv_buf_pool_def_size = 128 * 1024 * 1024; -/** Requested buffer pool chunk size */ +/** Requested buffer pool chunk size. Each buffer pool instance consists +of one or more chunks. */ ulong srv_buf_pool_chunk_unit; /** innodb_lru_scan_depth; number of blocks scanned in LRU flush batch */ ulong srv_LRU_scan_depth; diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index c3059b2a54e..ff7fc3e28db 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -1473,6 +1473,7 @@ file_checked: break; case SRV_OPERATION_RESTORE_DELTA: case SRV_OPERATION_BACKUP: + case SRV_OPERATION_BACKUP_NO_DEFER: ut_ad("wrong mariabackup mode" == 0); } @@ -1946,6 +1947,7 @@ void innodb_shutdown() switch (srv_operation) { case SRV_OPERATION_BACKUP: case SRV_OPERATION_RESTORE_DELTA: + case SRV_OPERATION_BACKUP_NO_DEFER: break; case SRV_OPERATION_RESTORE: case SRV_OPERATION_RESTORE_EXPORT: diff --git a/storage/innobase/sync/srw_lock.cc b/storage/innobase/sync/srw_lock.cc index b54191d91b0..71414e8ddb2 100644 --- a/storage/innobase/sync/srw_lock.cc +++ b/storage/innobase/sync/srw_lock.cc @@ -385,7 +385,7 @@ assembler code or a Microsoft intrinsic function. # define IF_NOT_FETCH_OR_GOTO(mem, bit, label) \ __asm__ goto("lock btsl $" #bit ", %0\n\t" \ "jnc %l1" : : "m" (mem) : "cc", "memory" : label); -#elif defined _MSC_VER && (defined _M_IX86 || defined _M_IX64) +#elif defined _MSC_VER && (defined _M_IX86 || defined _M_X64) # define IF_FETCH_OR_GOTO(mem, bit, label) \ if (_interlockedbittestandset(reinterpret_cast<volatile long*>(&mem), bit)) \ goto label; diff --git a/storage/maria/ma_ft_boolean_search.c b/storage/maria/ma_ft_boolean_search.c index 596c50ee497..91e39716a2b 100644 --- a/storage/maria/ma_ft_boolean_search.c +++ b/storage/maria/ma_ft_boolean_search.c @@ -195,11 +195,7 @@ static int ftb_query_add_word(MYSQL_FTPARSER_PARAM *param, switch (info->type) { case FT_TOKEN_WORD: ftbw= (FTB_WORD *)alloc_root(&ftb_param->ftb->mem_root, - sizeof(FTB_WORD) + - (info->trunc ? MARIA_MAX_KEY_BUFF : - word_len * ftb_param->ftb->charset->mbmaxlen + - HA_FT_WLEN + - ftb_param->ftb->info->s->rec_reflength)); + sizeof(FTB_WORD) + HA_MAX_KEY_BUFF); ftbw->len= word_len + 1; ftbw->flags= 0; ftbw->off= 0; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/i_s.result b/storage/mroonga/mysql-test/mroonga/storage/r/i_s.result index 5fbbe0fa780..268fde0e2d4 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/i_s.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/i_s.result @@ -1,7 +1,7 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.MROONGA_STATS; Table Create Table Mroonga_stats CREATE TEMPORARY TABLE `Mroonga_stats` ( - `VERSION` varchar(40) NOT NULL DEFAULT '', - `rows_written` int(11) NOT NULL DEFAULT 0, - `rows_read` int(11) NOT NULL DEFAULT 0 + `VERSION` varchar(40) NOT NULL, + `rows_written` int(11) NOT NULL, + `rows_read` int(11) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/storage/perfschema/CMakeLists.txt b/storage/perfschema/CMakeLists.txt index 2a77e2a8301..3d2f043dd9e 100644 --- a/storage/perfschema/CMakeLists.txt +++ b/storage/perfschema/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/cursor_by_account.cc b/storage/perfschema/cursor_by_account.cc index 1b208e00d65..38359cb24aa 100644 --- a/storage/perfschema/cursor_by_account.cc +++ b/storage/perfschema/cursor_by_account.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/cursor_by_account.h b/storage/perfschema/cursor_by_account.h index d689cf6c524..1f6d65adc98 100644 --- a/storage/perfschema/cursor_by_account.h +++ b/storage/perfschema/cursor_by_account.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/cursor_by_host.cc b/storage/perfschema/cursor_by_host.cc index 6aa3423c0d1..26bdbc457f8 100644 --- a/storage/perfschema/cursor_by_host.cc +++ b/storage/perfschema/cursor_by_host.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/cursor_by_host.h b/storage/perfschema/cursor_by_host.h index 8f256156b1f..45a2fb894c1 100644 --- a/storage/perfschema/cursor_by_host.h +++ b/storage/perfschema/cursor_by_host.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/cursor_by_thread.cc b/storage/perfschema/cursor_by_thread.cc index 5d56794bf94..f8a4fa243ce 100644 --- a/storage/perfschema/cursor_by_thread.cc +++ b/storage/perfschema/cursor_by_thread.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/cursor_by_thread.h b/storage/perfschema/cursor_by_thread.h index 1fd803d906c..24578fd44f1 100644 --- a/storage/perfschema/cursor_by_thread.h +++ b/storage/perfschema/cursor_by_thread.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/cursor_by_thread_connect_attr.cc b/storage/perfschema/cursor_by_thread_connect_attr.cc index b4462a8d748..f87ce7059fb 100644 --- a/storage/perfschema/cursor_by_thread_connect_attr.cc +++ b/storage/perfschema/cursor_by_thread_connect_attr.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/cursor_by_thread_connect_attr.h b/storage/perfschema/cursor_by_thread_connect_attr.h index 7aa31115b30..4a18bdc5b7a 100644 --- a/storage/perfschema/cursor_by_thread_connect_attr.h +++ b/storage/perfschema/cursor_by_thread_connect_attr.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2012, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/cursor_by_user.cc b/storage/perfschema/cursor_by_user.cc index 7699bcf1fc8..4300f61f04f 100644 --- a/storage/perfschema/cursor_by_user.cc +++ b/storage/perfschema/cursor_by_user.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/cursor_by_user.h b/storage/perfschema/cursor_by_user.h index d31f886170c..1bbb06d2c18 100644 --- a/storage/perfschema/cursor_by_user.h +++ b/storage/perfschema/cursor_by_user.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc index da0c2c0813b..c0fa80b8e0d 100644 --- a/storage/perfschema/ha_perfschema.cc +++ b/storage/perfschema/ha_perfschema.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -320,8 +320,8 @@ int ha_perfschema::rnd_init(bool scan) int result; DBUG_ENTER("ha_perfschema::rnd_init"); - DBUG_ASSERT(m_table_share); - DBUG_ASSERT(m_table_share->m_open_table != NULL); + assert(m_table_share); + assert(m_table_share->m_open_table != NULL); stats.records= 0; if (m_table == NULL) @@ -339,7 +339,7 @@ int ha_perfschema::rnd_init(bool scan) int ha_perfschema::rnd_end(void) { DBUG_ENTER("ha_perfschema::rnd_end"); - DBUG_ASSERT(m_table); + assert(m_table); delete m_table; m_table= NULL; DBUG_RETURN(0); @@ -371,7 +371,7 @@ void ha_perfschema::position(const uchar *record) { DBUG_ENTER("ha_perfschema::position"); - DBUG_ASSERT(m_table); + assert(m_table); m_table->get_position(ref); DBUG_VOID_RETURN; } @@ -396,7 +396,7 @@ int ha_perfschema::rnd_pos(uchar *buf, uchar *pos) int ha_perfschema::info(uint flag) { DBUG_ENTER("ha_perfschema::info"); - DBUG_ASSERT(m_table_share); + assert(m_table_share); if (flag & HA_STATUS_VARIABLE) stats.records= m_table_share->get_row_count(); if (flag & HA_STATUS_CONST) @@ -415,7 +415,7 @@ int ha_perfschema::delete_all_rows(void) if (is_executed_by_slave()) DBUG_RETURN(0); - DBUG_ASSERT(m_table_share); + assert(m_table_share); if (m_table_share->m_delete_all_rows) result= m_table_share->m_delete_all_rows(); else diff --git a/storage/perfschema/ha_perfschema.h b/storage/perfschema/ha_perfschema.h index 690bf8d13a6..f3d84a3e264 100644 --- a/storage/perfschema/ha_perfschema.h +++ b/storage/perfschema/ha_perfschema.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -232,8 +232,8 @@ private: */ bool is_executed_by_slave() const { - DBUG_ASSERT(table != NULL); - DBUG_ASSERT(table->in_use != NULL); + assert(table != NULL); + assert(table->in_use != NULL); return table->in_use->slave_thread; } diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc index 48641ab1c68..4e3d4f551a0 100644 --- a/storage/perfschema/pfs.cc +++ b/storage/perfschema/pfs.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -92,9 +92,9 @@ static void report_memory_accounting_error( old_thread->m_thread_internal_id, old_thread->m_class->m_name); - DBUG_ASSERT(strcmp(new_thread->m_class->m_name, "thread/sql/event_worker") != 0); - DBUG_ASSERT(strcmp(new_thread->m_class->m_name, "thread/sql/event_scheduler") != 0); - DBUG_ASSERT(strcmp(new_thread->m_class->m_name, "thread/sql/one_connection") != 0); + assert(strcmp(new_thread->m_class->m_name, "thread/sql/event_worker") != 0); + assert(strcmp(new_thread->m_class->m_name, "thread/sql/event_scheduler") != 0); + assert(strcmp(new_thread->m_class->m_name, "thread/sql/one_connection") != 0); } #endif /* PFS_PARANOID */ @@ -1367,16 +1367,16 @@ bool THR_PFS_initialized= false; static inline PFS_thread* my_thread_get_THR_PFS() { - DBUG_ASSERT(THR_PFS_initialized); + assert(THR_PFS_initialized); PFS_thread *thread= static_cast<PFS_thread*>(my_get_thread_local(THR_PFS)); - DBUG_ASSERT(thread == NULL || sanitize_thread(thread) != NULL); + assert(thread == NULL || sanitize_thread(thread) != NULL); return thread; } static inline void my_thread_set_THR_PFS(PFS_thread *pfs) { - DBUG_ASSERT(THR_PFS_initialized); + assert(THR_PFS_initialized); my_set_thread_local(THR_PFS, pfs); } @@ -1554,8 +1554,8 @@ static int build_prefix(const LEX_CSTRING *prefix, const char *category, size_t len; \ size_t full_length; \ \ - DBUG_ASSERT(category != NULL); \ - DBUG_ASSERT(info != NULL); \ + assert(category != NULL); \ + assert(info != NULL); \ if (unlikely(build_prefix(&PREFIX, category, \ formatted_name, &prefix_length)) || \ ! pfs_initialized) \ @@ -1567,8 +1567,8 @@ static int build_prefix(const LEX_CSTRING *prefix, const char *category, \ for (; count>0; count--, info++) \ { \ - DBUG_ASSERT(info->m_key != NULL); \ - DBUG_ASSERT(info->m_name != NULL); \ + assert(info->m_key != NULL); \ + assert(info->m_name != NULL); \ len= strlen(info->m_name); \ full_length= prefix_length + len; \ if (likely(full_length <= PFS_MAX_INFO_NAME_LENGTH)) \ @@ -1620,8 +1620,8 @@ void pfs_register_rwlock_v1(const char *category, size_t len; size_t full_length; - DBUG_ASSERT(category != NULL); - DBUG_ASSERT(info != NULL); + assert(category != NULL); + assert(info != NULL); if (build_prefix(&rwlock_instrument_prefix, category, rw_formatted_name, &rw_prefix_length) || build_prefix(&sxlock_instrument_prefix, category, @@ -1635,8 +1635,8 @@ void pfs_register_rwlock_v1(const char *category, for (; count>0; count--, info++) { - DBUG_ASSERT(info->m_key != NULL); - DBUG_ASSERT(info->m_name != NULL); + assert(info->m_key != NULL); + assert(info->m_name != NULL); len= strlen(info->m_name); if (info->m_flags & PSI_RWLOCK_FLAG_SX) @@ -1724,8 +1724,8 @@ void pfs_register_stage_v1(const char *category, size_t full_length; PSI_stage_info_v1 *info; - DBUG_ASSERT(category != NULL); - DBUG_ASSERT(info_array != NULL); + assert(category != NULL); + assert(info_array != NULL); if (unlikely(build_prefix(&stage_instrument_prefix, category, formatted_name, &prefix_length)) || ! pfs_initialized) @@ -1770,8 +1770,8 @@ void pfs_register_statement_v1(const char *category, size_t len; size_t full_length; - DBUG_ASSERT(category != NULL); - DBUG_ASSERT(info != NULL); + assert(category != NULL); + assert(info != NULL); if (unlikely(build_prefix(&statement_instrument_prefix, category, formatted_name, &prefix_length)) || ! pfs_initialized) @@ -1839,7 +1839,7 @@ void pfs_destroy_mutex_v1(PSI_mutex* mutex) { PFS_mutex *pfs= reinterpret_cast<PFS_mutex*> (mutex); - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); destroy_mutex(pfs); } @@ -1862,7 +1862,7 @@ void pfs_destroy_rwlock_v1(PSI_rwlock* rwlock) { PFS_rwlock *pfs= reinterpret_cast<PFS_rwlock*> (rwlock); - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); destroy_rwlock(pfs); } @@ -1885,7 +1885,7 @@ void pfs_destroy_cond_v1(PSI_cond* cond) { PFS_cond *pfs= reinterpret_cast<PFS_cond*> (cond); - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); destroy_cond(pfs); } @@ -2004,7 +2004,7 @@ pfs_rebind_table_v1(PSI_table_share *share, const void *identity, PSI_table *tab PFS_table *pfs= reinterpret_cast<PFS_table*> (table); if (likely(pfs != NULL)) { - DBUG_ASSERT(pfs->m_thread_owner == NULL); + assert(pfs->m_thread_owner == NULL); if (unlikely(! pfs->m_share->m_enabled)) { @@ -2088,7 +2088,7 @@ void pfs_destroy_socket_v1(PSI_socket *socket) { PFS_socket *pfs= reinterpret_cast<PFS_socket*> (socket); - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); destroy_socket(pfs); } @@ -2337,9 +2337,9 @@ void pfs_set_thread_user_v1(const char *user, int user_len) pfs_dirty_state dirty_state; PFS_thread *pfs= my_thread_get_THR_PFS(); - DBUG_ASSERT((user != NULL) || (user_len == 0)); - DBUG_ASSERT(user_len >= 0); - DBUG_ASSERT((uint) user_len <= sizeof(pfs->m_username)); + assert((user != NULL) || (user_len == 0)); + assert(user_len >= 0); + assert((uint) user_len <= sizeof(pfs->m_username)); if (unlikely(pfs == NULL)) return; @@ -2395,11 +2395,11 @@ void pfs_set_thread_account_v1(const char *user, int user_len, pfs_dirty_state dirty_state; PFS_thread *pfs= my_thread_get_THR_PFS(); - DBUG_ASSERT((user != NULL) || (user_len == 0)); - DBUG_ASSERT(user_len >= 0); - DBUG_ASSERT((uint) user_len <= sizeof(pfs->m_username)); - DBUG_ASSERT((host != NULL) || (host_len == 0)); - DBUG_ASSERT(host_len >= 0); + assert((user != NULL) || (user_len == 0)); + assert(user_len >= 0); + assert((uint) user_len <= sizeof(pfs->m_username)); + assert((host != NULL) || (host_len == 0)); + assert(host_len >= 0); host_len= MY_MIN(host_len, static_cast<int>(sizeof(pfs->m_hostname))); @@ -2457,9 +2457,9 @@ void pfs_set_thread_db_v1(const char* db, int db_len) { PFS_thread *pfs= my_thread_get_THR_PFS(); - DBUG_ASSERT((db != NULL) || (db_len == 0)); - DBUG_ASSERT(db_len >= 0); - DBUG_ASSERT((uint) db_len <= sizeof(pfs->m_dbname)); + assert((db != NULL) || (db_len == 0)); + assert(db_len >= 0); + assert((uint) db_len <= sizeof(pfs->m_dbname)); if (likely(pfs != NULL)) { @@ -2480,8 +2480,8 @@ void pfs_set_thread_command_v1(int command) { PFS_thread *pfs= my_thread_get_THR_PFS(); - DBUG_ASSERT(command >= 0); - DBUG_ASSERT(command <= (int) COM_END); + assert(command >= 0); + assert(command <= (int) COM_END); if (likely(pfs != NULL)) { @@ -2536,7 +2536,7 @@ void pfs_set_thread_info_v1(const char* info, uint info_len) pfs_dirty_state dirty_state; PFS_thread *pfs= my_thread_get_THR_PFS(); - DBUG_ASSERT((info != NULL) || (info_len == 0)); + assert((info != NULL) || (info_len == 0)); if (likely(pfs != NULL)) { @@ -2609,12 +2609,12 @@ pfs_start_mutex_wait_v1(PSI_mutex_locker_state *state, const char *src_file, uint src_line) { PFS_mutex *pfs_mutex= reinterpret_cast<PFS_mutex*> (mutex); - DBUG_ASSERT((int) op >= 0); - DBUG_ASSERT((uint) op < array_elements(mutex_operation_map)); - DBUG_ASSERT(state != NULL); + assert((int) op >= 0); + assert((uint) op < array_elements(mutex_operation_map)); + assert(state != NULL); - DBUG_ASSERT(pfs_mutex != NULL); - DBUG_ASSERT(pfs_mutex->m_class != NULL); + assert(pfs_mutex != NULL); + assert(pfs_mutex->m_class != NULL); if (! pfs_mutex->m_enabled) return NULL; @@ -2708,31 +2708,31 @@ pfs_start_rwlock_wait_v1(PSI_rwlock_locker_state *state, const char *src_file, uint src_line) { PFS_rwlock *pfs_rwlock= reinterpret_cast<PFS_rwlock*> (rwlock); - DBUG_ASSERT(static_cast<int> (op) >= 0); - DBUG_ASSERT(static_cast<uint> (op) < array_elements(rwlock_operation_map)); - DBUG_ASSERT(state != NULL); - DBUG_ASSERT(pfs_rwlock != NULL); - DBUG_ASSERT(pfs_rwlock->m_class != NULL); + assert(static_cast<int> (op) >= 0); + assert(static_cast<uint> (op) < array_elements(rwlock_operation_map)); + assert(state != NULL); + assert(pfs_rwlock != NULL); + assert(pfs_rwlock->m_class != NULL); /* Operations supported for READ WRITE LOCK */ - DBUG_ASSERT( pfs_rwlock->m_class->is_shared_exclusive() - || (op == PSI_RWLOCK_READLOCK) - || (op == PSI_RWLOCK_WRITELOCK) - || (op == PSI_RWLOCK_TRYREADLOCK) - || (op == PSI_RWLOCK_TRYWRITELOCK) - ); + assert( pfs_rwlock->m_class->is_shared_exclusive() + || (op == PSI_RWLOCK_READLOCK) + || (op == PSI_RWLOCK_WRITELOCK) + || (op == PSI_RWLOCK_TRYREADLOCK) + || (op == PSI_RWLOCK_TRYWRITELOCK) + ); /* Operations supported for SHARED EXCLUSIVE LOCK */ - DBUG_ASSERT( ! pfs_rwlock->m_class->is_shared_exclusive() - || (op == PSI_RWLOCK_SHAREDLOCK) - || (op == PSI_RWLOCK_SHAREDEXCLUSIVELOCK) - || (op == PSI_RWLOCK_EXCLUSIVELOCK) - || (op == PSI_RWLOCK_TRYSHAREDLOCK) - || (op == PSI_RWLOCK_TRYSHAREDEXCLUSIVELOCK) - || (op == PSI_RWLOCK_TRYEXCLUSIVELOCK) - ); + assert( ! pfs_rwlock->m_class->is_shared_exclusive() + || (op == PSI_RWLOCK_SHAREDLOCK) + || (op == PSI_RWLOCK_SHAREDEXCLUSIVELOCK) + || (op == PSI_RWLOCK_EXCLUSIVELOCK) + || (op == PSI_RWLOCK_TRYSHAREDLOCK) + || (op == PSI_RWLOCK_TRYSHAREDEXCLUSIVELOCK) + || (op == PSI_RWLOCK_TRYEXCLUSIVELOCK) + ); if (! pfs_rwlock->m_enabled) return NULL; @@ -2821,10 +2821,10 @@ pfs_start_rwlock_rdwait_v1(PSI_rwlock_locker_state *state, PSI_rwlock_operation op, const char *src_file, uint src_line) { - DBUG_ASSERT((op == PSI_RWLOCK_READLOCK) || - (op == PSI_RWLOCK_TRYREADLOCK) || - (op == PSI_RWLOCK_SHAREDLOCK) || - (op == PSI_RWLOCK_TRYSHAREDLOCK)); + assert((op == PSI_RWLOCK_READLOCK) || + (op == PSI_RWLOCK_TRYREADLOCK) || + (op == PSI_RWLOCK_SHAREDLOCK) || + (op == PSI_RWLOCK_TRYSHAREDLOCK)); return pfs_start_rwlock_wait_v1(state, rwlock, op, src_file, src_line); } @@ -2835,12 +2835,12 @@ pfs_start_rwlock_wrwait_v1(PSI_rwlock_locker_state *state, PSI_rwlock_operation op, const char *src_file, uint src_line) { - DBUG_ASSERT((op == PSI_RWLOCK_WRITELOCK) || - (op == PSI_RWLOCK_TRYWRITELOCK) || - (op == PSI_RWLOCK_SHAREDEXCLUSIVELOCK) || - (op == PSI_RWLOCK_TRYSHAREDEXCLUSIVELOCK) || - (op == PSI_RWLOCK_EXCLUSIVELOCK) || - (op == PSI_RWLOCK_TRYEXCLUSIVELOCK)); + assert((op == PSI_RWLOCK_WRITELOCK) || + (op == PSI_RWLOCK_TRYWRITELOCK) || + (op == PSI_RWLOCK_SHAREDEXCLUSIVELOCK) || + (op == PSI_RWLOCK_TRYSHAREDEXCLUSIVELOCK) || + (op == PSI_RWLOCK_EXCLUSIVELOCK) || + (op == PSI_RWLOCK_TRYEXCLUSIVELOCK)); return pfs_start_rwlock_wait_v1(state, rwlock, op, src_file, src_line); } @@ -2867,11 +2867,11 @@ pfs_start_cond_wait_v1(PSI_cond_locker_state *state, in start_cond_wait_v1() and end_cond_wait_v1(). */ PFS_cond *pfs_cond= reinterpret_cast<PFS_cond*> (cond); - DBUG_ASSERT(static_cast<int> (op) >= 0); - DBUG_ASSERT(static_cast<uint> (op) < array_elements(cond_operation_map)); - DBUG_ASSERT(state != NULL); - DBUG_ASSERT(pfs_cond != NULL); - DBUG_ASSERT(pfs_cond->m_class != NULL); + assert(static_cast<int> (op) >= 0); + assert(static_cast<uint> (op) < array_elements(cond_operation_map)); + assert(state != NULL); + assert(pfs_cond != NULL); + assert(pfs_cond->m_class != NULL); if (! pfs_cond->m_enabled) return NULL; @@ -2984,7 +2984,7 @@ static inline PFS_TL_LOCK_TYPE lock_flags_to_lock_type(uint flags) case TL_READ_DEFAULT: case TL_WRITE_DEFAULT: default: - DBUG_ASSERT(false); + assert(false); } /* Dead code */ @@ -2993,7 +2993,7 @@ static inline PFS_TL_LOCK_TYPE lock_flags_to_lock_type(uint flags) static inline PFS_TL_LOCK_TYPE external_lock_flags_to_lock_type(uint flags) { - DBUG_ASSERT(flags == F_RDLCK || flags == F_WRLCK); + assert(flags == F_RDLCK || flags == F_WRLCK); return (flags == F_RDLCK ? PFS_TL_READ_EXTERNAL : PFS_TL_WRITE_EXTERNAL); } @@ -3008,12 +3008,12 @@ pfs_start_table_io_wait_v1(PSI_table_locker_state *state, uint index, const char *src_file, uint src_line) { - DBUG_ASSERT(static_cast<int> (op) >= 0); - DBUG_ASSERT(static_cast<uint> (op) < array_elements(table_io_operation_map)); - DBUG_ASSERT(state != NULL); + assert(static_cast<int> (op) >= 0); + assert(static_cast<uint> (op) < array_elements(table_io_operation_map)); + assert(state != NULL); PFS_table *pfs_table= reinterpret_cast<PFS_table*> (table); - DBUG_ASSERT(pfs_table != NULL); - DBUG_ASSERT(pfs_table->m_share != NULL); + assert(pfs_table != NULL); + assert(pfs_table->m_share != NULL); if (! pfs_table->m_io_enabled) return NULL; @@ -3110,13 +3110,13 @@ pfs_start_table_lock_wait_v1(PSI_table_locker_state *state, ulong op_flags, const char *src_file, uint src_line) { - DBUG_ASSERT(state != NULL); - DBUG_ASSERT((op == PSI_TABLE_LOCK) || (op == PSI_TABLE_EXTERNAL_LOCK)); + assert(state != NULL); + assert((op == PSI_TABLE_LOCK) || (op == PSI_TABLE_EXTERNAL_LOCK)); PFS_table *pfs_table= reinterpret_cast<PFS_table*> (table); - DBUG_ASSERT(pfs_table != NULL); - DBUG_ASSERT(pfs_table->m_share != NULL); + assert(pfs_table != NULL); + assert(pfs_table->m_share != NULL); if (! pfs_table->m_lock_enabled) return NULL; @@ -3146,10 +3146,10 @@ pfs_start_table_lock_wait_v1(PSI_table_locker_state *state, break; default: lock_type= PFS_TL_READ; - DBUG_ASSERT(false); + assert(false); } - DBUG_ASSERT((uint) lock_type < array_elements(table_lock_operation_map)); + assert((uint) lock_type < array_elements(table_lock_operation_map)); uint flags; ulonglong timer_start= 0; @@ -3239,9 +3239,9 @@ pfs_get_thread_file_name_locker_v1(PSI_file_locker_state *state, PSI_file_operation op, const char *name, const void *identity) { - DBUG_ASSERT(static_cast<int> (op) >= 0); - DBUG_ASSERT(static_cast<uint> (op) < array_elements(file_operation_map)); - DBUG_ASSERT(state != NULL); + assert(static_cast<int> (op) >= 0); + assert(static_cast<uint> (op) < array_elements(file_operation_map)); + assert(state != NULL); if (psi_unlikely(! flag_global_instrumentation)) return NULL; @@ -3316,13 +3316,13 @@ pfs_get_thread_file_stream_locker_v1(PSI_file_locker_state *state, PSI_file *file, PSI_file_operation op) { PFS_file *pfs_file= reinterpret_cast<PFS_file*> (file); - DBUG_ASSERT(static_cast<int> (op) >= 0); - DBUG_ASSERT(static_cast<uint> (op) < array_elements(file_operation_map)); - DBUG_ASSERT(state != NULL); + assert(static_cast<int> (op) >= 0); + assert(static_cast<uint> (op) < array_elements(file_operation_map)); + assert(state != NULL); if (unlikely(pfs_file == NULL)) return NULL; - DBUG_ASSERT(pfs_file->m_class != NULL); + assert(pfs_file->m_class != NULL); PFS_file_class *klass= pfs_file->m_class; if (! pfs_file->m_enabled) @@ -3409,9 +3409,9 @@ pfs_get_thread_file_descriptor_locker_v1(PSI_file_locker_state *state, File file, PSI_file_operation op) { int index= static_cast<int> (file); - DBUG_ASSERT(static_cast<int> (op) >= 0); - DBUG_ASSERT(static_cast<uint> (op) < array_elements(file_operation_map)); - DBUG_ASSERT(state != NULL); + assert(static_cast<int> (op) >= 0); + assert(static_cast<uint> (op) < array_elements(file_operation_map)); + assert(state != NULL); if (unlikely((index < 0) || (index >= file_handle_max))) return NULL; @@ -3434,7 +3434,7 @@ pfs_get_thread_file_descriptor_locker_v1(PSI_file_locker_state *state, if (! pfs_file->m_enabled) return NULL; - DBUG_ASSERT(pfs_file->m_class != NULL); + assert(pfs_file->m_class != NULL); PFS_file_class *klass= pfs_file->m_class; /* Needed for the LF_HASH */ @@ -3518,13 +3518,13 @@ pfs_start_socket_wait_v1(PSI_socket_locker_state *state, size_t count, const char *src_file, uint src_line) { - DBUG_ASSERT(static_cast<int> (op) >= 0); - DBUG_ASSERT(static_cast<uint> (op) < array_elements(socket_operation_map)); - DBUG_ASSERT(state != NULL); + assert(static_cast<int> (op) >= 0); + assert(static_cast<uint> (op) < array_elements(socket_operation_map)); + assert(state != NULL); PFS_socket *pfs_socket= reinterpret_cast<PFS_socket*> (socket); - DBUG_ASSERT(pfs_socket != NULL); - DBUG_ASSERT(pfs_socket->m_class != NULL); + assert(pfs_socket != NULL); + assert(pfs_socket->m_class != NULL); if (!pfs_socket->m_enabled || pfs_socket->m_idle) return NULL; @@ -3640,7 +3640,7 @@ void pfs_unlock_mutex_v1(PSI_mutex *mutex) { PFS_mutex *pfs_mutex= reinterpret_cast<PFS_mutex*> (mutex); - DBUG_ASSERT(pfs_mutex != NULL); + assert(pfs_mutex != NULL); /* Note that this code is still protected by the instrumented mutex, @@ -3676,10 +3676,10 @@ void pfs_unlock_mutex_v1(PSI_mutex *mutex) void pfs_unlock_rwlock_v1(PSI_rwlock *rwlock) { PFS_rwlock *pfs_rwlock= reinterpret_cast<PFS_rwlock*> (rwlock); - DBUG_ASSERT(pfs_rwlock != NULL); - DBUG_ASSERT(pfs_rwlock == sanitize_rwlock(pfs_rwlock)); - DBUG_ASSERT(pfs_rwlock->m_class != NULL); - DBUG_ASSERT(pfs_rwlock->m_lock.is_populated()); + assert(pfs_rwlock != NULL); + assert(pfs_rwlock == sanitize_rwlock(pfs_rwlock)); + assert(pfs_rwlock->m_class != NULL); + assert(pfs_rwlock->m_lock.is_populated()); bool last_writer= false; bool last_reader= false; @@ -3756,7 +3756,7 @@ void pfs_signal_cond_v1(PSI_cond* cond) #ifdef PFS_LATER PFS_cond *pfs_cond= reinterpret_cast<PFS_cond*> (cond); - DBUG_ASSERT(pfs_cond != NULL); + assert(pfs_cond != NULL); pfs_cond->m_cond_stat.m_signal_count++; #endif @@ -3771,7 +3771,7 @@ void pfs_broadcast_cond_v1(PSI_cond* cond) #ifdef PFS_LATER PFS_cond *pfs_cond= reinterpret_cast<PFS_cond*> (cond); - DBUG_ASSERT(pfs_cond != NULL); + assert(pfs_cond != NULL); pfs_cond->m_cond_stat.m_broadcast_count++; #endif @@ -3784,7 +3784,7 @@ void pfs_broadcast_cond_v1(PSI_cond* cond) PSI_idle_locker* pfs_start_idle_wait_v1(PSI_idle_locker_state* state, const char *src_file, uint src_line) { - DBUG_ASSERT(state != NULL); + assert(state != NULL); if (psi_unlikely(! flag_global_instrumentation)) return NULL; @@ -3805,7 +3805,7 @@ pfs_start_idle_wait_v1(PSI_idle_locker_state* state, const char *src_file, uint state->m_thread= reinterpret_cast<PSI_thread *> (pfs_thread); flags= STATE_FLAG_THREAD; - DBUG_ASSERT(pfs_thread->m_events_statements_count == 0); + assert(pfs_thread->m_events_statements_count == 0); if (global_idle_class.m_timed) { @@ -3870,7 +3870,7 @@ pfs_start_idle_wait_v1(PSI_idle_locker_state* state, const char *src_file, uint void pfs_end_idle_wait_v1(PSI_idle_locker* locker) { PSI_idle_locker_state *state= reinterpret_cast<PSI_idle_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); ulonglong timer_end= 0; ulonglong wait_time= 0; @@ -3902,7 +3902,7 @@ void pfs_end_idle_wait_v1(PSI_idle_locker* locker) if (flags & STATE_FLAG_EVENT) { PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait); - DBUG_ASSERT(wait != NULL); + assert(wait != NULL); wait->m_timer_end= timer_end; wait->m_end_event_id= thread->m_event_id; @@ -3912,7 +3912,7 @@ void pfs_end_idle_wait_v1(PSI_idle_locker* locker) insert_events_waits_history_long(wait); thread->m_events_waits_current--; - DBUG_ASSERT(wait == thread->m_events_waits_current); + assert(wait == thread->m_events_waits_current); } } @@ -3935,13 +3935,13 @@ void pfs_end_idle_wait_v1(PSI_idle_locker* locker) void pfs_end_mutex_wait_v1(PSI_mutex_locker* locker, int rc) { PSI_mutex_locker_state *state= reinterpret_cast<PSI_mutex_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); ulonglong timer_end= 0; ulonglong wait_time= 0; PFS_mutex *mutex= reinterpret_cast<PFS_mutex *> (state->m_mutex); - DBUG_ASSERT(mutex != NULL); + assert(mutex != NULL); PFS_thread *thread= reinterpret_cast<PFS_thread *> (state->m_thread); uint flags= state->m_flags; @@ -3971,8 +3971,8 @@ void pfs_end_mutex_wait_v1(PSI_mutex_locker* locker, int rc) event_name_array= thread->write_instr_class_waits_stats(); uint index= mutex->m_class->m_event_name_index; - DBUG_ASSERT(index <= wait_class_max); - DBUG_ASSERT(sanitize_thread(thread) != NULL); + assert(index <= wait_class_max); + assert(sanitize_thread(thread) != NULL); if (flags & STATE_FLAG_TIMED) { @@ -3988,7 +3988,7 @@ void pfs_end_mutex_wait_v1(PSI_mutex_locker* locker, int rc) if (flags & STATE_FLAG_EVENT) { PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait); - DBUG_ASSERT(wait != NULL); + assert(wait != NULL); wait->m_timer_end= timer_end; wait->m_end_event_id= thread->m_event_id; @@ -3998,7 +3998,7 @@ void pfs_end_mutex_wait_v1(PSI_mutex_locker* locker, int rc) insert_events_waits_history_long(wait); thread->m_events_waits_current--; - DBUG_ASSERT(wait == thread->m_events_waits_current); + assert(wait == thread->m_events_waits_current); } } } @@ -4010,13 +4010,13 @@ void pfs_end_mutex_wait_v1(PSI_mutex_locker* locker, int rc) void pfs_end_rwlock_rdwait_v1(PSI_rwlock_locker* locker, int rc) { PSI_rwlock_locker_state *state= reinterpret_cast<PSI_rwlock_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); ulonglong timer_end= 0; ulonglong wait_time= 0; PFS_rwlock *rwlock= reinterpret_cast<PFS_rwlock *> (state->m_rwlock); - DBUG_ASSERT(rwlock != NULL); + assert(rwlock != NULL); if (state->m_flags & STATE_FLAG_TIMED) { @@ -4049,7 +4049,7 @@ void pfs_end_rwlock_rdwait_v1(PSI_rwlock_locker* locker, int rc) if (state->m_flags & STATE_FLAG_THREAD) { PFS_thread *thread= reinterpret_cast<PFS_thread *> (state->m_thread); - DBUG_ASSERT(thread != NULL); + assert(thread != NULL); PFS_single_stat *event_name_array; event_name_array= thread->write_instr_class_waits_stats(); @@ -4069,7 +4069,7 @@ void pfs_end_rwlock_rdwait_v1(PSI_rwlock_locker* locker, int rc) if (state->m_flags & STATE_FLAG_EVENT) { PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait); - DBUG_ASSERT(wait != NULL); + assert(wait != NULL); wait->m_timer_end= timer_end; wait->m_end_event_id= thread->m_event_id; @@ -4079,7 +4079,7 @@ void pfs_end_rwlock_rdwait_v1(PSI_rwlock_locker* locker, int rc) insert_events_waits_history_long(wait); thread->m_events_waits_current--; - DBUG_ASSERT(wait == thread->m_events_waits_current); + assert(wait == thread->m_events_waits_current); } } } @@ -4091,13 +4091,13 @@ void pfs_end_rwlock_rdwait_v1(PSI_rwlock_locker* locker, int rc) void pfs_end_rwlock_wrwait_v1(PSI_rwlock_locker* locker, int rc) { PSI_rwlock_locker_state *state= reinterpret_cast<PSI_rwlock_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); ulonglong timer_end= 0; ulonglong wait_time= 0; PFS_rwlock *rwlock= reinterpret_cast<PFS_rwlock *> (state->m_rwlock); - DBUG_ASSERT(rwlock != NULL); + assert(rwlock != NULL); PFS_thread *thread= reinterpret_cast<PFS_thread *> (state->m_thread); if (state->m_flags & STATE_FLAG_TIMED) @@ -4148,7 +4148,7 @@ void pfs_end_rwlock_wrwait_v1(PSI_rwlock_locker* locker, int rc) if (state->m_flags & STATE_FLAG_EVENT) { PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait); - DBUG_ASSERT(wait != NULL); + assert(wait != NULL); wait->m_timer_end= timer_end; wait->m_end_event_id= thread->m_event_id; @@ -4158,7 +4158,7 @@ void pfs_end_rwlock_wrwait_v1(PSI_rwlock_locker* locker, int rc) insert_events_waits_history_long(wait); thread->m_events_waits_current--; - DBUG_ASSERT(wait == thread->m_events_waits_current); + assert(wait == thread->m_events_waits_current); } } } @@ -4170,7 +4170,7 @@ void pfs_end_rwlock_wrwait_v1(PSI_rwlock_locker* locker, int rc) void pfs_end_cond_wait_v1(PSI_cond_locker* locker, int rc) { PSI_cond_locker_state *state= reinterpret_cast<PSI_cond_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); ulonglong timer_end= 0; ulonglong wait_time= 0; @@ -4194,7 +4194,7 @@ void pfs_end_cond_wait_v1(PSI_cond_locker* locker, int rc) if (state->m_flags & STATE_FLAG_THREAD) { PFS_thread *thread= reinterpret_cast<PFS_thread *> (state->m_thread); - DBUG_ASSERT(thread != NULL); + assert(thread != NULL); PFS_single_stat *event_name_array; event_name_array= thread->write_instr_class_waits_stats(); @@ -4214,7 +4214,7 @@ void pfs_end_cond_wait_v1(PSI_cond_locker* locker, int rc) if (state->m_flags & STATE_FLAG_EVENT) { PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait); - DBUG_ASSERT(wait != NULL); + assert(wait != NULL); wait->m_timer_end= timer_end; wait->m_end_event_id= thread->m_event_id; @@ -4224,7 +4224,7 @@ void pfs_end_cond_wait_v1(PSI_cond_locker* locker, int rc) insert_events_waits_history_long(wait); thread->m_events_waits_current--; - DBUG_ASSERT(wait == thread->m_events_waits_current); + assert(wait == thread->m_events_waits_current); } } } @@ -4236,19 +4236,19 @@ void pfs_end_cond_wait_v1(PSI_cond_locker* locker, int rc) void pfs_end_table_io_wait_v1(PSI_table_locker* locker, ulonglong numrows) { PSI_table_locker_state *state= reinterpret_cast<PSI_table_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); ulonglong timer_end= 0; ulonglong wait_time= 0; PFS_table *table= reinterpret_cast<PFS_table *> (state->m_table); - DBUG_ASSERT(table != NULL); + assert(table != NULL); PFS_single_stat *stat; PFS_table_io_stat *table_io_stat; - DBUG_ASSERT((state->m_index < table->m_share->m_key_count) || - (state->m_index == MAX_INDEXES)); + assert((state->m_index < table->m_share->m_key_count) || + (state->m_index == MAX_INDEXES)); table_io_stat= & table->m_table_stat.m_index_stat[state->m_index]; table_io_stat->m_has_data= true; @@ -4268,7 +4268,7 @@ void pfs_end_table_io_wait_v1(PSI_table_locker* locker, ulonglong numrows) stat= & table_io_stat->m_delete; break; default: - DBUG_ASSERT(false); + assert(false); stat= NULL; break; } @@ -4289,7 +4289,7 @@ void pfs_end_table_io_wait_v1(PSI_table_locker* locker, ulonglong numrows) if (flags & STATE_FLAG_THREAD) { PFS_thread *thread= reinterpret_cast<PFS_thread *> (state->m_thread); - DBUG_ASSERT(thread != NULL); + assert(thread != NULL); PFS_single_stat *event_name_array; event_name_array= thread->write_instr_class_waits_stats(); @@ -4310,7 +4310,7 @@ void pfs_end_table_io_wait_v1(PSI_table_locker* locker, ulonglong numrows) if (flags & STATE_FLAG_EVENT) { PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait); - DBUG_ASSERT(wait != NULL); + assert(wait != NULL); wait->m_timer_end= timer_end; wait->m_end_event_id= thread->m_event_id; @@ -4321,7 +4321,7 @@ void pfs_end_table_io_wait_v1(PSI_table_locker* locker, ulonglong numrows) insert_events_waits_history_long(wait); thread->m_events_waits_current--; - DBUG_ASSERT(wait == thread->m_events_waits_current); + assert(wait == thread->m_events_waits_current); } } @@ -4335,13 +4335,13 @@ void pfs_end_table_io_wait_v1(PSI_table_locker* locker, ulonglong numrows) void pfs_end_table_lock_wait_v1(PSI_table_locker* locker) { PSI_table_locker_state *state= reinterpret_cast<PSI_table_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); ulonglong timer_end= 0; ulonglong wait_time= 0; PFS_table *table= reinterpret_cast<PFS_table *> (state->m_table); - DBUG_ASSERT(table != NULL); + assert(table != NULL); PFS_single_stat *stat= & table->m_table_stat.m_lock_stat.m_stat[state->m_index]; @@ -4361,7 +4361,7 @@ void pfs_end_table_lock_wait_v1(PSI_table_locker* locker) if (flags & STATE_FLAG_THREAD) { PFS_thread *thread= reinterpret_cast<PFS_thread *> (state->m_thread); - DBUG_ASSERT(thread != NULL); + assert(thread != NULL); PFS_single_stat *event_name_array; event_name_array= thread->write_instr_class_waits_stats(); @@ -4382,7 +4382,7 @@ void pfs_end_table_lock_wait_v1(PSI_table_locker* locker) if (flags & STATE_FLAG_EVENT) { PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait); - DBUG_ASSERT(wait != NULL); + assert(wait != NULL); wait->m_timer_end= timer_end; wait->m_end_event_id= thread->m_event_id; @@ -4392,7 +4392,7 @@ void pfs_end_table_lock_wait_v1(PSI_table_locker* locker) insert_events_waits_history_long(wait); thread->m_events_waits_current--; - DBUG_ASSERT(wait == thread->m_events_waits_current); + assert(wait == thread->m_events_waits_current); } } @@ -4429,7 +4429,7 @@ pfs_end_file_open_wait_v1(PSI_file_locker *locker, void *result) { PSI_file_locker_state *state= reinterpret_cast<PSI_file_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); switch (state->m_operation) { @@ -4450,7 +4450,7 @@ pfs_end_file_open_wait_v1(PSI_file_locker *locker, } break; default: - DBUG_ASSERT(false); + assert(false); break; } @@ -4469,7 +4469,7 @@ void pfs_end_file_open_wait_and_bind_to_descriptor_v1 PFS_file *pfs_file= NULL; int index= (int) file; PSI_file_locker_state *state= reinterpret_cast<PSI_file_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); if (index >= 0) { @@ -4503,9 +4503,9 @@ void pfs_end_file_open_wait_and_bind_to_descriptor_v1 void pfs_end_temp_file_open_wait_and_bind_to_descriptor_v1 (PSI_file_locker *locker, File file, const char *filename) { - DBUG_ASSERT(filename != NULL); + assert(filename != NULL); PSI_file_locker_state *state= reinterpret_cast<PSI_file_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); /* Set filename that was generated during creation of temporary file. */ state->m_name= filename; @@ -4530,7 +4530,7 @@ void pfs_start_file_wait_v1(PSI_file_locker *locker, { ulonglong timer_start= 0; PSI_file_locker_state *state= reinterpret_cast<PSI_file_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); uint flags= state->m_flags; @@ -4543,7 +4543,7 @@ void pfs_start_file_wait_v1(PSI_file_locker *locker, if (flags & STATE_FLAG_EVENT) { PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait); - DBUG_ASSERT(wait != NULL); + assert(wait != NULL); wait->m_timer_start= timer_start; wait->m_source_file= src_file; @@ -4560,7 +4560,7 @@ void pfs_end_file_wait_v1(PSI_file_locker *locker, size_t byte_count) { PSI_file_locker_state *state= reinterpret_cast<PSI_file_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); PFS_file *file= reinterpret_cast<PFS_file *> (state->m_file); PFS_file_class *klass= reinterpret_cast<PFS_file_class *> (state->m_class); PFS_thread *thread= reinterpret_cast<PFS_thread *> (state->m_thread); @@ -4611,7 +4611,7 @@ void pfs_end_file_wait_v1(PSI_file_locker *locker, byte_stat= &file_stat->m_io_stat.m_misc; break; default: - DBUG_ASSERT(false); + assert(false); byte_stat= NULL; break; } @@ -4632,7 +4632,7 @@ void pfs_end_file_wait_v1(PSI_file_locker *locker, if (flags & STATE_FLAG_THREAD) { - DBUG_ASSERT(thread != NULL); + assert(thread != NULL); PFS_single_stat *event_name_array; event_name_array= thread->write_instr_class_waits_stats(); @@ -4652,7 +4652,7 @@ void pfs_end_file_wait_v1(PSI_file_locker *locker, if (state->m_flags & STATE_FLAG_EVENT) { PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait); - DBUG_ASSERT(wait != NULL); + assert(wait != NULL); wait->m_timer_end= timer_end; wait->m_number_of_bytes= bytes; @@ -4667,7 +4667,7 @@ void pfs_end_file_wait_v1(PSI_file_locker *locker, insert_events_waits_history_long(wait); thread->m_events_waits_current--; - DBUG_ASSERT(wait == thread->m_events_waits_current); + assert(wait == thread->m_events_waits_current); } } } @@ -4685,7 +4685,7 @@ void pfs_start_file_close_wait_v1(PSI_file_locker *locker, uint len; PFS_file *pfs_file; PSI_file_locker_state *state= reinterpret_cast<PSI_file_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); switch (state->m_operation) { @@ -4700,7 +4700,7 @@ void pfs_start_file_close_wait_v1(PSI_file_locker *locker, case PSI_FILE_CLOSE: break; default: - DBUG_ASSERT(false); + assert(false); break; } @@ -4716,7 +4716,7 @@ void pfs_start_file_close_wait_v1(PSI_file_locker *locker, void pfs_end_file_close_wait_v1(PSI_file_locker *locker, int rc) { PSI_file_locker_state *state= reinterpret_cast<PSI_file_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); pfs_end_file_wait_v1(locker, 0); @@ -4733,7 +4733,7 @@ void pfs_end_file_close_wait_v1(PSI_file_locker *locker, int rc) { if (file->m_temporary) { - DBUG_ASSERT(file->m_file_stat.m_open_count <= 1); + assert(file->m_file_stat.m_open_count <= 1); destroy_file(thread, file); } else @@ -4749,7 +4749,7 @@ void pfs_end_file_close_wait_v1(PSI_file_locker *locker, int rc) destroy_file(thread, file); break; default: - DBUG_ASSERT(false); + assert(false); break; } } @@ -4764,8 +4764,8 @@ void pfs_end_file_rename_wait_v1(PSI_file_locker *locker, const char *old_name, const char *new_name, int rc) { PSI_file_locker_state *state= reinterpret_cast<PSI_file_locker_state*> (locker); - DBUG_ASSERT(state != NULL); - DBUG_ASSERT(state->m_operation == PSI_FILE_RENAME); + assert(state != NULL); + assert(state->m_operation == PSI_FILE_RENAME); if (rc == 0) { @@ -5164,11 +5164,11 @@ pfs_refine_statement_v1(PSI_statement_locker *locker, PSI_statement_locker_state *state= reinterpret_cast<PSI_statement_locker_state*> (locker); if (state == NULL) return NULL; - DBUG_ASSERT(state->m_class != NULL); + assert(state->m_class != NULL); PFS_statement_class *klass; /* Only refine statements for mutable instrumentation */ klass= reinterpret_cast<PFS_statement_class*> (state->m_class); - DBUG_ASSERT(klass->is_mutable()); + assert(klass->is_mutable()); klass= find_statement_class(key); uint flags= state->m_flags; @@ -5179,7 +5179,7 @@ pfs_refine_statement_v1(PSI_statement_locker *locker, if (flags & STATE_FLAG_THREAD) { PFS_thread *pfs_thread= reinterpret_cast<PFS_thread *> (state->m_thread); - DBUG_ASSERT(pfs_thread != NULL); + assert(pfs_thread != NULL); if (pfs_thread->m_events_statements_count > 0) pfs_thread->m_events_statements_count--; } @@ -5194,7 +5194,7 @@ pfs_refine_statement_v1(PSI_statement_locker *locker, if (flags & STATE_FLAG_EVENT) { PFS_events_statements *pfs= reinterpret_cast<PFS_events_statements*> (state->m_statement); - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); /* mutate EVENTS_STATEMENTS_CURRENT.EVENT_NAME */ pfs->m_event.m_class= klass; @@ -5210,7 +5210,7 @@ void pfs_start_statement_v1(PSI_statement_locker *locker, const char *src_file, uint src_line) { PSI_statement_locker_state *state= reinterpret_cast<PSI_statement_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); uint flags= state->m_flags; ulonglong timer_start= 0; @@ -5222,7 +5222,7 @@ void pfs_start_statement_v1(PSI_statement_locker *locker, } compile_time_assert(PSI_SCHEMA_NAME_LEN == NAME_LEN); - DBUG_ASSERT(db_len <= sizeof(state->m_schema_name)); + assert(db_len <= sizeof(state->m_schema_name)); if (db_len > 0) memcpy(state->m_schema_name, db, db_len); @@ -5231,13 +5231,13 @@ void pfs_start_statement_v1(PSI_statement_locker *locker, if (flags & STATE_FLAG_EVENT) { PFS_events_statements *pfs= reinterpret_cast<PFS_events_statements*> (state->m_statement); - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); pfs->m_event.m_timer_start= timer_start; pfs->m_event.m_source_file= src_file; pfs->m_event.m_source_line= src_line; - DBUG_ASSERT(db_len <= sizeof(pfs->m_current_schema_name)); + assert(db_len <= sizeof(pfs->m_current_schema_name)); if (db_len > 0) memcpy(pfs->m_current_schema_name, db, db_len); pfs->m_current_schema_name_length= db_len; @@ -5248,7 +5248,7 @@ void pfs_set_statement_text_v1(PSI_statement_locker *locker, const char *text, uint text_len) { PSI_statement_locker_state *state= reinterpret_cast<PSI_statement_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); if (state->m_discarded) return; @@ -5256,7 +5256,7 @@ void pfs_set_statement_text_v1(PSI_statement_locker *locker, if (state->m_flags & STATE_FLAG_EVENT) { PFS_events_statements *pfs= reinterpret_cast<PFS_events_statements*> (state->m_statement); - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); if (text_len > pfs_max_sqltext) { text_len= (uint)pfs_max_sqltext; @@ -5283,7 +5283,7 @@ void pfs_set_statement_text_v1(PSI_statement_locker *locker, { \ PFS_events_statements *pfs; \ pfs= reinterpret_cast<PFS_events_statements*> (state->m_statement); \ - DBUG_ASSERT(pfs != NULL); \ + assert(pfs != NULL); \ pfs->ATTR= VALUE; \ } \ return; @@ -5300,7 +5300,7 @@ void pfs_set_statement_text_v1(PSI_statement_locker *locker, { \ PFS_events_statements *pfs; \ pfs= reinterpret_cast<PFS_events_statements*> (state->m_statement); \ - DBUG_ASSERT(pfs != NULL); \ + assert(pfs != NULL); \ pfs->ATTR+= VALUE; \ } \ return; @@ -5403,14 +5403,14 @@ void pfs_end_statement_v1(PSI_statement_locker *locker, void *stmt_da) { PSI_statement_locker_state *state= reinterpret_cast<PSI_statement_locker_state*> (locker); Diagnostics_area *da= reinterpret_cast<Diagnostics_area*> (stmt_da); - DBUG_ASSERT(state != NULL); - DBUG_ASSERT(da != NULL); + assert(state != NULL); + assert(da != NULL); if (state->m_discarded) return; PFS_statement_class *klass= reinterpret_cast<PFS_statement_class *> (state->m_class); - DBUG_ASSERT(klass != NULL); + assert(klass != NULL); ulonglong timer_end= 0; ulonglong wait_time= 0; @@ -5437,7 +5437,7 @@ void pfs_end_statement_v1(PSI_statement_locker *locker, void *stmt_da) if (flags & STATE_FLAG_THREAD) { PFS_thread *thread= reinterpret_cast<PFS_thread *> (state->m_thread); - DBUG_ASSERT(thread != NULL); + assert(thread != NULL); event_name_array= thread->write_instr_class_statements_stats(); /* Aggregate to EVENTS_STATEMENTS_SUMMARY_BY_THREAD_BY_EVENT_NAME */ stat= & event_name_array[index]; @@ -5458,7 +5458,7 @@ void pfs_end_statement_v1(PSI_statement_locker *locker, void *stmt_da) if (flags & STATE_FLAG_EVENT) { PFS_events_statements *pfs= reinterpret_cast<PFS_events_statements*> (state->m_statement); - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); pfs_dirty_state dirty_state; thread->m_stmt_lock.allocated_to_dirty(& dirty_state); @@ -5514,7 +5514,7 @@ void pfs_end_statement_v1(PSI_statement_locker *locker, void *stmt_da) if (thread->m_flag_events_statements_history_long) insert_events_statements_history_long(pfs); - DBUG_ASSERT(thread->m_events_statements_count > 0); + assert(thread->m_events_statements_count > 0); thread->m_events_statements_count--; thread->m_stmt_lock.dirty_to_allocated(& dirty_state); } @@ -5783,7 +5783,7 @@ static inline enum_object_type sp_type_to_object_type(uint sp_type) case SP_TYPE_EVENT: return OBJECT_TYPE_EVENT; default: - DBUG_ASSERT(false); + assert(false); /* Dead code */ return NO_OBJECT_TYPE; } @@ -5829,7 +5829,7 @@ void pfs_release_sp_share_v1(PSI_sp_share* sp_share) PSI_sp_locker* pfs_start_sp_v1(PSI_sp_locker_state *state, PSI_sp_share *sp_share) { - DBUG_ASSERT(state != NULL); + assert(state != NULL); if (! flag_global_instrumentation) return NULL; @@ -5867,7 +5867,7 @@ PSI_sp_locker* pfs_start_sp_v1(PSI_sp_locker_state *state, void pfs_end_sp_v1(PSI_sp_locker *locker) { PSI_sp_locker_state *state= reinterpret_cast<PSI_sp_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); ulonglong timer_end; ulonglong wait_time; @@ -5918,7 +5918,7 @@ pfs_get_thread_transaction_locker_v1(PSI_transaction_locker_state *state, my_bool read_only, my_bool autocommit) { - DBUG_ASSERT(state != NULL); + assert(state != NULL); if (!flag_global_instrumentation) return NULL; @@ -6006,7 +6006,7 @@ void pfs_start_transaction_v1(PSI_transaction_locker *locker, const char *src_file, uint src_line) { PSI_transaction_locker_state *state= reinterpret_cast<PSI_transaction_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); uint flags= state->m_flags; ulonglong timer_start= 0; @@ -6020,7 +6020,7 @@ void pfs_start_transaction_v1(PSI_transaction_locker *locker, if (flags & STATE_FLAG_EVENT) { PFS_events_transactions *pfs= reinterpret_cast<PFS_events_transactions*> (state->m_transaction); - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); pfs->m_timer_start= timer_start; pfs->m_source_file= src_file; @@ -6036,9 +6036,9 @@ void pfs_set_transaction_gtid_v1(PSI_transaction_locker *locker, const void *gtid_spec) { PSI_transaction_locker_state *state= reinterpret_cast<PSI_transaction_locker_state*> (locker); - DBUG_ASSERT(state != NULL); - DBUG_ASSERT(sid != NULL); - DBUG_ASSERT(gtid_spec != NULL); + assert(state != NULL); + assert(sid != NULL); + assert(gtid_spec != NULL); if (state->m_flags & STATE_FLAG_EVENT) { @@ -6054,13 +6054,13 @@ void pfs_set_transaction_xid_v1(PSI_transaction_locker *locker, int xa_state) { PSI_transaction_locker_state *state= reinterpret_cast<PSI_transaction_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); if (state->m_flags & STATE_FLAG_EVENT) { PFS_events_transactions *pfs= reinterpret_cast<PFS_events_transactions*> (state->m_transaction); - DBUG_ASSERT(pfs != NULL); - DBUG_ASSERT(xid != NULL); + assert(pfs != NULL); + assert(xid != NULL); pfs->m_xid= *(PSI_xid *)xid; pfs->m_xa_state= (enum_xa_transaction_state)xa_state; @@ -6073,12 +6073,12 @@ void pfs_set_transaction_xa_state_v1(PSI_transaction_locker *locker, int xa_state) { PSI_transaction_locker_state *state= reinterpret_cast<PSI_transaction_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); if (state->m_flags & STATE_FLAG_EVENT) { PFS_events_transactions *pfs= reinterpret_cast<PFS_events_transactions*> (state->m_transaction); - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); pfs->m_xa_state= (enum_xa_transaction_state)xa_state; pfs->m_xa= true; @@ -6089,15 +6089,15 @@ void pfs_set_transaction_xa_state_v1(PSI_transaction_locker *locker, void pfs_set_transaction_trxid_v1(PSI_transaction_locker *locker, const ulonglong *trxid) { - DBUG_ASSERT(trxid != NULL); + assert(trxid != NULL); PSI_transaction_locker_state *state= reinterpret_cast<PSI_transaction_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); if (state->m_flags & STATE_FLAG_EVENT) { PFS_events_transactions *pfs= reinterpret_cast<PFS_events_transactions*> (state->m_transaction); - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); if (pfs->m_trxid == 0) pfs->m_trxid= *trxid; @@ -6114,7 +6114,7 @@ void pfs_set_transaction_trxid_v1(PSI_transaction_locker *locker, { \ PFS_events_transactions *pfs; \ pfs= reinterpret_cast<PFS_events_transactions*> (state->m_transaction); \ - DBUG_ASSERT(pfs != NULL); \ + assert(pfs != NULL); \ pfs->ATTR+= VALUE; \ } \ return; @@ -6141,7 +6141,7 @@ void pfs_inc_transaction_release_savepoint_v1(PSI_transaction_locker *locker, void pfs_end_transaction_v1(PSI_transaction_locker *locker, my_bool commit) { PSI_transaction_locker_state *state= reinterpret_cast<PSI_transaction_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); ulonglong timer_end= 0; ulonglong wait_time= 0; @@ -6158,7 +6158,7 @@ void pfs_end_transaction_v1(PSI_transaction_locker *locker, my_bool commit) if (flags & STATE_FLAG_THREAD) { PFS_thread *pfs_thread= reinterpret_cast<PFS_thread *> (state->m_thread); - DBUG_ASSERT(pfs_thread != NULL); + assert(pfs_thread != NULL); /* Aggregate to EVENTS_TRANSACTIONS_SUMMARY_BY_THREAD_BY_EVENT_NAME */ stat= &pfs_thread->write_instr_class_transactions_stats()[GLOBAL_TRANSACTION_INDEX]; @@ -6166,7 +6166,7 @@ void pfs_end_transaction_v1(PSI_transaction_locker *locker, my_bool commit) if (flags & STATE_FLAG_EVENT) { PFS_events_transactions *pfs= reinterpret_cast<PFS_events_transactions*> (state->m_transaction); - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); /* events_transactions_current may have been cleared while the transaction was active */ if (unlikely(pfs->m_class == NULL)) @@ -6222,10 +6222,10 @@ void pfs_end_transaction_v1(PSI_transaction_locker *locker, my_bool commit) void pfs_end_socket_wait_v1(PSI_socket_locker *locker, size_t byte_count) { PSI_socket_locker_state *state= reinterpret_cast<PSI_socket_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); PFS_socket *socket= reinterpret_cast<PFS_socket *>(state->m_socket); - DBUG_ASSERT(socket != NULL); + assert(socket != NULL); ulonglong timer_end= 0; ulonglong wait_time= 0; @@ -6260,7 +6260,7 @@ void pfs_end_socket_wait_v1(PSI_socket_locker *locker, size_t byte_count) byte_stat= &socket->m_socket_stat.m_io_stat.m_misc; break; default: - DBUG_ASSERT(false); + assert(false); byte_stat= NULL; break; } @@ -6284,9 +6284,9 @@ void pfs_end_socket_wait_v1(PSI_socket_locker *locker, size_t byte_count) if (flags & STATE_FLAG_EVENT) { PFS_thread *thread= reinterpret_cast<PFS_thread *>(state->m_thread); - DBUG_ASSERT(thread != NULL); + assert(thread != NULL); PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait); - DBUG_ASSERT(wait != NULL); + assert(wait != NULL); wait->m_timer_end= timer_end; wait->m_end_event_id= thread->m_event_id; @@ -6298,17 +6298,17 @@ void pfs_end_socket_wait_v1(PSI_socket_locker *locker, size_t byte_count) insert_events_waits_history_long(wait); thread->m_events_waits_current--; - DBUG_ASSERT(wait == thread->m_events_waits_current); + assert(wait == thread->m_events_waits_current); } } void pfs_set_socket_state_v1(PSI_socket *socket, PSI_socket_state state) { - DBUG_ASSERT((state == PSI_SOCKET_STATE_IDLE) || (state == PSI_SOCKET_STATE_ACTIVE)); + assert((state == PSI_SOCKET_STATE_IDLE) || (state == PSI_SOCKET_STATE_ACTIVE)); PFS_socket *pfs= reinterpret_cast<PFS_socket*>(socket); - DBUG_ASSERT(pfs != NULL); - DBUG_ASSERT(pfs->m_idle || (state == PSI_SOCKET_STATE_IDLE)); - DBUG_ASSERT(!pfs->m_idle || (state == PSI_SOCKET_STATE_ACTIVE)); + assert(pfs != NULL); + assert(pfs->m_idle || (state == PSI_SOCKET_STATE_IDLE)); + assert(!pfs->m_idle || (state == PSI_SOCKET_STATE_ACTIVE)); pfs->m_idle= (state == PSI_SOCKET_STATE_IDLE); } @@ -6321,7 +6321,7 @@ void pfs_set_socket_info_v1(PSI_socket *socket, socklen_t addr_len) { PFS_socket *pfs= reinterpret_cast<PFS_socket*>(socket); - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); /** Set socket descriptor */ if (fd != NULL) @@ -6347,7 +6347,7 @@ void pfs_set_socket_info_v1(PSI_socket *socket, void pfs_set_socket_thread_owner_v1(PSI_socket *socket) { PFS_socket *pfs_socket= reinterpret_cast<PFS_socket*>(socket); - DBUG_ASSERT(pfs_socket != NULL); + assert(pfs_socket != NULL); pfs_socket->m_thread_owner= my_thread_get_THR_PFS(); } @@ -6356,7 +6356,7 @@ pfs_digest_start_v1(PSI_statement_locker *locker) { PSI_statement_locker_state *statement_state; statement_state= reinterpret_cast<PSI_statement_locker_state*> (locker); - DBUG_ASSERT(statement_state != NULL); + assert(statement_state != NULL); if (statement_state->m_discarded) return NULL; @@ -6373,8 +6373,8 @@ void pfs_digest_end_v1(PSI_digest_locker *locker, const sql_digest_storage *dige { PSI_statement_locker_state *statement_state; statement_state= reinterpret_cast<PSI_statement_locker_state*> (locker); - DBUG_ASSERT(statement_state != NULL); - DBUG_ASSERT(digest != NULL); + assert(statement_state != NULL); + assert(digest != NULL); if (statement_state->m_discarded) return; @@ -6413,7 +6413,7 @@ void pfs_execute_prepared_stmt_v1 (PSI_statement_locker *locker, PSI_prepared_stmt* ps) { PSI_statement_locker_state *state= reinterpret_cast<PSI_statement_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); state->m_parent_prepared_stmt= ps; state->m_in_prepare= false; @@ -6445,7 +6445,7 @@ int pfs_set_thread_connect_attrs_v1(const char *buffer, uint length, { PFS_thread *thd= my_thread_get_THR_PFS(); - DBUG_ASSERT(buffer != NULL); + assert(buffer != NULL); if (likely(thd != NULL) && session_connect_attrs_size_per_thread > 0) { @@ -6482,7 +6482,7 @@ void pfs_register_memory_v1(const char *category, PSI_memory_key pfs_memory_alloc_v1(PSI_memory_key key, size_t size, PSI_thread **owner) { PFS_thread ** owner_thread= reinterpret_cast<PFS_thread**>(owner); - DBUG_ASSERT(owner_thread != NULL); + assert(owner_thread != NULL); if (! flag_global_instrumentation) { @@ -6552,7 +6552,7 @@ PSI_memory_key pfs_memory_alloc_v1(PSI_memory_key key, size_t size, PSI_thread * PSI_memory_key pfs_memory_realloc_v1(PSI_memory_key key, size_t old_size, size_t new_size, PSI_thread **owner) { PFS_thread ** owner_thread_hdl= reinterpret_cast<PFS_thread**>(owner); - DBUG_ASSERT(owner != NULL); + assert(owner != NULL); PFS_memory_class *klass= find_memory_class(key); if (klass == NULL) @@ -6630,7 +6630,7 @@ PSI_memory_key pfs_memory_realloc_v1(PSI_memory_key key, size_t old_size, size_t PSI_memory_key pfs_memory_claim_v1(PSI_memory_key key, size_t size, PSI_thread **owner) { PFS_thread ** owner_thread= reinterpret_cast<PFS_thread**>(owner); - DBUG_ASSERT(owner_thread != NULL); + assert(owner_thread != NULL); PFS_memory_class *klass= find_memory_class(key); if (klass == NULL) @@ -6762,7 +6762,7 @@ void pfs_unlock_table_v1(PSI_table *table) { PFS_table *pfs_table= reinterpret_cast<PFS_table*> (table); - DBUG_ASSERT(pfs_table != NULL); + assert(pfs_table != NULL); pfs_table->m_internal_lock= PFS_TL_NONE; return; @@ -6806,7 +6806,7 @@ void pfs_set_metadata_lock_status_v1(PSI_metadata_lock *lock, opaque_mdl_status mdl_status) { PFS_metadata_lock *pfs= reinterpret_cast<PFS_metadata_lock*> (lock); - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); pfs->m_mdl_status= mdl_status; } @@ -6814,7 +6814,7 @@ void pfs_destroy_metadata_lock_v1(PSI_metadata_lock *lock) { PFS_metadata_lock *pfs= reinterpret_cast<PFS_metadata_lock*> (lock); - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); destroy_metadata_lock(pfs); } @@ -6825,8 +6825,8 @@ pfs_start_metadata_wait_v1(PSI_metadata_locker_state *state, uint src_line) { PFS_metadata_lock *pfs_lock= reinterpret_cast<PFS_metadata_lock*> (lock); - DBUG_ASSERT(state != NULL); - DBUG_ASSERT(pfs_lock != NULL); + assert(state != NULL); + assert(pfs_lock != NULL); if (! pfs_lock->m_enabled) return NULL; @@ -6915,7 +6915,7 @@ pfs_end_metadata_wait_v1(PSI_metadata_locker *locker, int rc) { PSI_metadata_locker_state *state= reinterpret_cast<PSI_metadata_locker_state*> (locker); - DBUG_ASSERT(state != NULL); + assert(state != NULL); ulonglong timer_end= 0; ulonglong wait_time= 0; @@ -6949,7 +6949,7 @@ pfs_end_metadata_wait_v1(PSI_metadata_locker *locker, if (flags & STATE_FLAG_EVENT) { PFS_events_waits *wait= reinterpret_cast<PFS_events_waits*> (state->m_wait); - DBUG_ASSERT(wait != NULL); + assert(wait != NULL); wait->m_timer_end= timer_end; wait->m_end_event_id= thread->m_event_id; @@ -6959,7 +6959,7 @@ pfs_end_metadata_wait_v1(PSI_metadata_locker *locker, insert_events_waits_history_long(wait); thread->m_events_waits_current--; - DBUG_ASSERT(wait == thread->m_events_waits_current); + assert(wait == thread->m_events_waits_current); } } else diff --git a/storage/perfschema/pfs.h b/storage/perfschema/pfs.h index 69b23be4206..3525f27724f 100644 --- a/storage/perfschema/pfs.h +++ b/storage/perfschema/pfs.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_account.cc b/storage/perfschema/pfs_account.cc index b6090d064c9..abf31a6bc55 100644 --- a/storage/perfschema/pfs_account.cc +++ b/storage/perfschema/pfs_account.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -74,9 +74,9 @@ static uchar *account_hash_get_key(const uchar *entry, size_t *length, const PFS_account *account; const void *result; typed_entry= reinterpret_cast<const PFS_account* const *> (entry); - DBUG_ASSERT(typed_entry != NULL); + assert(typed_entry != NULL); account= *typed_entry; - DBUG_ASSERT(account != NULL); + assert(account != NULL); *length= account->m_key.m_key_length; result= account->m_key.m_hash_key; return const_cast<uchar*> (reinterpret_cast<const uchar*> (result)); @@ -123,8 +123,8 @@ static void set_account_key(PFS_account_key *key, const char *user, uint user_length, const char *host, uint host_length) { - DBUG_ASSERT(user_length <= USERNAME_LENGTH); - DBUG_ASSERT(host_length <= HOSTNAME_LENGTH); + assert(user_length <= USERNAME_LENGTH); + assert(host_length <= HOSTNAME_LENGTH); char *ptr= &key->m_hash_key[0]; if (user_length > 0) @@ -653,7 +653,7 @@ void purge_account(PFS_thread *thread, PFS_account *account) account->m_key.m_key_length)); if (entry && (entry != MY_ERRPTR)) { - DBUG_ASSERT(*entry == account); + assert(*entry == account); if (account->get_refcount() == 0) { lf_hash_delete(&account_hash, pins, diff --git a/storage/perfschema/pfs_account.h b/storage/perfschema/pfs_account.h index 8a966f4c4a9..c98ff5d2740 100644 --- a/storage/perfschema/pfs_account.h +++ b/storage/perfschema/pfs_account.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_atomic.h b/storage/perfschema/pfs_atomic.h index 959b66dccb2..52c96527c3f 100644 --- a/storage/perfschema/pfs_atomic.h +++ b/storage/perfschema/pfs_atomic.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2009, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_autosize.cc b/storage/perfschema/pfs_autosize.cc index 024f5519c0e..65d0458220a 100644 --- a/storage/perfschema/pfs_autosize.cc +++ b/storage/perfschema/pfs_autosize.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2012, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -253,15 +253,15 @@ void pfs_automated_sizing(PFS_global_param *param) heuristic= estimate_hints(param); apply_heuristic(param, heuristic); - DBUG_ASSERT(param->m_events_waits_history_sizing >= 0); - DBUG_ASSERT(param->m_events_waits_history_long_sizing >= 0); - DBUG_ASSERT(param->m_events_stages_history_sizing >= 0); - DBUG_ASSERT(param->m_events_stages_history_long_sizing >= 0); - DBUG_ASSERT(param->m_events_statements_history_sizing >= 0); - DBUG_ASSERT(param->m_events_statements_history_long_sizing >= 0); - DBUG_ASSERT(param->m_events_transactions_history_sizing >= 0); - DBUG_ASSERT(param->m_events_transactions_history_long_sizing >= 0); - DBUG_ASSERT(param->m_session_connect_attrs_sizing >= 0); + assert(param->m_events_waits_history_sizing >= 0); + assert(param->m_events_waits_history_long_sizing >= 0); + assert(param->m_events_stages_history_sizing >= 0); + assert(param->m_events_stages_history_long_sizing >= 0); + assert(param->m_events_statements_history_sizing >= 0); + assert(param->m_events_statements_history_long_sizing >= 0); + assert(param->m_events_transactions_history_sizing >= 0); + assert(param->m_events_transactions_history_long_sizing >= 0); + assert(param->m_session_connect_attrs_sizing >= 0); } else { diff --git a/storage/perfschema/pfs_buffer_container.cc b/storage/perfschema/pfs_buffer_container.cc index cd87cb247e2..7d1d74541d1 100644 --- a/storage/perfschema/pfs_buffer_container.cc +++ b/storage/perfschema/pfs_buffer_container.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2014, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_buffer_container.h b/storage/perfschema/pfs_buffer_container.h index 141cbdf2999..5baed2f872c 100644 --- a/storage/perfschema/pfs_buffer_container.h +++ b/storage/perfschema/pfs_buffer_container.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2014, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -159,7 +159,7 @@ public: void free_array(array_type *array) { - DBUG_ASSERT(array->m_max > 0); + assert(array->m_max > 0); PFS_FREE_ARRAY(m_builtin_class, array->m_max, sizeof(T), array->m_ptr); @@ -259,7 +259,7 @@ public: iterator_type iterate(uint index) { - DBUG_ASSERT(index <= m_max); + assert(index <= m_max); return PFS_buffer_iterator<T, U, V>(this, index); } @@ -319,7 +319,7 @@ public: inline value_type* get(uint index) { - DBUG_ASSERT(index < m_max); + assert(index < m_max); value_type *pfs= m_array.m_ptr + index; if (pfs->m_lock.is_populated()) @@ -364,7 +364,7 @@ public: private: value_type* scan_next(uint & index, uint * found_index) { - DBUG_ASSERT(index <= m_max); + assert(index <= m_max); value_type *pfs_first= m_array.get_first(); value_type *pfs= pfs_first + index; @@ -480,9 +480,9 @@ public: m_full= false; } - DBUG_ASSERT(m_max_page_count <= PFS_PAGE_COUNT); - DBUG_ASSERT(0 < m_last_page_size); - DBUG_ASSERT(m_last_page_size <= PFS_PAGE_SIZE); + assert(m_max_page_count <= PFS_PAGE_COUNT); + assert(0 < m_last_page_size); + assert(m_last_page_size <= PFS_PAGE_SIZE); pthread_mutex_init(& m_critical_section, NULL); return 0; @@ -693,7 +693,7 @@ public: // ================================================================== } - DBUG_ASSERT(array != NULL); + assert(array != NULL); pfs= array->allocate(dirty_state); if (pfs != NULL) { @@ -754,7 +754,7 @@ public: iterator_type iterate(uint index) { - DBUG_ASSERT(index <= m_max); + assert(index <= m_max); return PFS_buffer_scalable_iterator<T, PFS_PAGE_SIZE, PFS_PAGE_COUNT, U, V>(this, index); } @@ -862,7 +862,7 @@ public: value_type* get(uint index) { - DBUG_ASSERT(index < m_max); + assert(index < m_max); uint index_1= index / PFS_PAGE_SIZE; array_type *page= m_pages[index_1]; @@ -959,13 +959,13 @@ private: { if (page_index + 1 < m_max_page_count) return PFS_PAGE_SIZE; - DBUG_ASSERT(page_index + 1 == m_max_page_count); + assert(page_index + 1 == m_max_page_count); return m_last_page_size; } value_type* scan_next(uint & index, uint * found_index) { - DBUG_ASSERT(index <= m_max); + assert(index <= m_max); uint index_1= index / PFS_PAGE_SIZE; uint index_2= index % PFS_PAGE_SIZE; @@ -1180,7 +1180,7 @@ public: value_type *allocate(pfs_dirty_state *dirty_state, uint partition) { - DBUG_ASSERT(partition < PFS_PARTITION_COUNT); + assert(partition < PFS_PARTITION_COUNT); return m_partitions[partition]->allocate(dirty_state); } @@ -1309,7 +1309,7 @@ private: value_type* scan_next(uint & partition_index, uint & sub_index, uint * found_partition, uint * found_sub_index) { value_type *record= NULL; - DBUG_ASSERT(partition_index < PFS_PARTITION_COUNT); + assert(partition_index < PFS_PARTITION_COUNT); while (partition_index < PFS_PARTITION_COUNT) { diff --git a/storage/perfschema/pfs_builtin_memory.cc b/storage/perfschema/pfs_builtin_memory.cc index 676a9094976..354de87f05f 100644 --- a/storage/perfschema/pfs_builtin_memory.cc +++ b/storage/perfschema/pfs_builtin_memory.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2014, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_builtin_memory.h b/storage/perfschema/pfs_builtin_memory.h index 1c00275d5b9..2c9da9dd4a0 100644 --- a/storage/perfschema/pfs_builtin_memory.h +++ b/storage/perfschema/pfs_builtin_memory.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2014, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_column_types.h b/storage/perfschema/pfs_column_types.h index e4577fdb22e..146c9c8054e 100644 --- a/storage/perfschema/pfs_column_types.h +++ b/storage/perfschema/pfs_column_types.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_column_values.cc b/storage/perfschema/pfs_column_values.cc index 9ce9b3b416d..02c939d4274 100644 --- a/storage/perfschema/pfs_column_values.cc +++ b/storage/perfschema/pfs_column_values.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_column_values.h b/storage/perfschema/pfs_column_values.h index ea3d9eb97c3..b06f7a0130b 100644 --- a/storage/perfschema/pfs_column_values.h +++ b/storage/perfschema/pfs_column_values.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_con_slice.cc b/storage/perfschema/pfs_con_slice.cc index 3733ad9e3d0..eaa65d524ba 100644 --- a/storage/perfschema/pfs_con_slice.cc +++ b/storage/perfschema/pfs_con_slice.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_con_slice.h b/storage/perfschema/pfs_con_slice.h index 56497ffe771..f28c40f884c 100644 --- a/storage/perfschema/pfs_con_slice.h +++ b/storage/perfschema/pfs_con_slice.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_defaults.cc b/storage/perfschema/pfs_defaults.cc index 0b615773089..522beb890eb 100644 --- a/storage/perfschema/pfs_defaults.cc +++ b/storage/perfschema/pfs_defaults.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_defaults.h b/storage/perfschema/pfs_defaults.h index 7751b55b83b..34ac1b0955a 100644 --- a/storage/perfschema/pfs_defaults.h +++ b/storage/perfschema/pfs_defaults.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_digest.cc b/storage/perfschema/pfs_digest.cc index 6f0b93f9393..43375c753dd 100644 --- a/storage/perfschema/pfs_digest.cc +++ b/storage/perfschema/pfs_digest.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -152,9 +152,9 @@ static uchar *digest_hash_get_key(const uchar *entry, size_t *length, const PFS_statements_digest_stat *digest; const void *result; typed_entry= reinterpret_cast<const PFS_statements_digest_stat*const*>(entry); - DBUG_ASSERT(typed_entry != NULL); + assert(typed_entry != NULL); digest= *typed_entry; - DBUG_ASSERT(digest != NULL); + assert(digest != NULL); *length= sizeof (PFS_digest_key); result= & digest->m_digest_key; return const_cast<uchar*> (reinterpret_cast<const uchar*> (result)); @@ -204,7 +204,7 @@ find_or_create_digest(PFS_thread *thread, const char *schema_name, uint schema_name_length) { - DBUG_ASSERT(digest_storage != NULL); + assert(digest_storage != NULL); if (statements_digest_stat_array == NULL) return NULL; @@ -282,7 +282,7 @@ search: } /* Add a new record in digest stat array. */ - DBUG_ASSERT(safe_index < digest_max); + assert(safe_index < digest_max); pfs= &statements_digest_stat_array[safe_index]; if (pfs->m_lock.is_free()) diff --git a/storage/perfschema/pfs_digest.h b/storage/perfschema/pfs_digest.h index 39fe6109c20..e99bdfebf57 100644 --- a/storage/perfschema/pfs_digest.h +++ b/storage/perfschema/pfs_digest.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_engine_table.cc b/storage/perfschema/pfs_engine_table.cc index 283ca28100b..6b9c6a7e066 100644 --- a/storage/perfschema/pfs_engine_table.cc +++ b/storage/perfschema/pfs_engine_table.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -146,13 +146,13 @@ bool PFS_table_context::initialize(void) { /* Restore context from TLS. */ PFS_table_context *context= static_cast<PFS_table_context *>(my_get_thread_local(m_thr_key)); - DBUG_ASSERT(context != NULL); + assert(context != NULL); if(context) { m_last_version= context->m_current_version; m_map= context->m_map; - DBUG_ASSERT(m_map_size == context->m_map_size); + assert(m_map_size == context->m_map_size); m_map_size= context->m_map_size; } } @@ -160,7 +160,7 @@ bool PFS_table_context::initialize(void) { /* Check that TLS is not in use. */ PFS_table_context *context= static_cast<PFS_table_context *>(my_get_thread_local(m_thr_key)); - //DBUG_ASSERT(context == NULL); + //assert(context == NULL); context= this; @@ -525,28 +525,28 @@ void PFS_engine_table::get_normalizer(PFS_instr_class *instr_class) void PFS_engine_table::set_field_long(Field *f, long value) { - DBUG_ASSERT(f->real_type() == MYSQL_TYPE_LONG); + assert(f->real_type() == MYSQL_TYPE_LONG); Field_long *f2= (Field_long*) f; f2->store(value, false); } void PFS_engine_table::set_field_ulong(Field *f, ulong value) { - DBUG_ASSERT(f->real_type() == MYSQL_TYPE_LONG); + assert(f->real_type() == MYSQL_TYPE_LONG); Field_long *f2= (Field_long*) f; f2->store(value, true); } void PFS_engine_table::set_field_longlong(Field *f, longlong value) { - DBUG_ASSERT(f->real_type() == MYSQL_TYPE_LONGLONG); + assert(f->real_type() == MYSQL_TYPE_LONGLONG); Field_longlong *f2= (Field_longlong*) f; f2->store(value, false); } void PFS_engine_table::set_field_ulonglong(Field *f, ulonglong value) { - DBUG_ASSERT(f->real_type() == MYSQL_TYPE_LONGLONG); + assert(f->real_type() == MYSQL_TYPE_LONGLONG); Field_longlong *f2= (Field_longlong*) f; f2->store(value, true); } @@ -554,7 +554,7 @@ void PFS_engine_table::set_field_ulonglong(Field *f, ulonglong value) void PFS_engine_table::set_field_char_utf8(Field *f, const char* str, uint len) { - DBUG_ASSERT(f->real_type() == MYSQL_TYPE_STRING); + assert(f->real_type() == MYSQL_TYPE_STRING); Field_string *f2= (Field_string*) f; f2->store(str, len, &my_charset_utf8mb3_bin); } @@ -564,7 +564,7 @@ void PFS_engine_table::set_field_varchar(Field *f, const char* str, uint len) { - DBUG_ASSERT(f->real_type() == MYSQL_TYPE_VARCHAR); + assert(f->real_type() == MYSQL_TYPE_VARCHAR); Field_varstring *f2= (Field_varstring*) f; f2->store(str, len, cs); } @@ -572,7 +572,7 @@ void PFS_engine_table::set_field_varchar(Field *f, void PFS_engine_table::set_field_varchar_utf8(Field *f, const char* str, uint len) { - DBUG_ASSERT(f->real_type() == MYSQL_TYPE_VARCHAR); + assert(f->real_type() == MYSQL_TYPE_VARCHAR); Field_varstring *f2= (Field_varstring*) f; f2->store(str, len, &my_charset_utf8mb3_bin); } @@ -580,7 +580,7 @@ void PFS_engine_table::set_field_varchar_utf8(Field *f, const char* str, void PFS_engine_table::set_field_longtext_utf8(Field *f, const char* str, uint len) { - DBUG_ASSERT(f->real_type() == MYSQL_TYPE_BLOB); + assert(f->real_type() == MYSQL_TYPE_BLOB); Field_blob *f2= (Field_blob*) f; f2->store(str, len, &my_charset_utf8mb3_bin); } @@ -588,14 +588,14 @@ void PFS_engine_table::set_field_longtext_utf8(Field *f, const char* str, void PFS_engine_table::set_field_blob(Field *f, const char* val, uint len) { - DBUG_ASSERT(f->real_type() == MYSQL_TYPE_BLOB); + assert(f->real_type() == MYSQL_TYPE_BLOB); Field_blob *f2= (Field_blob*) f; f2->store(val, len, &my_charset_utf8mb3_bin); } void PFS_engine_table::set_field_enum(Field *f, ulonglong value) { - DBUG_ASSERT(f->real_type() == MYSQL_TYPE_ENUM); + assert(f->real_type() == MYSQL_TYPE_ENUM); Field_enum *f2= (Field_enum*) f; f2->store_type(value); } @@ -609,14 +609,14 @@ void PFS_engine_table::set_field_timestamp(Field *f, ulonglong value) void PFS_engine_table::set_field_double(Field *f, double value) { - DBUG_ASSERT(f->real_type() == MYSQL_TYPE_DOUBLE); + assert(f->real_type() == MYSQL_TYPE_DOUBLE); Field_double *f2= (Field_double*) f; f2->store(value); } ulonglong PFS_engine_table::get_field_enum(Field *f) { - DBUG_ASSERT(f->real_type() == MYSQL_TYPE_ENUM); + assert(f->real_type() == MYSQL_TYPE_ENUM); Field_enum *f2= (Field_enum*) f; return f2->val_int(); } @@ -624,7 +624,7 @@ ulonglong PFS_engine_table::get_field_enum(Field *f) String* PFS_engine_table::get_field_char_utf8(Field *f, String *val) { - DBUG_ASSERT(f->real_type() == MYSQL_TYPE_STRING); + assert(f->real_type() == MYSQL_TYPE_STRING); Field_string *f2= (Field_string*) f; val= f2->val_str(NULL, val); return val; @@ -633,7 +633,7 @@ PFS_engine_table::get_field_char_utf8(Field *f, String *val) String* PFS_engine_table::get_field_varchar_utf8(Field *f, String *val) { - DBUG_ASSERT(f->real_type() == MYSQL_TYPE_VARCHAR); + assert(f->real_type() == MYSQL_TYPE_VARCHAR); Field_varstring *f2= (Field_varstring*) f; val= f2->val_str(NULL, val); return val; @@ -729,7 +729,7 @@ static bool allow_drop_table_privilege() { return false; } - DBUG_ASSERT(thd->lex != NULL); + assert(thd->lex != NULL); if ((thd->lex->sql_command != SQLCOM_TRUNCATE) && (thd->lex->sql_command != SQLCOM_GRANT)) { return false; diff --git a/storage/perfschema/pfs_engine_table.h b/storage/perfschema/pfs_engine_table.h index 883ff07c36c..925a2186a92 100644 --- a/storage/perfschema/pfs_engine_table.h +++ b/storage/perfschema/pfs_engine_table.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_events.h b/storage/perfschema/pfs_events.h index 6d4a28936ff..fbe65d6ebad 100644 --- a/storage/perfschema/pfs_events.h +++ b/storage/perfschema/pfs_events.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_events_stages.cc b/storage/perfschema/pfs_events_stages.cc index e5a6b9a2007..087e5a1c55f 100644 --- a/storage/perfschema/pfs_events_stages.cc +++ b/storage/perfschema/pfs_events_stages.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -101,7 +101,7 @@ void insert_events_stages_history(PFS_thread *thread, PFS_events_stages *stage) if (unlikely(events_stages_history_per_thread == 0)) return; - DBUG_ASSERT(thread->m_stages_history != NULL); + assert(thread->m_stages_history != NULL); uint index= thread->m_stages_history_index; @@ -133,7 +133,7 @@ void insert_events_stages_history_long(PFS_events_stages *stage) if (unlikely(events_stages_history_long_size == 0)) return; - DBUG_ASSERT(events_stages_history_long_array != NULL); + assert(events_stages_history_long_array != NULL); uint index= PFS_atomic::add_u32(&events_stages_history_long_index.m_u32, 1); diff --git a/storage/perfschema/pfs_events_stages.h b/storage/perfschema/pfs_events_stages.h index 0b7d27ded82..eeae350ddf4 100644 --- a/storage/perfschema/pfs_events_stages.h +++ b/storage/perfschema/pfs_events_stages.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_events_statements.cc b/storage/perfschema/pfs_events_statements.cc index 7c1ac8b1d5b..37b179e8924 100644 --- a/storage/perfschema/pfs_events_statements.cc +++ b/storage/perfschema/pfs_events_statements.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -179,7 +179,7 @@ void insert_events_statements_history(PFS_thread *thread, PFS_events_statements if (unlikely(events_statements_history_per_thread == 0)) return; - DBUG_ASSERT(thread->m_statements_history != NULL); + assert(thread->m_statements_history != NULL); uint index= thread->m_statements_history_index; @@ -211,7 +211,7 @@ void insert_events_statements_history_long(PFS_events_statements *statement) if (unlikely(events_statements_history_long_size == 0)) return ; - DBUG_ASSERT(events_statements_history_long_array != NULL); + assert(events_statements_history_long_array != NULL); uint index= PFS_atomic::add_u32(&events_statements_history_long_index.m_u32, 1); diff --git a/storage/perfschema/pfs_events_statements.h b/storage/perfschema/pfs_events_statements.h index a21e1c4980c..2b2426ef7d1 100644 --- a/storage/perfschema/pfs_events_statements.h +++ b/storage/perfschema/pfs_events_statements.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_events_transactions.cc b/storage/perfschema/pfs_events_transactions.cc index 884234913e8..8b83b71c96b 100644 --- a/storage/perfschema/pfs_events_transactions.cc +++ b/storage/perfschema/pfs_events_transactions.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -101,7 +101,7 @@ void insert_events_transactions_history(PFS_thread *thread, PFS_events_transacti if (unlikely(events_transactions_history_per_thread == 0)) return; - DBUG_ASSERT(thread->m_transactions_history != NULL); + assert(thread->m_transactions_history != NULL); uint index= thread->m_transactions_history_index; @@ -133,7 +133,7 @@ void insert_events_transactions_history_long(PFS_events_transactions *transactio if (unlikely(events_transactions_history_long_size == 0)) return ; - DBUG_ASSERT(events_transactions_history_long_array != NULL); + assert(events_transactions_history_long_array != NULL); uint index= PFS_atomic::add_u32(&events_transactions_history_long_index.m_u32, 1); @@ -252,7 +252,7 @@ bool xid_printable(PSI_xid *xid, size_t offset, size_t length) if (xid->is_null()) return false; - DBUG_ASSERT(offset + length <= MYSQL_XIDDATASIZE); + assert(offset + length <= MYSQL_XIDDATASIZE); unsigned char *c= (unsigned char*)&xid->data + offset; diff --git a/storage/perfschema/pfs_events_transactions.h b/storage/perfschema/pfs_events_transactions.h index dc4fd8b0b60..57e57e70210 100644 --- a/storage/perfschema/pfs_events_transactions.h +++ b/storage/perfschema/pfs_events_transactions.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_events_waits.cc b/storage/perfschema/pfs_events_waits.cc index b51ee5fd2c8..14f6d743764 100644 --- a/storage/perfschema/pfs_events_waits.cc +++ b/storage/perfschema/pfs_events_waits.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_events_waits.h b/storage/perfschema/pfs_events_waits.h index 87e43459d00..8a7355f2d32 100644 --- a/storage/perfschema/pfs_events_waits.h +++ b/storage/perfschema/pfs_events_waits.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.. Copyright (c) 2017, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify diff --git a/storage/perfschema/pfs_global.cc b/storage/perfschema/pfs_global.cc index 26cb693d441..1f9d24eea4e 100644 --- a/storage/perfschema/pfs_global.cc +++ b/storage/perfschema/pfs_global.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify @@ -59,8 +59,8 @@ bool pfs_initialized= false; */ void *pfs_malloc(PFS_builtin_memory_class *klass, size_t size, myf flags) { - DBUG_ASSERT(klass != NULL); - DBUG_ASSERT(size > 0); + assert(klass != NULL); + assert(size > 0); void *ptr= NULL; @@ -137,9 +137,9 @@ void pfs_free(PFS_builtin_memory_class *klass, size_t size, void *ptr) */ void *pfs_malloc_array(PFS_builtin_memory_class *klass, size_t n, size_t size, myf flags) { - DBUG_ASSERT(klass != NULL); - DBUG_ASSERT(n > 0); - DBUG_ASSERT(size > 0); + assert(klass != NULL); + assert(n > 0); + assert(size > 0); void *ptr= NULL; size_t array_size= n * size; /* Check for overflow before allocating. */ @@ -172,7 +172,7 @@ void pfs_free_array(PFS_builtin_memory_class *klass, size_t n, size_t size, void return; size_t array_size= n * size; /* Overflow should have been detected by pfs_malloc_array. */ - DBUG_ASSERT(!is_overflow(array_size, n, size)); + assert(!is_overflow(array_size, n, size)); return pfs_free(klass, array_size, ptr); } @@ -215,9 +215,9 @@ uint pfs_get_socket_address(char *host, const struct sockaddr_storage *src_addr, socklen_t src_len) { - DBUG_ASSERT(host); - DBUG_ASSERT(src_addr); - DBUG_ASSERT(port); + assert(host); + assert(src_addr); + assert(port); memset(host, 0, host_len); *port= 0; diff --git a/storage/perfschema/pfs_global.h b/storage/perfschema/pfs_global.h index d26e81adae7..48a5587839e 100644 --- a/storage/perfschema/pfs_global.h +++ b/storage/perfschema/pfs_global.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -175,7 +175,7 @@ inline uint randomized_index(const void *ptr, uint max_size) seed2= seed1*seed1; seed1= result; - DBUG_ASSERT(result < max_size); + assert(result < max_size); return result; } diff --git a/storage/perfschema/pfs_host.cc b/storage/perfschema/pfs_host.cc index b896215efda..7d7af7700c2 100644 --- a/storage/perfschema/pfs_host.cc +++ b/storage/perfschema/pfs_host.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -71,9 +71,9 @@ static uchar *host_hash_get_key(const uchar *entry, size_t *length, const PFS_host *host; const void *result; typed_entry= reinterpret_cast<const PFS_host* const *> (entry); - DBUG_ASSERT(typed_entry != NULL); + assert(typed_entry != NULL); host= *typed_entry; - DBUG_ASSERT(host != NULL); + assert(host != NULL); *length= host->m_key.m_key_length; result= host->m_key.m_hash_key; return const_cast<uchar*> (reinterpret_cast<const uchar*> (result)); @@ -119,7 +119,7 @@ static LF_PINS* get_host_hash_pins(PFS_thread *thread) static void set_host_key(PFS_host_key *key, const char *host, uint host_length) { - DBUG_ASSERT(host_length <= HOSTNAME_LENGTH); + assert(host_length <= HOSTNAME_LENGTH); char *ptr= &key->m_hash_key[0]; if (host_length > 0) @@ -328,7 +328,7 @@ void purge_host(PFS_thread *thread, PFS_host *host) host->m_key.m_hash_key, host->m_key.m_key_length)); if (entry && (entry != MY_ERRPTR)) { - DBUG_ASSERT(*entry == host); + assert(*entry == host); if (host->get_refcount() == 0) { lf_hash_delete(&host_hash, pins, diff --git a/storage/perfschema/pfs_host.h b/storage/perfschema/pfs_host.h index 3781988237b..71ef0d7f5ad 100644 --- a/storage/perfschema/pfs_host.h +++ b/storage/perfschema/pfs_host.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_instr.cc b/storage/perfschema/pfs_instr.cc index cd82014696c..41b1b24295a 100644 --- a/storage/perfschema/pfs_instr.cc +++ b/storage/perfschema/pfs_instr.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -107,7 +107,7 @@ int init_instruments(const PFS_global_param *param) uint index; /* Make sure init_event_name_sizing is called */ - DBUG_ASSERT(wait_class_max != 0); + assert(wait_class_max != 0); file_handle_max= param->m_file_handle_sizing; file_handle_full= false; @@ -259,9 +259,9 @@ static uchar *filename_hash_get_key(const uchar *entry, size_t *length, const PFS_file *file; const void *result; typed_entry= reinterpret_cast<const PFS_file* const *> (entry); - DBUG_ASSERT(typed_entry != NULL); + assert(typed_entry != NULL); file= *typed_entry; - DBUG_ASSERT(file != NULL); + assert(file != NULL); *length= file->m_filename_length; result= file->m_filename; return const_cast<uchar*> (reinterpret_cast<const uchar*> (result)); @@ -328,7 +328,7 @@ PFS_mutex* create_mutex(PFS_mutex_class *klass, const void *identity) */ void destroy_mutex(PFS_mutex *pfs) { - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); PFS_mutex_class *klass= pfs->m_class; /* Aggregate to EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME */ klass->m_mutex_stat.aggregate(& pfs->m_mutex_stat); @@ -376,7 +376,7 @@ PFS_rwlock* create_rwlock(PFS_rwlock_class *klass, const void *identity) */ void destroy_rwlock(PFS_rwlock *pfs) { - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); PFS_rwlock_class *klass= pfs->m_class; /* Aggregate to EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME */ klass->m_rwlock_stat.aggregate(& pfs->m_rwlock_stat); @@ -420,7 +420,7 @@ PFS_cond* create_cond(PFS_cond_class *klass, const void *identity) */ void destroy_cond(PFS_cond *pfs) { - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); PFS_cond_class *klass= pfs->m_class; /* Aggregate to EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME */ klass->m_cond_stat.aggregate(& pfs->m_cond_stat); @@ -651,14 +651,14 @@ PFS_metadata_lock *sanitize_metadata_lock(PFS_metadata_lock *unsafe) */ void destroy_thread(PFS_thread *pfs) { - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); pfs->reset_session_connect_attrs(); if (pfs->m_account != NULL) { pfs->m_account->release(); pfs->m_account= NULL; - DBUG_ASSERT(pfs->m_user == NULL); - DBUG_ASSERT(pfs->m_host == NULL); + assert(pfs->m_user == NULL); + assert(pfs->m_host == NULL); } else { @@ -752,7 +752,7 @@ find_or_create_file(PFS_thread *thread, PFS_file_class *klass, { PFS_file *pfs; - DBUG_ASSERT(klass != NULL || ! create); + assert(klass != NULL || ! create); LF_PINS *pins= get_filename_hash_pins(thread); if (unlikely(pins == NULL)) @@ -927,7 +927,7 @@ void find_and_rename_file(PFS_thread *thread, const char *old_filename, { PFS_file *pfs; - DBUG_ASSERT(thread != NULL); + assert(thread != NULL); LF_PINS *pins= get_filename_hash_pins(thread); if (unlikely(pins == NULL)) @@ -1070,7 +1070,7 @@ void find_and_rename_file(PFS_thread *thread, const char *old_filename, */ void release_file(PFS_file *pfs) { - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); pfs->m_file_stat.m_open_count--; } @@ -1081,8 +1081,8 @@ void release_file(PFS_file *pfs) */ void destroy_file(PFS_thread *thread, PFS_file *pfs) { - DBUG_ASSERT(thread != NULL); - DBUG_ASSERT(pfs != NULL); + assert(thread != NULL); + assert(pfs != NULL); PFS_file_class *klass= pfs->m_class; /* Aggregate to FILE_SUMMARY_BY_EVENT_NAME */ @@ -1093,7 +1093,7 @@ void destroy_file(PFS_thread *thread, PFS_file *pfs) klass->m_singleton= NULL; LF_PINS *pins= get_filename_hash_pins(thread); - DBUG_ASSERT(pins != NULL); + assert(pins != NULL); lf_hash_delete(&pfs_filename_hash, pins, pfs->m_filename, pfs->m_filename_length); @@ -1187,8 +1187,8 @@ void PFS_table::safe_aggregate_io(const TABLE_SHARE *optional_server_share, PFS_table_stat *table_stat, PFS_table_share *table_share) { - DBUG_ASSERT(table_stat != NULL); - DBUG_ASSERT(table_share != NULL); + assert(table_stat != NULL); + assert(table_share != NULL); uint key_count= sanitize_index_count(table_share->m_key_count); @@ -1196,7 +1196,7 @@ void PFS_table::safe_aggregate_io(const TABLE_SHARE *optional_server_share, PFS_table_io_stat *from_stat; uint index; - DBUG_ASSERT(key_count <= MAX_INDEXES); + assert(key_count <= MAX_INDEXES); /* Aggregate stats for each index, if any */ for (index= 0; index < key_count; index++) @@ -1250,8 +1250,8 @@ void PFS_table::safe_aggregate_io(const TABLE_SHARE *optional_server_share, void PFS_table::safe_aggregate_lock(PFS_table_stat *table_stat, PFS_table_share *table_share) { - DBUG_ASSERT(table_stat != NULL); - DBUG_ASSERT(table_share != NULL); + assert(table_stat != NULL); + assert(table_share != NULL); PFS_table_lock_stat *from_stat= & table_stat->m_lock_stat; @@ -1273,7 +1273,7 @@ void PFS_table::safe_aggregate_lock(PFS_table_stat *table_stat, */ void destroy_table(PFS_table *pfs) { - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); pfs->m_share->dec_refcount(); global_table_container.deallocate(pfs); } @@ -1341,7 +1341,7 @@ PFS_socket* create_socket(PFS_socket_class *klass, const my_socket *fd, */ void destroy_socket(PFS_socket *pfs) { - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); PFS_socket_class *klass= pfs->m_class; /* Aggregate to SOCKET_SUMMARY_BY_EVENT_NAME */ @@ -1408,7 +1408,7 @@ PFS_metadata_lock* create_metadata_lock(void *identity, void destroy_metadata_lock(PFS_metadata_lock *pfs) { - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); global_mdl_container.deallocate(pfs); } @@ -1635,8 +1635,8 @@ void aggregate_all_statements(PFS_statement_stat *from_array, void aggregate_all_transactions(PFS_transaction_stat *from_array, PFS_transaction_stat *to_array) { - DBUG_ASSERT(from_array != NULL); - DBUG_ASSERT(to_array != NULL); + assert(from_array != NULL); + assert(to_array != NULL); if (from_array->count() > 0) { @@ -1649,9 +1649,9 @@ void aggregate_all_transactions(PFS_transaction_stat *from_array, PFS_transaction_stat *to_array_1, PFS_transaction_stat *to_array_2) { - DBUG_ASSERT(from_array != NULL); - DBUG_ASSERT(to_array_1 != NULL); - DBUG_ASSERT(to_array_2 != NULL); + assert(from_array != NULL); + assert(to_array_1 != NULL); + assert(to_array_2 != NULL); if (from_array->count() > 0) { @@ -2160,9 +2160,9 @@ void clear_thread_account(PFS_thread *thread) void set_thread_account(PFS_thread *thread) { - DBUG_ASSERT(thread->m_account == NULL); - DBUG_ASSERT(thread->m_user == NULL); - DBUG_ASSERT(thread->m_host == NULL); + assert(thread->m_account == NULL); + assert(thread->m_user == NULL); + assert(thread->m_host == NULL); thread->m_account= find_or_create_account(thread, thread->m_username, diff --git a/storage/perfschema/pfs_instr.h b/storage/perfschema/pfs_instr.h index ec7dff7d350..e09cc7a1cf0 100644 --- a/storage/perfschema/pfs_instr.h +++ b/storage/perfschema/pfs_instr.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_instr_class.cc b/storage/perfschema/pfs_instr_class.cc index 3b59375c7fc..971ee7ca00f 100644 --- a/storage/perfschema/pfs_instr_class.cc +++ b/storage/perfschema/pfs_instr_class.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. Copyright (c) 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify @@ -410,9 +410,9 @@ static uchar *table_share_hash_get_key(const uchar *entry, size_t *length, const PFS_table_share *share; const void *result; typed_entry= reinterpret_cast<const PFS_table_share* const *> (entry); - DBUG_ASSERT(typed_entry != NULL); + assert(typed_entry != NULL); share= *typed_entry; - DBUG_ASSERT(share != NULL); + assert(share != NULL); *length= share->m_key.m_key_length; result= &share->m_key.m_hash_key[0]; return const_cast<uchar*> (reinterpret_cast<const uchar*> (result)); @@ -471,8 +471,8 @@ static void set_table_share_key(PFS_table_share_key *key, const char *schema_name, size_t schema_name_length, const char *table_name, size_t table_name_length) { - DBUG_ASSERT(schema_name_length <= NAME_LEN); - DBUG_ASSERT(table_name_length <= NAME_LEN); + assert(schema_name_length <= NAME_LEN); + assert(table_name_length <= NAME_LEN); char *saved_schema_name; char *saved_table_name; @@ -586,7 +586,7 @@ void PFS_table_share::destroy_lock_stat() PFS_table_share_index* PFS_table_share::find_index_stat(uint index) const { - DBUG_ASSERT(index <= MAX_INDEXES); + assert(index <= MAX_INDEXES); PFS_table_share *that= const_cast<PFS_table_share*>(this); void *addr= & that->m_race_index_stat[index]; @@ -610,7 +610,7 @@ PFS_table_share::find_index_stat(uint index) const PFS_table_share_index* PFS_table_share::find_or_create_index_stat(const TABLE_SHARE *server_share, uint index) { - DBUG_ASSERT(index <= MAX_INDEXES); + assert(index <= MAX_INDEXES); void *addr= & this->m_race_index_stat[index]; void * volatile * typed_addr= static_cast<void * volatile *>(addr); @@ -763,7 +763,7 @@ int init_table_share_index_stat(uint index_stat_sizing) PFS_table_share_index* create_table_share_index_stat(const TABLE_SHARE *server_share, uint server_index) { - DBUG_ASSERT((server_share != NULL) || (server_index == MAX_INDEXES)); + assert((server_share != NULL) || (server_index == MAX_INDEXES)); PFS_table_share_index *pfs= NULL; pfs_dirty_state dirty_state; @@ -1005,7 +1005,7 @@ static void init_instr_class(PFS_instr_class *klass, int flags, PFS_class_type class_type) { - DBUG_ASSERT(name_length <= PFS_MAX_INFO_NAME_LENGTH); + assert(name_length <= PFS_MAX_INFO_NAME_LENGTH); memset(klass, 0, sizeof(PFS_instr_class)); strncpy(klass->m_name, name, name_length); klass->m_name[PFS_MAX_INFO_NAME_LENGTH - 1]= '\0'; @@ -1062,7 +1062,7 @@ static void configure_instr_class(PFS_instr_class *entry) if ((entry->m_name_length == NAME_LENGTH) && \ (strncmp(entry->m_name, NAME, NAME_LENGTH) == 0)) \ { \ - DBUG_ASSERT(entry->m_flags == flags); \ + assert(entry->m_flags == flags); \ return (INDEX + 1); \ } \ } @@ -1316,7 +1316,7 @@ PFS_thread_key register_thread_class(const char *name, uint name_length, if (index < thread_class_max) { entry= &thread_class_array[index]; - DBUG_ASSERT(name_length <= PFS_MAX_INFO_NAME_LENGTH); + assert(name_length <= PFS_MAX_INFO_NAME_LENGTH); strncpy(entry->m_name, name, name_length); entry->m_name_length= name_length; entry->m_enabled= true; @@ -1883,7 +1883,7 @@ void PFS_table_share::sum_io(PFS_single_stat *result, uint key_count) uint index; PFS_table_share_index *stat; - DBUG_ASSERT(key_count <= MAX_INDEXES); + assert(key_count <= MAX_INDEXES); /* Sum stats for each index, if any */ for (index= 0; index < key_count; index++) @@ -1931,7 +1931,7 @@ void PFS_table_share::aggregate_lock(void) void release_table_share(PFS_table_share *pfs) { - DBUG_ASSERT(pfs->get_refcount() > 0); + assert(pfs->get_refcount() > 0); pfs->dec_refcount(); } diff --git a/storage/perfschema/pfs_instr_class.h b/storage/perfschema/pfs_instr_class.h index 573cfe33ffb..b8ff8497241 100644 --- a/storage/perfschema/pfs_instr_class.h +++ b/storage/perfschema/pfs_instr_class.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -172,13 +172,13 @@ struct PFS_instr_class bool is_progress() const { - DBUG_ASSERT(m_type == PFS_CLASS_STAGE); + assert(m_type == PFS_CLASS_STAGE); return m_flags & PSI_FLAG_STAGE_PROGRESS; } bool is_shared_exclusive() const { - DBUG_ASSERT(m_type == PFS_CLASS_RWLOCK); + assert(m_type == PFS_CLASS_RWLOCK); return m_flags & PSI_RWLOCK_FLAG_SX; } diff --git a/storage/perfschema/pfs_lock.h b/storage/perfschema/pfs_lock.h index 3730e61ced7..4c1674c5e67 100644 --- a/storage/perfschema/pfs_lock.h +++ b/storage/perfschema/pfs_lock.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2009, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -173,7 +173,7 @@ struct pfs_lock { uint32 copy= copy_version_state(); /* Make sure the record was ALLOCATED. */ - DBUG_ASSERT((copy & STATE_MASK) == PFS_LOCK_ALLOCATED); + assert((copy & STATE_MASK) == PFS_LOCK_ALLOCATED); /* Keep the same version, set the DIRTY state */ uint32 new_val= (copy & VERSION_MASK) + PFS_LOCK_DIRTY; /* We own the record, no need to use compare and swap. */ @@ -191,7 +191,7 @@ struct pfs_lock void dirty_to_allocated(const pfs_dirty_state *copy) { /* Make sure the record was DIRTY. */ - DBUG_ASSERT((copy->m_version_state & STATE_MASK) == PFS_LOCK_DIRTY); + assert((copy->m_version_state & STATE_MASK) == PFS_LOCK_DIRTY); /* Increment the version, set the ALLOCATED state */ uint32 new_val= (copy->m_version_state & VERSION_MASK) + VERSION_INC + PFS_LOCK_ALLOCATED; @@ -234,7 +234,7 @@ struct pfs_lock void dirty_to_free(const pfs_dirty_state *copy) { /* Make sure the record was DIRTY. */ - DBUG_ASSERT((copy->m_version_state & STATE_MASK) == PFS_LOCK_DIRTY); + assert((copy->m_version_state & STATE_MASK) == PFS_LOCK_DIRTY); /* Keep the same version, set the FREE state */ uint32 new_val= (copy->m_version_state & VERSION_MASK) + PFS_LOCK_FREE; @@ -254,7 +254,7 @@ struct pfs_lock */ uint32 copy= copy_version_state(); /* Make sure the record was ALLOCATED. */ - DBUG_ASSERT(((copy & STATE_MASK) == PFS_LOCK_ALLOCATED)); + assert(((copy & STATE_MASK) == PFS_LOCK_ALLOCATED)); /* Keep the same version, set the FREE state */ uint32 new_val= (copy & VERSION_MASK) + PFS_LOCK_FREE; diff --git a/storage/perfschema/pfs_memory.cc b/storage/perfschema/pfs_memory.cc index c4e92d7d6b0..d2185ecc648 100644 --- a/storage/perfschema/pfs_memory.cc +++ b/storage/perfschema/pfs_memory.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_memory.h b/storage/perfschema/pfs_memory.h index 4dc21b892d5..a3e753656ce 100644 --- a/storage/perfschema/pfs_memory.h +++ b/storage/perfschema/pfs_memory.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_prepared_stmt.cc b/storage/perfschema/pfs_prepared_stmt.cc index 5885f31857a..ccb49f3290d 100644 --- a/storage/perfschema/pfs_prepared_stmt.cc +++ b/storage/perfschema/pfs_prepared_stmt.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2014, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_prepared_stmt.h b/storage/perfschema/pfs_prepared_stmt.h index 1b017b508a6..1014d9c6af6 100644 --- a/storage/perfschema/pfs_prepared_stmt.h +++ b/storage/perfschema/pfs_prepared_stmt.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2014, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_program.cc b/storage/perfschema/pfs_program.cc index 8e6d02c761c..00b8082ec53 100644 --- a/storage/perfschema/pfs_program.cc +++ b/storage/perfschema/pfs_program.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -70,9 +70,9 @@ static uchar *program_hash_get_key(const uchar *entry, size_t *length, const PFS_program *program; const void *result; typed_entry= reinterpret_cast<const PFS_program* const *> (entry); - DBUG_ASSERT(typed_entry != NULL); + assert(typed_entry != NULL); program= *typed_entry; - DBUG_ASSERT(program != NULL); + assert(program != NULL); *length= program->m_key.m_key_length; result= program->m_key.m_hash_key; return const_cast<uchar*> (reinterpret_cast<const uchar*> (result)); @@ -109,8 +109,8 @@ static void set_program_key(PFS_program_key *key, const char *object_name, uint object_name_length, const char *schema_name, uint schema_name_length) { - DBUG_ASSERT(object_name_length <= COL_OBJECT_NAME_SIZE); - DBUG_ASSERT(schema_name_length <= COL_OBJECT_SCHEMA_SIZE); + assert(object_name_length <= COL_OBJECT_NAME_SIZE); + assert(schema_name_length <= COL_OBJECT_SCHEMA_SIZE); /* To make sure generated key is case insensitive, diff --git a/storage/perfschema/pfs_program.h b/storage/perfschema/pfs_program.h index 0cbd24b8699..a34f533d444 100644 --- a/storage/perfschema/pfs_program.h +++ b/storage/perfschema/pfs_program.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_server.cc b/storage/perfschema/pfs_server.cc index 63deba92de8..0a97f05c54a 100644 --- a/storage/perfschema/pfs_server.cc +++ b/storage/perfschema/pfs_server.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -211,7 +211,7 @@ initialize_performance_schema(PFS_global_param *param) static void destroy_pfs_thread(void *key) { PFS_thread* pfs= reinterpret_cast<PFS_thread*> (key); - DBUG_ASSERT(pfs); + assert(pfs); /* This automatic cleanup is a last resort and best effort to avoid leaks, and may not work on windows due to the implementation of pthread_key_create(). diff --git a/storage/perfschema/pfs_server.h b/storage/perfschema/pfs_server.h index 68f6f71d619..c1ebb531a85 100644 --- a/storage/perfschema/pfs_server.h +++ b/storage/perfschema/pfs_server.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_setup_actor.cc b/storage/perfschema/pfs_setup_actor.cc index 96b367b65db..6e066e34231 100644 --- a/storage/perfschema/pfs_setup_actor.cc +++ b/storage/perfschema/pfs_setup_actor.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -70,9 +70,9 @@ static uchar *setup_actor_hash_get_key(const uchar *entry, size_t *length, const PFS_setup_actor *setup_actor; const void *result; typed_entry= reinterpret_cast<const PFS_setup_actor* const *> (entry); - DBUG_ASSERT(typed_entry != NULL); + assert(typed_entry != NULL); setup_actor= *typed_entry; - DBUG_ASSERT(setup_actor != NULL); + assert(setup_actor != NULL); *length= setup_actor->m_key.m_key_length; result= setup_actor->m_key.m_hash_key; return const_cast<uchar*> (reinterpret_cast<const uchar*> (result)); @@ -121,8 +121,8 @@ static void set_setup_actor_key(PFS_setup_actor_key *key, const char *host, uint host_length, const char *role, uint role_length) { - DBUG_ASSERT(user_length <= USERNAME_LENGTH); - DBUG_ASSERT(host_length <= HOSTNAME_LENGTH); + assert(user_length <= USERNAME_LENGTH); + assert(host_length <= HOSTNAME_LENGTH); char *ptr= &key->m_hash_key[0]; memcpy(ptr, user, user_length); diff --git a/storage/perfschema/pfs_setup_actor.h b/storage/perfschema/pfs_setup_actor.h index 3d00c52aa32..3570748085a 100644 --- a/storage/perfschema/pfs_setup_actor.h +++ b/storage/perfschema/pfs_setup_actor.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_setup_object.cc b/storage/perfschema/pfs_setup_object.cc index 47afd130761..540f2c74936 100644 --- a/storage/perfschema/pfs_setup_object.cc +++ b/storage/perfschema/pfs_setup_object.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -70,9 +70,9 @@ static uchar *setup_object_hash_get_key(const uchar *entry, size_t *length, const PFS_setup_object *setup_object; const void *result; typed_entry= reinterpret_cast<const PFS_setup_object* const *> (entry); - DBUG_ASSERT(typed_entry != NULL); + assert(typed_entry != NULL); setup_object= *typed_entry; - DBUG_ASSERT(setup_object != NULL); + assert(setup_object != NULL); *length= setup_object->m_key.m_key_length; result= setup_object->m_key.m_hash_key; return const_cast<uchar*> (reinterpret_cast<const uchar*> (result)); @@ -120,8 +120,8 @@ static void set_setup_object_key(PFS_setup_object_key *key, const char *schema, uint schema_length, const char *object, uint object_length) { - DBUG_ASSERT(schema_length <= NAME_LEN); - DBUG_ASSERT(object_length <= NAME_LEN); + assert(schema_length <= NAME_LEN); + assert(object_length <= NAME_LEN); char *ptr= &key->m_hash_key[0]; ptr[0]= (char) object_type; @@ -284,7 +284,7 @@ void lookup_setup_object(PFS_thread *thread, - TABLE foo.bar - TEMPORARY TABLE foo.bar */ - DBUG_ASSERT(object_type != OBJECT_TYPE_TEMPORARY_TABLE); + assert(object_type != OBJECT_TYPE_TEMPORARY_TABLE); LF_PINS* pins= get_setup_object_hash_pins(thread); if (unlikely(pins == NULL)) diff --git a/storage/perfschema/pfs_setup_object.h b/storage/perfschema/pfs_setup_object.h index d49be341bbe..63e275385b1 100644 --- a/storage/perfschema/pfs_setup_object.h +++ b/storage/perfschema/pfs_setup_object.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_stat.h b/storage/perfschema/pfs_stat.h index e3e06760eb6..f266267f4cd 100644 --- a/storage/perfschema/pfs_stat.h +++ b/storage/perfschema/pfs_stat.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -722,7 +722,7 @@ struct PFS_table_stat PFS_table_io_stat *to_stat_last; const PFS_table_io_stat *from_stat; - DBUG_ASSERT(key_count <= MAX_INDEXES); + assert(key_count <= MAX_INDEXES); /* Aggregate stats for each index, if any */ to_stat= & m_index_stat[0]; @@ -753,7 +753,7 @@ struct PFS_table_stat PFS_table_io_stat *stat; PFS_table_io_stat *stat_last; - DBUG_ASSERT(key_count <= MAX_INDEXES); + assert(key_count <= MAX_INDEXES); /* Sum stats for each index, if any */ stat= & m_index_stat[0]; diff --git a/storage/perfschema/pfs_status.cc b/storage/perfschema/pfs_status.cc index 2007d191d13..50f361db083 100644 --- a/storage/perfschema/pfs_status.cc +++ b/storage/perfschema/pfs_status.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_status.h b/storage/perfschema/pfs_status.h index 6b35a162982..b29791420ad 100644 --- a/storage/perfschema/pfs_status.h +++ b/storage/perfschema/pfs_status.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_timer.cc b/storage/perfschema/pfs_timer.cc index ceec4ed9359..c5a0bdf2262 100644 --- a/storage/perfschema/pfs_timer.cc +++ b/storage/perfschema/pfs_timer.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -249,7 +249,7 @@ ulonglong get_timer_raw_value(enum_timer_name timer_name) case TIMER_NAME_TICK: return my_timer_ticks(); default: - DBUG_ASSERT(false); + assert(false); } return 0; } @@ -275,7 +275,7 @@ ulonglong get_timer_raw_value_and_function(enum_timer_name timer_name, timer_fct return my_timer_ticks(); default: *fct= NULL; - DBUG_ASSERT(false); + assert(false); } return 0; } @@ -303,7 +303,7 @@ ulonglong get_timer_pico_value(enum_timer_name timer_name) break; default: result= 0; - DBUG_ASSERT(false); + assert(false); } return result; } @@ -312,8 +312,8 @@ time_normalizer* time_normalizer::get(enum_timer_name timer_name) { uint index= static_cast<uint> (timer_name); - DBUG_ASSERT(index >= FIRST_TIMER_NAME); - DBUG_ASSERT(index <= LAST_TIMER_NAME); + assert(index >= FIRST_TIMER_NAME); + assert(index <= LAST_TIMER_NAME); return & to_pico_data[index]; } diff --git a/storage/perfschema/pfs_timer.h b/storage/perfschema/pfs_timer.h index f2bedc878e7..e9387c110ee 100644 --- a/storage/perfschema/pfs_timer.h +++ b/storage/perfschema/pfs_timer.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_user.cc b/storage/perfschema/pfs_user.cc index feb99f41147..d7dfda4efc2 100644 --- a/storage/perfschema/pfs_user.cc +++ b/storage/perfschema/pfs_user.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -71,9 +71,9 @@ static uchar *user_hash_get_key(const uchar *entry, size_t *length, const PFS_user *user; const void *result; typed_entry= reinterpret_cast<const PFS_user* const *> (entry); - DBUG_ASSERT(typed_entry != NULL); + assert(typed_entry != NULL); user= *typed_entry; - DBUG_ASSERT(user != NULL); + assert(user != NULL); *length= user->m_key.m_key_length; result= user->m_key.m_hash_key; return const_cast<uchar*> (reinterpret_cast<const uchar*> (result)); @@ -119,7 +119,7 @@ static LF_PINS* get_user_hash_pins(PFS_thread *thread) static void set_user_key(PFS_user_key *key, const char *user, uint user_length) { - DBUG_ASSERT(user_length <= USERNAME_LENGTH); + assert(user_length <= USERNAME_LENGTH); char *ptr= &key->m_hash_key[0]; if (user_length > 0) @@ -293,7 +293,7 @@ void purge_user(PFS_thread *thread, PFS_user *user) user->m_key.m_hash_key, user->m_key.m_key_length)); if (entry && (entry != MY_ERRPTR)) { - DBUG_ASSERT(*entry == user); + assert(*entry == user); if (user->get_refcount() == 0) { lf_hash_delete(&user_hash, pins, diff --git a/storage/perfschema/pfs_user.h b/storage/perfschema/pfs_user.h index 9553ff8cae7..58c95ad720e 100644 --- a/storage/perfschema/pfs_user.h +++ b/storage/perfschema/pfs_user.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_variable.cc b/storage/perfschema/pfs_variable.cc index 9be6f12e7b4..17b7dfc200c 100644 --- a/storage/perfschema/pfs_variable.cc +++ b/storage/perfschema/pfs_variable.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. Copyright (c) 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify @@ -82,7 +82,7 @@ static inline SHOW_SCOPE show_scope_from_type(enum enum_mysql_show_type type) */ bool PFS_system_variable_cache::init_show_var_array(enum_var_type scope, bool strict) { - DBUG_ASSERT(!m_initialized); + assert(!m_initialized); m_query_scope= scope; mysql_prlock_rdlock(&LOCK_system_variables_hash); @@ -172,7 +172,7 @@ int PFS_system_variable_cache::do_materialize_global(void) { const char* name= show_var->name; sys_var *value= (sys_var *)show_var->value; - DBUG_ASSERT(value); + assert(value); if ((m_query_scope == OPT_GLOBAL) && (!my_strcasecmp(system_charset_info, name, "sql_log_bin"))) @@ -200,7 +200,7 @@ int PFS_system_variable_cache::do_materialize_global(void) The assert below will fail once SQL_LOG_BIN really is defined as SESSION_ONLY (in 5.8), so that this special case can be removed. */ - DBUG_ASSERT(value->scope() == sys_var::SESSION); + assert(value->scope() == sys_var::SESSION); continue; } @@ -330,7 +330,7 @@ int PFS_system_variable_cache::do_materialize_session(PFS_thread *pfs_thread) mysql_mutex_lock(&LOCK_plugin_delete); /* The SHOW_VAR array must be initialized externally. */ - DBUG_ASSERT(m_initialized); + assert(m_initialized); /* Use a temporary mem_root to avoid depleting THD mem_root. */ if (m_use_mem_root) @@ -385,7 +385,7 @@ int PFS_system_variable_cache::do_materialize_session(PFS_thread *pfs_thread, ui mysql_mutex_lock(&LOCK_plugin_delete); /* The SHOW_VAR array must be initialized externally. */ - DBUG_ASSERT(m_initialized); + assert(m_initialized); /* Get and lock a validated THD from the thread manager. */ if ((m_safe_thd= get_THD(pfs_thread)) != NULL) @@ -524,7 +524,7 @@ void System_variable::init(THD *target_thd, const SHOW_VAR *show_var, mysql_mutex_lock(&target_thd->LOCK_thd_sysvar);*/ sys_var *system_var= (sys_var *)show_var->value; - DBUG_ASSERT(system_var != NULL); + assert(system_var != NULL); m_charset= system_var->charset(target_thd); m_type= system_var->show_type(); m_scope= system_var->scope(); @@ -655,8 +655,8 @@ bool PFS_status_variable_cache::match_scope(SHOW_SCOPE variable_scope, bool stri */ bool PFS_status_variable_cache::filter_by_name(const SHOW_VAR *show_var) { - DBUG_ASSERT(show_var); - DBUG_ASSERT(show_var->name); + assert(show_var); + assert(show_var->name); if (show_var->type == SHOW_ARRAY) { @@ -765,7 +765,7 @@ bool PFS_status_variable_cache::filter_show_var(const SHOW_VAR *show_var, bool s */ bool PFS_status_variable_cache::init_show_var_array(enum_var_type scope, bool strict) { - DBUG_ASSERT(!m_initialized); + assert(!m_initialized); /* Resize if necessary. */ m_show_var_array.reserve(all_status_vars.elements + 1); @@ -844,7 +844,7 @@ void PFS_status_variable_cache::expand_show_var_array(const SHOW_VAR *show_var_a char * PFS_status_variable_cache::make_show_var_name(const char* prefix, const char* name, char *name_buf, size_t buf_len) { - DBUG_ASSERT(name_buf != NULL); + assert(name_buf != NULL); char *prefix_end= name_buf; if (prefix && *prefix) @@ -960,7 +960,7 @@ int PFS_status_variable_cache::do_materialize_global(void) int PFS_status_variable_cache::do_materialize_all(THD* unsafe_thd) { int ret= 1; - DBUG_ASSERT(unsafe_thd != NULL); + assert(unsafe_thd != NULL); m_unsafe_thd= unsafe_thd; m_materialized= false; @@ -1006,7 +1006,7 @@ int PFS_status_variable_cache::do_materialize_all(THD* unsafe_thd) int PFS_status_variable_cache::do_materialize_session(THD* unsafe_thd) { int ret= 1; - DBUG_ASSERT(unsafe_thd != NULL); + assert(unsafe_thd != NULL); m_unsafe_thd= unsafe_thd; m_materialized= false; @@ -1053,7 +1053,7 @@ int PFS_status_variable_cache::do_materialize_session(THD* unsafe_thd) int PFS_status_variable_cache::do_materialize_session(PFS_thread *pfs_thread) { int ret= 1; - DBUG_ASSERT(pfs_thread != NULL); + assert(pfs_thread != NULL); m_pfs_thread= pfs_thread; m_materialized= false; @@ -1064,7 +1064,7 @@ int PFS_status_variable_cache::do_materialize_session(PFS_thread *pfs_thread) mysql_mutex_lock(&LOCK_status); /* The SHOW_VAR array must be initialized externally. */ - DBUG_ASSERT(m_initialized); + assert(m_initialized); /* Get and lock a validated THD from the thread manager. */ if ((m_safe_thd= get_THD(pfs_thread)) != NULL) @@ -1096,7 +1096,7 @@ int PFS_status_variable_cache::do_materialize_session(PFS_thread *pfs_thread) */ int PFS_status_variable_cache::do_materialize_client(PFS_client *pfs_client) { - DBUG_ASSERT(pfs_client != NULL); + assert(pfs_client != NULL); STATUS_VAR status_totals; m_pfs_client= pfs_client; @@ -1108,7 +1108,7 @@ int PFS_status_variable_cache::do_materialize_client(PFS_client *pfs_client) mysql_mutex_lock(&LOCK_status); /* The SHOW_VAR array must be initialized externally. */ - DBUG_ASSERT(m_initialized); + assert(m_initialized); /* Generate status totals from active threads and from totals aggregated diff --git a/storage/perfschema/pfs_variable.h b/storage/perfschema/pfs_variable.h index bfe51c6d1b3..e59b02f2af8 100644 --- a/storage/perfschema/pfs_variable.h +++ b/storage/perfschema/pfs_variable.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -479,7 +479,7 @@ THD *PFS_variable_cache<Var_type>::get_THD(THD *unsafe_thd) template <class Var_type> THD *PFS_variable_cache<Var_type>::get_THD(PFS_thread *pfs_thread) { - DBUG_ASSERT(pfs_thread != NULL); + assert(pfs_thread != NULL); return get_THD(pfs_thread->m_thd); } diff --git a/storage/perfschema/pfs_visitor.cc b/storage/perfschema/pfs_visitor.cc index 638877d8755..52e0d6871f3 100644 --- a/storage/perfschema/pfs_visitor.cc +++ b/storage/perfschema/pfs_visitor.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -64,8 +64,8 @@ void PFS_connection_iterator::visit_global(bool with_hosts, bool with_users, bool with_THDs, PFS_connection_visitor *visitor) { - DBUG_ASSERT(visitor != NULL); - DBUG_ASSERT(! with_threads || ! with_THDs); + assert(visitor != NULL); + assert(! with_threads || ! with_THDs); visitor->visit_global(); @@ -164,8 +164,8 @@ void PFS_connection_iterator::visit_host(PFS_host *host, bool with_THDs, PFS_connection_visitor *visitor) { - DBUG_ASSERT(visitor != NULL); - DBUG_ASSERT(! with_threads || ! with_THDs); + assert(visitor != NULL); + assert(! with_threads || ! with_THDs); visitor->visit_host(host); @@ -253,8 +253,8 @@ void PFS_connection_iterator::visit_user(PFS_user *user, bool with_THDs, PFS_connection_visitor *visitor) { - DBUG_ASSERT(visitor != NULL); - DBUG_ASSERT(! with_threads || ! with_THDs); + assert(visitor != NULL); + assert(! with_threads || ! with_THDs); visitor->visit_user(user); @@ -334,8 +334,8 @@ void PFS_connection_iterator::visit_account(PFS_account *account, bool with_THDs, PFS_connection_visitor *visitor) { - DBUG_ASSERT(visitor != NULL); - DBUG_ASSERT(! with_threads || ! with_THDs); + assert(visitor != NULL); + assert(! with_threads || ! with_THDs); visitor->visit_account(account); @@ -364,7 +364,7 @@ void PFS_connection_iterator::visit_account(PFS_account *account, void PFS_connection_iterator::visit_THD(THD *thd, PFS_connection_visitor *visitor) { - DBUG_ASSERT(visitor != NULL); + assert(visitor != NULL); visitor->visit_THD(thd); } @@ -505,7 +505,7 @@ void PFS_instance_iterator::visit_all_file_instances(PFS_instance_visitor *visit void PFS_instance_iterator::visit_mutex_instances(PFS_mutex_class *klass, PFS_instance_visitor *visitor) { - DBUG_ASSERT(visitor != NULL); + assert(visitor != NULL); visitor->visit_mutex_class(klass); @@ -539,7 +539,7 @@ void PFS_instance_iterator::visit_mutex_instances(PFS_mutex_class *klass, void PFS_instance_iterator::visit_rwlock_instances(PFS_rwlock_class *klass, PFS_instance_visitor *visitor) { - DBUG_ASSERT(visitor != NULL); + assert(visitor != NULL); visitor->visit_rwlock_class(klass); @@ -573,7 +573,7 @@ void PFS_instance_iterator::visit_rwlock_instances(PFS_rwlock_class *klass, void PFS_instance_iterator::visit_cond_instances(PFS_cond_class *klass, PFS_instance_visitor *visitor) { - DBUG_ASSERT(visitor != NULL); + assert(visitor != NULL); visitor->visit_cond_class(klass); @@ -607,7 +607,7 @@ void PFS_instance_iterator::visit_cond_instances(PFS_cond_class *klass, void PFS_instance_iterator::visit_file_instances(PFS_file_class *klass, PFS_instance_visitor *visitor) { - DBUG_ASSERT(visitor != NULL); + assert(visitor != NULL); visitor->visit_file_class(klass); @@ -643,7 +643,7 @@ void PFS_instance_iterator::visit_file_instances(PFS_file_class *klass, void PFS_instance_iterator::visit_socket_instances(PFS_socket_class *klass, PFS_instance_visitor *visitor) { - DBUG_ASSERT(visitor != NULL); + assert(visitor != NULL); visitor->visit_socket_class(klass); @@ -681,8 +681,8 @@ void PFS_instance_iterator::visit_socket_instances(PFS_socket_class *klass, PFS_thread *thread, bool visit_class) { - DBUG_ASSERT(visitor != NULL); - DBUG_ASSERT(thread != NULL); + assert(visitor != NULL); + assert(thread != NULL); if (visit_class) visitor->visit_socket_class(klass); @@ -721,8 +721,8 @@ void PFS_instance_iterator::visit_instances(PFS_instr_class *klass, PFS_thread *thread, bool visit_class) { - DBUG_ASSERT(visitor != NULL); - DBUG_ASSERT(klass != NULL); + assert(visitor != NULL); + assert(klass != NULL); switch (klass->m_type) { @@ -790,7 +790,7 @@ private: void PFS_object_iterator::visit_all_tables(PFS_object_visitor *visitor) { - DBUG_ASSERT(visitor != NULL); + assert(visitor != NULL); visitor->visit_global(); @@ -827,7 +827,7 @@ private: void PFS_object_iterator::visit_tables(PFS_table_share *share, PFS_object_visitor *visitor) { - DBUG_ASSERT(visitor != NULL); + assert(visitor != NULL); if (!share->m_enabled) return; @@ -870,7 +870,7 @@ void PFS_object_iterator::visit_table_indexes(PFS_table_share *share, uint index, PFS_object_visitor *visitor) { - DBUG_ASSERT(visitor != NULL); + assert(visitor != NULL); if (!share->m_enabled) return; @@ -906,8 +906,8 @@ void PFS_connection_wait_visitor::visit_global() For waits, do not sum by connection but by instances, it is more efficient. */ - DBUG_ASSERT( (m_index == global_idle_class.m_event_name_index) - || (m_index == global_metadata_class.m_event_name_index)); + assert( (m_index == global_idle_class.m_event_name_index) + || (m_index == global_metadata_class.m_event_name_index)); if (m_index == global_idle_class.m_event_name_index) { @@ -969,7 +969,7 @@ PFS_connection_all_wait_visitor::~PFS_connection_all_wait_visitor() void PFS_connection_all_wait_visitor::visit_global() { /* Sum by instances, not by connection */ - DBUG_ASSERT(false); + assert(false); } void PFS_connection_all_wait_visitor::visit_connection_slice(PFS_connection_slice *pfs) diff --git a/storage/perfschema/pfs_visitor.h b/storage/perfschema/pfs_visitor.h index a81567e9921..ebedae6e7f0 100644 --- a/storage/perfschema/pfs_visitor.h +++ b/storage/perfschema/pfs_visitor.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_accounts.cc b/storage/perfschema/table_accounts.cc index 781f408adcb..34dd49017a9 100644 --- a/storage/perfschema/table_accounts.cc +++ b/storage/perfschema/table_accounts.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -115,7 +115,7 @@ int table_accounts::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -133,7 +133,7 @@ int table_accounts::read_row_values(TABLE *table, m_row.m_connection_stat.set_field(f->field_index - 2, f); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_accounts.h b/storage/perfschema/table_accounts.h index 7563e85c1d7..c3c62f77924 100644 --- a/storage/perfschema/table_accounts.h +++ b/storage/perfschema/table_accounts.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_all_instr.cc b/storage/perfschema/table_all_instr.cc index b030b8824ca..6a01912a3a0 100644 --- a/storage/perfschema/table_all_instr.cc +++ b/storage/perfschema/table_all_instr.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_all_instr.h b/storage/perfschema/table_all_instr.h index 3b5388dfb6e..ea52f5d2de2 100644 --- a/storage/perfschema/table_all_instr.h +++ b/storage/perfschema/table_all_instr.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esgs_by_account_by_event_name.cc b/storage/perfschema/table_esgs_by_account_by_event_name.cc index 48777f99ed4..d6c97ac3edf 100644 --- a/storage/perfschema/table_esgs_by_account_by_event_name.cc +++ b/storage/perfschema/table_esgs_by_account_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -182,7 +182,7 @@ int table_esgs_by_account_by_event_name return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) diff --git a/storage/perfschema/table_esgs_by_account_by_event_name.h b/storage/perfschema/table_esgs_by_account_by_event_name.h index 011503aa64b..f19241a4d7b 100644 --- a/storage/perfschema/table_esgs_by_account_by_event_name.h +++ b/storage/perfschema/table_esgs_by_account_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esgs_by_host_by_event_name.cc b/storage/perfschema/table_esgs_by_host_by_event_name.cc index 34210c2a66e..bf219705513 100644 --- a/storage/perfschema/table_esgs_by_host_by_event_name.cc +++ b/storage/perfschema/table_esgs_by_host_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -184,7 +184,7 @@ int table_esgs_by_host_by_event_name return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) diff --git a/storage/perfschema/table_esgs_by_host_by_event_name.h b/storage/perfschema/table_esgs_by_host_by_event_name.h index 14ddbb8b338..71592834d9a 100644 --- a/storage/perfschema/table_esgs_by_host_by_event_name.h +++ b/storage/perfschema/table_esgs_by_host_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esgs_by_thread_by_event_name.cc b/storage/perfschema/table_esgs_by_thread_by_event_name.cc index 4d7b8a1ebcb..f6568655e51 100644 --- a/storage/perfschema/table_esgs_by_thread_by_event_name.cc +++ b/storage/perfschema/table_esgs_by_thread_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -176,7 +176,7 @@ int table_esgs_by_thread_by_event_name return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); for (; (f= *fields) ; fields++) { diff --git a/storage/perfschema/table_esgs_by_thread_by_event_name.h b/storage/perfschema/table_esgs_by_thread_by_event_name.h index d3798e419b6..e5c30363704 100644 --- a/storage/perfschema/table_esgs_by_thread_by_event_name.h +++ b/storage/perfschema/table_esgs_by_thread_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esgs_by_user_by_event_name.cc b/storage/perfschema/table_esgs_by_user_by_event_name.cc index 3e712e59327..ecec4e08425 100644 --- a/storage/perfschema/table_esgs_by_user_by_event_name.cc +++ b/storage/perfschema/table_esgs_by_user_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -183,7 +183,7 @@ int table_esgs_by_user_by_event_name return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) diff --git a/storage/perfschema/table_esgs_by_user_by_event_name.h b/storage/perfschema/table_esgs_by_user_by_event_name.h index 464165a068a..895840fc476 100644 --- a/storage/perfschema/table_esgs_by_user_by_event_name.h +++ b/storage/perfschema/table_esgs_by_user_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esgs_global_by_event_name.cc b/storage/perfschema/table_esgs_global_by_event_name.cc index a7ea841a4a4..fe24d6794c1 100644 --- a/storage/perfschema/table_esgs_global_by_event_name.cc +++ b/storage/perfschema/table_esgs_global_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -168,7 +168,7 @@ int table_esgs_global_by_event_name return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); for (; (f= *fields) ; fields++) { diff --git a/storage/perfschema/table_esgs_global_by_event_name.h b/storage/perfschema/table_esgs_global_by_event_name.h index 44b3ea5ce7b..f2e51f625c7 100644 --- a/storage/perfschema/table_esgs_global_by_event_name.h +++ b/storage/perfschema/table_esgs_global_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_by_account_by_event_name.cc b/storage/perfschema/table_esms_by_account_by_event_name.cc index fc08373341a..9756bc3c70b 100644 --- a/storage/perfschema/table_esms_by_account_by_event_name.cc +++ b/storage/perfschema/table_esms_by_account_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -204,7 +204,7 @@ int table_esms_by_account_by_event_name return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) diff --git a/storage/perfschema/table_esms_by_account_by_event_name.h b/storage/perfschema/table_esms_by_account_by_event_name.h index 3881dd5d978..e5f17ee1113 100644 --- a/storage/perfschema/table_esms_by_account_by_event_name.h +++ b/storage/perfschema/table_esms_by_account_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_by_digest.cc b/storage/perfschema/table_esms_by_digest.cc index ade27883707..c27e3372562 100644 --- a/storage/perfschema/table_esms_by_digest.cc +++ b/storage/perfschema/table_esms_by_digest.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -194,7 +194,7 @@ int table_esms_by_digest Set the null bits. It indicates how many fields could be null in the table. */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) diff --git a/storage/perfschema/table_esms_by_digest.h b/storage/perfschema/table_esms_by_digest.h index 9aa005bb6cc..7b84cdd6429 100644 --- a/storage/perfschema/table_esms_by_digest.h +++ b/storage/perfschema/table_esms_by_digest.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_by_host_by_event_name.cc b/storage/perfschema/table_esms_by_host_by_event_name.cc index c186311ce41..ac6a584965f 100644 --- a/storage/perfschema/table_esms_by_host_by_event_name.cc +++ b/storage/perfschema/table_esms_by_host_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -206,7 +206,7 @@ int table_esms_by_host_by_event_name return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) diff --git a/storage/perfschema/table_esms_by_host_by_event_name.h b/storage/perfschema/table_esms_by_host_by_event_name.h index 807db6d48d3..54237b1deb5 100644 --- a/storage/perfschema/table_esms_by_host_by_event_name.h +++ b/storage/perfschema/table_esms_by_host_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_by_program.cc b/storage/perfschema/table_esms_by_program.cc index 59202230ef0..5a4dab759cd 100644 --- a/storage/perfschema/table_esms_by_program.cc +++ b/storage/perfschema/table_esms_by_program.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -197,7 +197,7 @@ int table_esms_by_program Set the null bits. It indicates how many fields could be null in the table. */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) diff --git a/storage/perfschema/table_esms_by_program.h b/storage/perfschema/table_esms_by_program.h index cc263878e28..fdafb655918 100644 --- a/storage/perfschema/table_esms_by_program.h +++ b/storage/perfschema/table_esms_by_program.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_by_thread_by_event_name.cc b/storage/perfschema/table_esms_by_thread_by_event_name.cc index 6db44a61600..eb38c3e5687 100644 --- a/storage/perfschema/table_esms_by_thread_by_event_name.cc +++ b/storage/perfschema/table_esms_by_thread_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -199,7 +199,7 @@ int table_esms_by_thread_by_event_name return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); for (; (f= *fields) ; fields++) { diff --git a/storage/perfschema/table_esms_by_thread_by_event_name.h b/storage/perfschema/table_esms_by_thread_by_event_name.h index 41fec4e10d7..9a0818291b9 100644 --- a/storage/perfschema/table_esms_by_thread_by_event_name.h +++ b/storage/perfschema/table_esms_by_thread_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_by_user_by_event_name.cc b/storage/perfschema/table_esms_by_user_by_event_name.cc index 0016b6ea823..a0efa66c177 100644 --- a/storage/perfschema/table_esms_by_user_by_event_name.cc +++ b/storage/perfschema/table_esms_by_user_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -205,7 +205,7 @@ int table_esms_by_user_by_event_name return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) diff --git a/storage/perfschema/table_esms_by_user_by_event_name.h b/storage/perfschema/table_esms_by_user_by_event_name.h index 0ed9899dcf5..51762be4143 100644 --- a/storage/perfschema/table_esms_by_user_by_event_name.h +++ b/storage/perfschema/table_esms_by_user_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_global_by_event_name.cc b/storage/perfschema/table_esms_global_by_event_name.cc index 09b6d5bb4b0..f889df11b5a 100644 --- a/storage/perfschema/table_esms_global_by_event_name.cc +++ b/storage/perfschema/table_esms_global_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -192,7 +192,7 @@ int table_esms_global_by_event_name return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); for (; (f= *fields) ; fields++) { diff --git a/storage/perfschema/table_esms_global_by_event_name.h b/storage/perfschema/table_esms_global_by_event_name.h index d4e34b7cc18..c4a32da11bf 100644 --- a/storage/perfschema/table_esms_global_by_event_name.h +++ b/storage/perfschema/table_esms_global_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ets_by_account_by_event_name.cc b/storage/perfschema/table_ets_by_account_by_event_name.cc index 801c9db443f..9d323eb78d9 100644 --- a/storage/perfschema/table_ets_by_account_by_event_name.cc +++ b/storage/perfschema/table_ets_by_account_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -192,7 +192,7 @@ int table_ets_by_account_by_event_name return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) diff --git a/storage/perfschema/table_ets_by_account_by_event_name.h b/storage/perfschema/table_ets_by_account_by_event_name.h index 98fb45f79dd..3399c27d6e4 100644 --- a/storage/perfschema/table_ets_by_account_by_event_name.h +++ b/storage/perfschema/table_ets_by_account_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ets_by_host_by_event_name.cc b/storage/perfschema/table_ets_by_host_by_event_name.cc index 17cccf372b9..6ca2cfad81a 100644 --- a/storage/perfschema/table_ets_by_host_by_event_name.cc +++ b/storage/perfschema/table_ets_by_host_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -194,7 +194,7 @@ int table_ets_by_host_by_event_name return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) diff --git a/storage/perfschema/table_ets_by_host_by_event_name.h b/storage/perfschema/table_ets_by_host_by_event_name.h index 341c3878253..2188f385701 100644 --- a/storage/perfschema/table_ets_by_host_by_event_name.h +++ b/storage/perfschema/table_ets_by_host_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ets_by_thread_by_event_name.cc b/storage/perfschema/table_ets_by_thread_by_event_name.cc index 464bad8c202..257f37d56ed 100644 --- a/storage/perfschema/table_ets_by_thread_by_event_name.cc +++ b/storage/perfschema/table_ets_by_thread_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -187,7 +187,7 @@ int table_ets_by_thread_by_event_name return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); for (; (f= *fields) ; fields++) { diff --git a/storage/perfschema/table_ets_by_thread_by_event_name.h b/storage/perfschema/table_ets_by_thread_by_event_name.h index ad63efa3f1a..dbfe1fae016 100644 --- a/storage/perfschema/table_ets_by_thread_by_event_name.h +++ b/storage/perfschema/table_ets_by_thread_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ets_by_user_by_event_name.cc b/storage/perfschema/table_ets_by_user_by_event_name.cc index afe0c5f8649..6b54175b6cc 100644 --- a/storage/perfschema/table_ets_by_user_by_event_name.cc +++ b/storage/perfschema/table_ets_by_user_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -193,7 +193,7 @@ int table_ets_by_user_by_event_name return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) diff --git a/storage/perfschema/table_ets_by_user_by_event_name.h b/storage/perfschema/table_ets_by_user_by_event_name.h index c3a1d0b5c0a..62721ce9adf 100644 --- a/storage/perfschema/table_ets_by_user_by_event_name.h +++ b/storage/perfschema/table_ets_by_user_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ets_global_by_event_name.cc b/storage/perfschema/table_ets_global_by_event_name.cc index be3fbb60ac9..e08ff15075d 100644 --- a/storage/perfschema/table_ets_global_by_event_name.cc +++ b/storage/perfschema/table_ets_global_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -172,7 +172,7 @@ int table_ets_global_by_event_name return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); for (; (f= *fields) ; fields++) { diff --git a/storage/perfschema/table_ets_global_by_event_name.h b/storage/perfschema/table_ets_global_by_event_name.h index 47c8828cb47..717a737f93c 100644 --- a/storage/perfschema/table_ets_global_by_event_name.h +++ b/storage/perfschema/table_ets_global_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_events_stages.cc b/storage/perfschema/table_events_stages.cc index dedfd92f9ec..66887d39e5a 100644 --- a/storage/perfschema/table_events_stages.cc +++ b/storage/perfschema/table_events_stages.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -193,7 +193,7 @@ int table_events_stages_common::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 2); + assert(table->s->null_bytes == 2); buf[0]= 0; buf[1]= 0; @@ -264,7 +264,7 @@ int table_events_stages_common::read_row_values(TABLE *table, f->set_null(); break; default: - DBUG_ASSERT(false); + assert(false); } } } @@ -413,10 +413,10 @@ int table_events_stages_history::rnd_pos(const void *pos) PFS_thread *pfs_thread; PFS_events_stages *stage; - DBUG_ASSERT(events_stages_history_per_thread != 0); + assert(events_stages_history_per_thread != 0); set_position(pos); - DBUG_ASSERT(m_pos.m_index_2 < events_stages_history_per_thread); + assert(m_pos.m_index_2 < events_stages_history_per_thread); pfs_thread= global_thread_container.get(m_pos.m_index_1); if (pfs_thread != NULL) diff --git a/storage/perfschema/table_events_stages.h b/storage/perfschema/table_events_stages.h index 16e3fc9651a..2fd760cfae3 100644 --- a/storage/perfschema/table_events_stages.h +++ b/storage/perfschema/table_events_stages.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_events_statements.cc b/storage/perfschema/table_events_statements.cc index 1fb02eddc48..5e30f39c785 100644 --- a/storage/perfschema/table_events_statements.cc +++ b/storage/perfschema/table_events_statements.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -377,7 +377,7 @@ int table_events_statements_common::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 3); + assert(table->s->null_bytes == 3); buf[0]= 0; buf[1]= 0; buf[2]= 0; @@ -566,7 +566,7 @@ int table_events_statements_common::read_row_values(TABLE *table, set_field_ulong(f, m_row.m_nesting_event_level); break; default: - DBUG_ASSERT(false); + assert(false); } } } @@ -659,7 +659,7 @@ int table_events_statements_current::rnd_pos(const void *pos) return HA_ERR_RECORD_DELETED; } - DBUG_ASSERT(m_pos.m_index_2 < statement_stack_max); + assert(m_pos.m_index_2 < statement_stack_max); statement= &pfs_thread->m_statement_stack[m_pos.m_index_2]; @@ -781,13 +781,13 @@ int table_events_statements_history::rnd_pos(const void *pos) PFS_thread *pfs_thread; PFS_events_statements *statement; - DBUG_ASSERT(events_statements_history_per_thread != 0); + assert(events_statements_history_per_thread != 0); set_position(pos); pfs_thread= global_thread_container.get(m_pos.m_index_1); if (pfs_thread != NULL) { - DBUG_ASSERT(m_pos.m_index_2 < events_statements_history_per_thread); + assert(m_pos.m_index_2 < events_statements_history_per_thread); if ( ! pfs_thread->m_statements_history_full && (m_pos.m_index_2 >= pfs_thread->m_statements_history_index)) diff --git a/storage/perfschema/table_events_statements.h b/storage/perfschema/table_events_statements.h index 02127cadecc..5499c8d62ec 100644 --- a/storage/perfschema/table_events_statements.h +++ b/storage/perfschema/table_events_statements.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_events_transactions.cc b/storage/perfschema/table_events_transactions.cc index ef2575b4d8b..543d106ff26 100644 --- a/storage/perfschema/table_events_transactions.cc +++ b/storage/perfschema/table_events_transactions.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -261,8 +261,8 @@ static const ulong XID_BUFFER_SIZE= XIDDATASIZE*2 + 2 + 1; */ static size_t xid_to_hex(char *buf, size_t buf_len, PSI_xid *xid, size_t offset, size_t length) { - DBUG_ASSERT(buf_len >= XID_BUFFER_SIZE); - DBUG_ASSERT(offset + length <= XIDDATASIZE); + assert(buf_len >= XID_BUFFER_SIZE); + assert(offset + length <= XIDDATASIZE); *buf++= '0'; *buf++= 'x'; return bin_to_hex_str(buf, buf_len-2, (char*)(xid->data + offset), length) + 2; @@ -279,7 +279,7 @@ static size_t xid_to_hex(char *buf, size_t buf_len, PSI_xid *xid, size_t offset, */ static void xid_store(Field *field, PSI_xid *xid, size_t offset, size_t length) { - DBUG_ASSERT(!xid->is_null()); + assert(!xid->is_null()); if (xid_printable(xid, offset, length)) { field->store(xid->data + offset, length, &my_charset_bin); @@ -318,7 +318,7 @@ int table_events_transactions_common::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 3); + assert(table->s->null_bytes == 3); buf[0]= 0; buf[1]= 0; buf[2]= 0; @@ -436,7 +436,7 @@ int table_events_transactions_common::read_row_values(TABLE *table, f->set_null(); break; default: - DBUG_ASSERT(false); + assert(false); } } } @@ -591,10 +591,10 @@ int table_events_transactions_history::rnd_pos(const void *pos) PFS_thread *pfs_thread; PFS_events_transactions *transaction; - DBUG_ASSERT(events_transactions_history_per_thread != 0); + assert(events_transactions_history_per_thread != 0); set_position(pos); - DBUG_ASSERT(m_pos.m_index_2 < events_transactions_history_per_thread); + assert(m_pos.m_index_2 < events_transactions_history_per_thread); pfs_thread= global_thread_container.get(m_pos.m_index_1); if (pfs_thread != NULL) diff --git a/storage/perfschema/table_events_transactions.h b/storage/perfschema/table_events_transactions.h index 9987319abb2..b9f8f750d85 100644 --- a/storage/perfschema/table_events_transactions.h +++ b/storage/perfschema/table_events_transactions.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_events_waits.cc b/storage/perfschema/table_events_waits.cc index ae6530a0d48..a345c6fdf3a 100644 --- a/storage/perfschema/table_events_waits.cc +++ b/storage/perfschema/table_events_waits.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -656,7 +656,7 @@ int table_events_waits_common::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 2); + assert(table->s->null_bytes == 2); buf[0]= 0; buf[1]= 0; @@ -788,7 +788,7 @@ int table_events_waits_common::read_row_values(TABLE *table, f->set_null(); break; default: - DBUG_ASSERT(false); + assert(false); } } } @@ -907,7 +907,7 @@ int table_events_waits_current::rnd_pos(const void *pos) } #endif - DBUG_ASSERT(m_pos.m_index_2 < WAIT_STACK_LOGICAL_SIZE); + assert(m_pos.m_index_2 < WAIT_STACK_LOGICAL_SIZE); if (wait->m_wait_class != NO_WAIT_CLASS) { @@ -1008,13 +1008,13 @@ int table_events_waits_history::rnd_pos(const void *pos) PFS_thread *pfs_thread; PFS_events_waits *wait; - DBUG_ASSERT(events_waits_history_per_thread != 0); + assert(events_waits_history_per_thread != 0); set_position(pos); pfs_thread= global_thread_container.get(m_pos.m_index_1); if (pfs_thread != NULL) { - DBUG_ASSERT(m_pos.m_index_2 < events_waits_history_per_thread); + assert(m_pos.m_index_2 < events_waits_history_per_thread); if ( ! pfs_thread->m_waits_history_full && (m_pos.m_index_2 >= pfs_thread->m_waits_history_index)) diff --git a/storage/perfschema/table_events_waits.h b/storage/perfschema/table_events_waits.h index 9173ec30594..82d6f56bbb7 100644 --- a/storage/perfschema/table_events_waits.h +++ b/storage/perfschema/table_events_waits.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_events_waits_summary.cc b/storage/perfschema/table_events_waits_summary.cc index dfc89596469..b9565d54460 100644 --- a/storage/perfschema/table_events_waits_summary.cc +++ b/storage/perfschema/table_events_waits_summary.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -196,7 +196,7 @@ int table_events_waits_summary_by_instance return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); for (; (f= *fields) ; fields++) { @@ -226,7 +226,7 @@ int table_events_waits_summary_by_instance set_field_ulonglong(f, m_row.m_stat.m_max); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_events_waits_summary.h b/storage/perfschema/table_events_waits_summary.h index 51d8a62e02d..13d50a23760 100644 --- a/storage/perfschema/table_events_waits_summary.h +++ b/storage/perfschema/table_events_waits_summary.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ews_by_account_by_event_name.cc b/storage/perfschema/table_ews_by_account_by_event_name.cc index f04df499670..007f75e52eb 100644 --- a/storage/perfschema/table_ews_by_account_by_event_name.cc +++ b/storage/perfschema/table_ews_by_account_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -137,7 +137,7 @@ int table_ews_by_account_by_event_name::rnd_next(void) break; default: instr_class= NULL; - DBUG_ASSERT(false); + assert(false); break; } @@ -194,7 +194,7 @@ table_ews_by_account_by_event_name::rnd_pos(const void *pos) break; default: instr_class= NULL; - DBUG_ASSERT(false); + assert(false); } if (instr_class) { @@ -243,7 +243,7 @@ int table_ews_by_account_by_event_name return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) diff --git a/storage/perfschema/table_ews_by_account_by_event_name.h b/storage/perfschema/table_ews_by_account_by_event_name.h index e64a61b229c..4d626cf44cf 100644 --- a/storage/perfschema/table_ews_by_account_by_event_name.h +++ b/storage/perfschema/table_ews_by_account_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ews_by_host_by_event_name.cc b/storage/perfschema/table_ews_by_host_by_event_name.cc index 6d94dd851a5..3a1ee52b6e4 100644 --- a/storage/perfschema/table_ews_by_host_by_event_name.cc +++ b/storage/perfschema/table_ews_by_host_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -138,7 +138,7 @@ int table_ews_by_host_by_event_name::rnd_next(void) break; default: instr_class= NULL; - DBUG_ASSERT(false); + assert(false); break; } @@ -195,7 +195,7 @@ table_ews_by_host_by_event_name::rnd_pos(const void *pos) break; default: instr_class= NULL; - DBUG_ASSERT(false); + assert(false); break; } if (instr_class) @@ -246,7 +246,7 @@ int table_ews_by_host_by_event_name return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) diff --git a/storage/perfschema/table_ews_by_host_by_event_name.h b/storage/perfschema/table_ews_by_host_by_event_name.h index 074ec0be822..fb1060cb45e 100644 --- a/storage/perfschema/table_ews_by_host_by_event_name.h +++ b/storage/perfschema/table_ews_by_host_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ews_by_thread_by_event_name.cc b/storage/perfschema/table_ews_by_thread_by_event_name.cc index 89a34665e79..803e81b4a7b 100644 --- a/storage/perfschema/table_ews_by_thread_by_event_name.cc +++ b/storage/perfschema/table_ews_by_thread_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -134,7 +134,7 @@ int table_ews_by_thread_by_event_name::rnd_next(void) instr_class= find_metadata_class(m_pos.m_index_3); break; default: - DBUG_ASSERT(false); + assert(false); instr_class= NULL; break; } @@ -190,7 +190,7 @@ table_ews_by_thread_by_event_name::rnd_pos(const void *pos) instr_class= find_metadata_class(m_pos.m_index_3); break; default: - DBUG_ASSERT(false); + assert(false); instr_class= NULL; } @@ -253,7 +253,7 @@ int table_ews_by_thread_by_event_name return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); for (; (f= *fields) ; fields++) { diff --git a/storage/perfschema/table_ews_by_thread_by_event_name.h b/storage/perfschema/table_ews_by_thread_by_event_name.h index d3850e93c0a..85209f6fad4 100644 --- a/storage/perfschema/table_ews_by_thread_by_event_name.h +++ b/storage/perfschema/table_ews_by_thread_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ews_by_user_by_event_name.cc b/storage/perfschema/table_ews_by_user_by_event_name.cc index 446ce860792..d1e88da59aa 100644 --- a/storage/perfschema/table_ews_by_user_by_event_name.cc +++ b/storage/perfschema/table_ews_by_user_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -137,7 +137,7 @@ int table_ews_by_user_by_event_name::rnd_next(void) break; default: instr_class= NULL; - DBUG_ASSERT(false); + assert(false); break; } @@ -194,7 +194,7 @@ table_ews_by_user_by_event_name::rnd_pos(const void *pos) break; default: instr_class= NULL; - DBUG_ASSERT(false); + assert(false); break; } if (instr_class) @@ -245,7 +245,7 @@ int table_ews_by_user_by_event_name return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) diff --git a/storage/perfschema/table_ews_by_user_by_event_name.h b/storage/perfschema/table_ews_by_user_by_event_name.h index b088c8e2015..ffb2e9074b2 100644 --- a/storage/perfschema/table_ews_by_user_by_event_name.h +++ b/storage/perfschema/table_ews_by_user_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ews_global_by_event_name.cc b/storage/perfschema/table_ews_global_by_event_name.cc index eaea6c68176..d4853685a17 100644 --- a/storage/perfschema/table_ews_global_by_event_name.cc +++ b/storage/perfschema/table_ews_global_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -240,8 +240,8 @@ table_ews_global_by_event_name::rnd_pos(const void *pos) } break; case pos_ews_global_by_event_name::VIEW_TABLE: - DBUG_ASSERT(m_pos.m_index_2 >= 1); - DBUG_ASSERT(m_pos.m_index_2 <= 2); + assert(m_pos.m_index_2 >= 1); + assert(m_pos.m_index_2 <= 2); if (m_pos.m_index_2 == 1) make_table_io_row(&global_table_io_class); else @@ -272,7 +272,7 @@ table_ews_global_by_event_name::rnd_pos(const void *pos) } break; default: - DBUG_ASSERT(false); + assert(false); break; } @@ -414,7 +414,7 @@ int table_ews_global_by_event_name return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); for (; (f= *fields) ; fields++) { diff --git a/storage/perfschema/table_ews_global_by_event_name.h b/storage/perfschema/table_ews_global_by_event_name.h index a9deb97a52d..548f0af4666 100644 --- a/storage/perfschema/table_ews_global_by_event_name.h +++ b/storage/perfschema/table_ews_global_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_file_instances.cc b/storage/perfschema/table_file_instances.cc index ebd2371900d..abbaf0745b3 100644 --- a/storage/perfschema/table_file_instances.cc +++ b/storage/perfschema/table_file_instances.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -145,7 +145,7 @@ int table_file_instances::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); for (; (f= *fields) ; fields++) { @@ -164,7 +164,7 @@ int table_file_instances::read_row_values(TABLE *table, set_field_ulong(f, m_row.m_open_count); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_file_instances.h b/storage/perfschema/table_file_instances.h index cb3d39d46fb..1517e83035b 100644 --- a/storage/perfschema/table_file_instances.h +++ b/storage/perfschema/table_file_instances.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_file_summary_by_event_name.cc b/storage/perfschema/table_file_summary_by_event_name.cc index b6ecb35e6fa..e7c2d5559e6 100644 --- a/storage/perfschema/table_file_summary_by_event_name.cc +++ b/storage/perfschema/table_file_summary_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -167,7 +167,7 @@ int table_file_summary_by_event_name::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); for (; (f= *fields) ; fields++) { @@ -249,7 +249,7 @@ int table_file_summary_by_event_name::read_row_values(TABLE *table, break; default: - DBUG_ASSERT(false); + assert(false); break; } } // if diff --git a/storage/perfschema/table_file_summary_by_event_name.h b/storage/perfschema/table_file_summary_by_event_name.h index ae2124fe763..852b680262e 100644 --- a/storage/perfschema/table_file_summary_by_event_name.h +++ b/storage/perfschema/table_file_summary_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_file_summary_by_instance.cc b/storage/perfschema/table_file_summary_by_instance.cc index 854054b8b4e..2a41f9b7bff 100644 --- a/storage/perfschema/table_file_summary_by_instance.cc +++ b/storage/perfschema/table_file_summary_by_instance.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -181,7 +181,7 @@ int table_file_summary_by_instance::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); for (; (f= *fields) ; fields++) { @@ -269,7 +269,7 @@ int table_file_summary_by_instance::read_row_values(TABLE *table, set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_max); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_file_summary_by_instance.h b/storage/perfschema/table_file_summary_by_instance.h index 7ea90bac056..f0c3c1303fb 100644 --- a/storage/perfschema/table_file_summary_by_instance.h +++ b/storage/perfschema/table_file_summary_by_instance.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_global_status.cc b/storage/perfschema/table_global_status.cc index 53e6fddef7a..c68e501d819 100644 --- a/storage/perfschema/table_global_status.cc +++ b/storage/perfschema/table_global_status.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -164,7 +164,7 @@ int table_global_status return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -180,7 +180,7 @@ int table_global_status m_row.m_variable_value.set_field(f); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_global_status.h b/storage/perfschema/table_global_status.h index a97ea9d0041..53d7ca459c9 100644 --- a/storage/perfschema/table_global_status.h +++ b/storage/perfschema/table_global_status.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_global_variables.cc b/storage/perfschema/table_global_variables.cc index 117e06e36bf..67be7e4e99a 100644 --- a/storage/perfschema/table_global_variables.cc +++ b/storage/perfschema/table_global_variables.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -124,7 +124,7 @@ int table_global_variables::rnd_pos(const void *pos) return HA_ERR_RECORD_DELETED; set_position(pos); - DBUG_ASSERT(m_pos.m_index < m_sysvar_cache.size()); + assert(m_pos.m_index < m_sysvar_cache.size()); const System_variable *system_var= m_sysvar_cache.get(m_pos.m_index); if (system_var != NULL) @@ -158,7 +158,7 @@ int table_global_variables return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -174,7 +174,7 @@ int table_global_variables m_row.m_variable_value.set_field(f); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_global_variables.h b/storage/perfschema/table_global_variables.h index b9124e76f65..8a9bbd63574 100644 --- a/storage/perfschema/table_global_variables.h +++ b/storage/perfschema/table_global_variables.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_helper.cc b/storage/perfschema/table_helper.cc index 55b1397143e..0ae6f6c0786 100644 --- a/storage/perfschema/table_helper.cc +++ b/storage/perfschema/table_helper.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -107,7 +107,7 @@ void PFS_account_row::set_field(uint index, Field *f) f->set_null(); break; default: - DBUG_ASSERT(false); + assert(false); break; } } @@ -181,7 +181,7 @@ void PFS_digest_row::set_field(uint index, Field *f) f->set_null(); break; default: - DBUG_ASSERT(false); + assert(false); break; } } @@ -311,7 +311,7 @@ void PFS_object_row::set_field(uint index, Field *f) PFS_engine_table::set_field_varchar_utf8(f, m_object_name, m_object_name_length); break; default: - DBUG_ASSERT(false); + assert(false); } } @@ -338,7 +338,7 @@ void PFS_object_row::set_nullable_field(uint index, Field *f) f->set_null(); break; default: - DBUG_ASSERT(false); + assert(false); } } @@ -394,7 +394,7 @@ void PFS_index_row::set_field(uint index, Field *f) f->set_null(); break; default: - DBUG_ASSERT(false); + assert(false); } } @@ -467,7 +467,7 @@ void PFS_statement_stat_row::set_field(uint index, Field *f) PFS_engine_table::set_field_ulonglong(f, m_no_good_index_used); break; default: - DBUG_ASSERT(false); + assert(false); break; } } @@ -498,7 +498,7 @@ void PFS_transaction_stat_row::set_field(uint index, Field *f) m_read_only_row.set_field(index-10, f); break; default: - DBUG_ASSERT(false); + assert(false); break; } } @@ -514,7 +514,7 @@ void PFS_connection_stat_row::set_field(uint index, Field *f) PFS_engine_table::set_field_ulonglong(f, m_total_connections); break; default: - DBUG_ASSERT(false); + assert(false); break; } } @@ -555,7 +555,7 @@ void set_field_object_type(Field *f, enum_object_type object_type) break; case NO_OBJECT_TYPE: default: - DBUG_ASSERT(false); + assert(false); PFS_engine_table::set_field_varchar_utf8(f, "", 0); break; } @@ -599,7 +599,7 @@ void set_field_lock_type(Field *f, PFS_TL_LOCK_TYPE lock_type) f->set_null(); break; default: - DBUG_ASSERT(false); + assert(false); } } @@ -712,7 +712,7 @@ void set_field_mdl_duration(Field *f, opaque_mdl_duration mdl_duration) break; case MDL_DURATION_END: default: - DBUG_ASSERT(false); + assert(false); } } @@ -734,7 +734,7 @@ void set_field_mdl_status(Field *f, opaque_mdl_status mdl_status) PFS_engine_table::set_field_varchar_utf8(f, "POST_RELEASE_NOTIFY", 19); break; default: - DBUG_ASSERT(false); + assert(false); } } @@ -781,7 +781,7 @@ void PFS_memory_stat_row::set_field(uint index, Field *f) PFS_engine_table::set_field_longlong(f, val); break; default: - DBUG_ASSERT(false); + assert(false); break; } } @@ -803,7 +803,7 @@ void set_field_isolation_level(Field *f, enum_isolation_level iso_level) PFS_engine_table::set_field_varchar_utf8(f, "SERIALIZABLE", 12); break; default: - DBUG_ASSERT(false); + assert(false); } } @@ -830,14 +830,14 @@ void set_field_xa_state(Field *f, enum_xa_transaction_state xa_state) PFS_engine_table::set_field_varchar_utf8(f, "COMMITTED", 9); break; default: - DBUG_ASSERT(false); + assert(false); } } void PFS_variable_name_row::make_row(const char* str, size_t length) { - DBUG_ASSERT(length <= sizeof(m_str)); - DBUG_ASSERT(length <= NAME_CHAR_LEN); + assert(length <= sizeof(m_str)); + assert(length <= NAME_CHAR_LEN); m_length= MY_MIN(static_cast<uint>(length), NAME_CHAR_LEN); /* enforce max name length */ if (m_length > 0) @@ -857,8 +857,8 @@ void PFS_variable_value_row::make_row(const System_variable *var) void PFS_variable_value_row::make_row(const CHARSET_INFO *cs, const char* str, size_t length) { - DBUG_ASSERT(cs != NULL); - DBUG_ASSERT(length <= sizeof(m_str)); + assert(cs != NULL); + assert(length <= sizeof(m_str)); if (length > 0) { memcpy(m_str, str, length); diff --git a/storage/perfschema/table_helper.h b/storage/perfschema/table_helper.h index 3ce74648360..c7e4bf4dfb5 100644 --- a/storage/perfschema/table_helper.h +++ b/storage/perfschema/table_helper.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -278,7 +278,7 @@ struct PFS_stat_row PFS_engine_table::set_field_ulonglong(f, m_max); break; default: - DBUG_ASSERT(false); + assert(false); } } }; diff --git a/storage/perfschema/table_host_cache.cc b/storage/perfschema/table_host_cache.cc index 6fbafea4c88..1c1cba60b0d 100644 --- a/storage/perfschema/table_host_cache.cc +++ b/storage/perfschema/table_host_cache.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -84,7 +84,7 @@ PFS_engine_table* table_host_cache::create(void) if (t != NULL) { THD *thd= current_thd; - DBUG_ASSERT(thd != NULL); + assert(thd != NULL); t->materialize(thd); } return t; @@ -127,8 +127,8 @@ void table_host_cache::materialize(THD *thd) row_host_cache *rows; row_host_cache *row; - DBUG_ASSERT(m_all_rows == NULL); - DBUG_ASSERT(m_row_count == 0); + assert(m_all_rows == NULL); + assert(m_row_count == 0); hostname_cache_lock(); @@ -241,7 +241,7 @@ int table_host_cache::rnd_next(void) int table_host_cache::rnd_pos(const void *pos) { set_position(pos); - DBUG_ASSERT(m_pos.m_index < m_row_count); + assert(m_pos.m_index < m_row_count); m_row= &m_all_rows[m_pos.m_index]; return 0; } @@ -253,10 +253,10 @@ int table_host_cache::read_row_values(TABLE *table, { Field *f; - DBUG_ASSERT(m_row); + assert(m_row); /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -362,7 +362,7 @@ int table_host_cache::read_row_values(TABLE *table, f->set_null(); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_host_cache.h b/storage/perfschema/table_host_cache.h index 57cd0fa02ad..5680a49675f 100644 --- a/storage/perfschema/table_host_cache.h +++ b/storage/perfschema/table_host_cache.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_hosts.cc b/storage/perfschema/table_hosts.cc index ccf8b7e7896..7c6f6212bb8 100644 --- a/storage/perfschema/table_hosts.cc +++ b/storage/perfschema/table_hosts.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -123,7 +123,7 @@ int table_hosts::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -140,7 +140,7 @@ int table_hosts::read_row_values(TABLE *table, m_row.m_connection_stat.set_field(f->field_index - 1, f); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_hosts.h b/storage/perfschema/table_hosts.h index 61c04d12179..51bc7f2f2a7 100644 --- a/storage/perfschema/table_hosts.h +++ b/storage/perfschema/table_hosts.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_md_locks.cc b/storage/perfschema/table_md_locks.cc index a6bfdd25b68..d7e3423d9bc 100644 --- a/storage/perfschema/table_md_locks.cc +++ b/storage/perfschema/table_md_locks.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2012, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -155,7 +155,7 @@ int table_metadata_locks::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -197,7 +197,7 @@ int table_metadata_locks::read_row_values(TABLE *table, f->set_null(); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_md_locks.h b/storage/perfschema/table_md_locks.h index 40b6d2f6efb..c6a4a2eca8d 100644 --- a/storage/perfschema/table_md_locks.h +++ b/storage/perfschema/table_md_locks.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2012, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_mems_by_account_by_event_name.cc b/storage/perfschema/table_mems_by_account_by_event_name.cc index 7a0254d91a2..c4217641f6a 100644 --- a/storage/perfschema/table_mems_by_account_by_event_name.cc +++ b/storage/perfschema/table_mems_by_account_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -193,7 +193,7 @@ int table_mems_by_account_by_event_name::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) diff --git a/storage/perfschema/table_mems_by_account_by_event_name.h b/storage/perfschema/table_mems_by_account_by_event_name.h index b6151246f34..9d43c4cf404 100644 --- a/storage/perfschema/table_mems_by_account_by_event_name.h +++ b/storage/perfschema/table_mems_by_account_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_mems_by_host_by_event_name.cc b/storage/perfschema/table_mems_by_host_by_event_name.cc index 4b91d0420d5..b86fe70da28 100644 --- a/storage/perfschema/table_mems_by_host_by_event_name.cc +++ b/storage/perfschema/table_mems_by_host_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -194,7 +194,7 @@ int table_mems_by_host_by_event_name::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) diff --git a/storage/perfschema/table_mems_by_host_by_event_name.h b/storage/perfschema/table_mems_by_host_by_event_name.h index 1a55db2c9b3..a4fdde24fbd 100644 --- a/storage/perfschema/table_mems_by_host_by_event_name.h +++ b/storage/perfschema/table_mems_by_host_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_mems_by_thread_by_event_name.cc b/storage/perfschema/table_mems_by_thread_by_event_name.cc index 3c25e948cbf..8c79f8cc8d8 100644 --- a/storage/perfschema/table_mems_by_thread_by_event_name.cc +++ b/storage/perfschema/table_mems_by_thread_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -188,7 +188,7 @@ int table_mems_by_thread_by_event_name::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); for (; (f= *fields) ; fields++) { diff --git a/storage/perfschema/table_mems_by_thread_by_event_name.h b/storage/perfschema/table_mems_by_thread_by_event_name.h index f8608198c2a..b89172669e6 100644 --- a/storage/perfschema/table_mems_by_thread_by_event_name.h +++ b/storage/perfschema/table_mems_by_thread_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_mems_by_user_by_event_name.cc b/storage/perfschema/table_mems_by_user_by_event_name.cc index dbb4b19c430..4bae383166a 100644 --- a/storage/perfschema/table_mems_by_user_by_event_name.cc +++ b/storage/perfschema/table_mems_by_user_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -194,7 +194,7 @@ int table_mems_by_user_by_event_name::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) diff --git a/storage/perfschema/table_mems_by_user_by_event_name.h b/storage/perfschema/table_mems_by_user_by_event_name.h index 2791e1d3587..34c4cd518ae 100644 --- a/storage/perfschema/table_mems_by_user_by_event_name.h +++ b/storage/perfschema/table_mems_by_user_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_mems_global_by_event_name.cc b/storage/perfschema/table_mems_global_by_event_name.cc index 4a6f7e86fed..e4b681072c8 100644 --- a/storage/perfschema/table_mems_global_by_event_name.cc +++ b/storage/perfschema/table_mems_global_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -218,7 +218,7 @@ int table_mems_global_by_event_name::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); for (; (f= *fields) ; fields++) { diff --git a/storage/perfschema/table_mems_global_by_event_name.h b/storage/perfschema/table_mems_global_by_event_name.h index 14a54142f4e..46dbccbd414 100644 --- a/storage/perfschema/table_mems_global_by_event_name.h +++ b/storage/perfschema/table_mems_global_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_os_global_by_type.cc b/storage/perfschema/table_os_global_by_type.cc index 04592e70f41..b82ce9c2a7d 100644 --- a/storage/perfschema/table_os_global_by_type.cc +++ b/storage/perfschema/table_os_global_by_type.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -257,7 +257,7 @@ int table_os_global_by_type::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -293,7 +293,7 @@ int table_os_global_by_type::read_row_values(TABLE *table, set_field_ulonglong(f, m_row.m_stat.m_max); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_os_global_by_type.h b/storage/perfschema/table_os_global_by_type.h index 37e6db1ed94..9cb3b47b964 100644 --- a/storage/perfschema/table_os_global_by_type.h +++ b/storage/perfschema/table_os_global_by_type.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_performance_timers.cc b/storage/perfschema/table_performance_timers.cc index 5f8714a356d..68878919e2b 100644 --- a/storage/perfschema/table_performance_timers.cc +++ b/storage/perfschema/table_performance_timers.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -121,7 +121,7 @@ int table_performance_timers::rnd_next(void) int table_performance_timers::rnd_pos(const void *pos) { set_position(pos); - DBUG_ASSERT(m_pos.m_index < COUNT_TIMER_NAME); + assert(m_pos.m_index < COUNT_TIMER_NAME); m_row= &m_data[m_pos.m_index]; return 0; } @@ -133,10 +133,10 @@ int table_performance_timers::read_row_values(TABLE *table, { Field *f; - DBUG_ASSERT(m_row); + assert(m_row); /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -167,7 +167,7 @@ int table_performance_timers::read_row_values(TABLE *table, f->set_null(); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_performance_timers.h b/storage/perfschema/table_performance_timers.h index fe5f9cd5f4a..a2e12a4f824 100644 --- a/storage/perfschema/table_performance_timers.h +++ b/storage/perfschema/table_performance_timers.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_prepared_stmt_instances.cc b/storage/perfschema/table_prepared_stmt_instances.cc index c63827ec0ed..592386db4bb 100644 --- a/storage/perfschema/table_prepared_stmt_instances.cc +++ b/storage/perfschema/table_prepared_stmt_instances.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2014, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -218,7 +218,7 @@ int table_prepared_stmt_instances /* Set the null bits. */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) diff --git a/storage/perfschema/table_prepared_stmt_instances.h b/storage/perfschema/table_prepared_stmt_instances.h index a17184d4312..a061e0d9883 100644 --- a/storage/perfschema/table_prepared_stmt_instances.h +++ b/storage/perfschema/table_prepared_stmt_instances.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2014, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_applier_configuration.cc b/storage/perfschema/table_replication_applier_configuration.cc index a9e3aabd2d9..c9b0163bc76 100644 --- a/storage/perfschema/table_replication_applier_configuration.cc +++ b/storage/perfschema/table_replication_applier_configuration.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -172,7 +172,7 @@ int table_replication_applier_configuration::read_row_values(TABLE *table, set_field_ulong(f, static_cast<ulong>(m_row.desired_delay)); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_replication_applier_configuration.h b/storage/perfschema/table_replication_applier_configuration.h index d13ce7ffaef..eadea0cb7f2 100644 --- a/storage/perfschema/table_replication_applier_configuration.h +++ b/storage/perfschema/table_replication_applier_configuration.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_applier_status.cc b/storage/perfschema/table_replication_applier_status.cc index c258eb244fd..c95acf0adfb 100644 --- a/storage/perfschema/table_replication_applier_status.cc +++ b/storage/perfschema/table_replication_applier_status.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -187,7 +187,7 @@ int table_replication_applier_status::read_row_values(TABLE *table, if (unlikely(! m_row_exists)) return HA_ERR_RECORD_DELETED; - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -212,7 +212,7 @@ int table_replication_applier_status::read_row_values(TABLE *table, set_field_ulonglong(f, m_row.count_transactions_retries); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_replication_applier_status.h b/storage/perfschema/table_replication_applier_status.h index 04e5799e3b4..06cbc9fd22b 100644 --- a/storage/perfschema/table_replication_applier_status.h +++ b/storage/perfschema/table_replication_applier_status.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_applier_status_by_coordinator.cc b/storage/perfschema/table_replication_applier_status_by_coordinator.cc index c71aed0a359..9066e9384d4 100644 --- a/storage/perfschema/table_replication_applier_status_by_coordinator.cc +++ b/storage/perfschema/table_replication_applier_status_by_coordinator.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -219,7 +219,7 @@ int table_replication_applier_status_by_coordinator if (unlikely(! m_row_exists)) return HA_ERR_RECORD_DELETED; - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -260,7 +260,7 @@ int table_replication_applier_status_by_coordinator break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_replication_applier_status_by_coordinator.h b/storage/perfschema/table_replication_applier_status_by_coordinator.h index 460fc918b5e..32acc32988d 100644 --- a/storage/perfschema/table_replication_applier_status_by_coordinator.h +++ b/storage/perfschema/table_replication_applier_status_by_coordinator.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_applier_status_by_worker.cc b/storage/perfschema/table_replication_applier_status_by_worker.cc index 083da44dd49..934d68a566c 100644 --- a/storage/perfschema/table_replication_applier_status_by_worker.cc +++ b/storage/perfschema/table_replication_applier_status_by_worker.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -239,7 +239,7 @@ int table_replication_applier_status_by_worker if (unlikely(! m_row_exists)) return HA_ERR_RECORD_DELETED; - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -279,7 +279,7 @@ int table_replication_applier_status_by_worker set_field_ulong(f, m_row.last_trans_retry_count); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_replication_applier_status_by_worker.h b/storage/perfschema/table_replication_applier_status_by_worker.h index 5aacf053fea..37d31fee5c8 100644 --- a/storage/perfschema/table_replication_applier_status_by_worker.h +++ b/storage/perfschema/table_replication_applier_status_by_worker.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_connection_configuration.cc b/storage/perfschema/table_replication_connection_configuration.cc index abcc2070dd1..c3657725a65 100644 --- a/storage/perfschema/table_replication_connection_configuration.cc +++ b/storage/perfschema/table_replication_connection_configuration.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -182,7 +182,7 @@ void table_replication_connection_configuration::make_row(Master_info *mi) m_row_exists= false; - DBUG_ASSERT(mi != NULL); + assert(mi != NULL); mysql_mutex_lock(&mi->data_lock); mysql_mutex_lock(&mi->rli.data_lock); @@ -297,7 +297,7 @@ int table_replication_connection_configuration::read_row_values(TABLE *table, if (unlikely(! m_row_exists)) return HA_ERR_RECORD_DELETED; - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); for (; (f= *fields) ; fields++) { @@ -375,7 +375,7 @@ int table_replication_connection_configuration::read_row_values(TABLE *table, break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_replication_connection_configuration.h b/storage/perfschema/table_replication_connection_configuration.h index 95029f53565..7aedcf9c6bc 100644 --- a/storage/perfschema/table_replication_connection_configuration.h +++ b/storage/perfschema/table_replication_connection_configuration.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_connection_status.cc b/storage/perfschema/table_replication_connection_status.cc index a4230913917..fd0b5309f7e 100644 --- a/storage/perfschema/table_replication_connection_status.cc +++ b/storage/perfschema/table_replication_connection_status.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -249,8 +249,8 @@ void table_replication_connection_status::make_row(Master_info *mi) m_row.thread_id_is_null= true; m_row.service_state= PS_RPL_CONNECT_SERVICE_STATE_NO; - DBUG_ASSERT(mi != NULL); - DBUG_ASSERT(mi->rli != NULL); + assert(mi != NULL); + assert(mi->rli != NULL); mysql_mutex_lock(&mi->data_lock); mysql_mutex_lock(&mi->rli->data_lock); @@ -376,7 +376,7 @@ int table_replication_connection_status::read_row_values(TABLE *table, if (unlikely(! m_row_exists)) return HA_ERR_RECORD_DELETED; - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -430,7 +430,7 @@ int table_replication_connection_status::read_row_values(TABLE *table, set_field_timestamp(f, m_row.last_error_timestamp); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_replication_connection_status.h b/storage/perfschema/table_replication_connection_status.h index a1a5eb116bc..596a4e9ed49 100644 --- a/storage/perfschema/table_replication_connection_status.h +++ b/storage/perfschema/table_replication_connection_status.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_group_member_stats.cc b/storage/perfschema/table_replication_group_member_stats.cc index f85a3e3f099..7d15e383d70 100644 --- a/storage/perfschema/table_replication_group_member_stats.cc +++ b/storage/perfschema/table_replication_group_member_stats.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2014, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -263,7 +263,7 @@ int table_replication_group_member_stats::rnd_pos(const void *pos) return HA_ERR_END_OF_FILE; set_position(pos); - DBUG_ASSERT(m_pos.m_index < 1); + assert(m_pos.m_index < 1); make_row(); return 0; @@ -323,7 +323,7 @@ int table_replication_group_member_stats::read_row_values(TABLE *table, if (unlikely(! m_row_exists)) return HA_ERR_RECORD_DELETED; - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -364,7 +364,7 @@ int table_replication_group_member_stats::read_row_values(TABLE *table, break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_replication_group_member_stats.h b/storage/perfschema/table_replication_group_member_stats.h index f2fcaf553b4..67a05cb8e53 100644 --- a/storage/perfschema/table_replication_group_member_stats.h +++ b/storage/perfschema/table_replication_group_member_stats.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2014, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_group_members.cc b/storage/perfschema/table_replication_group_members.cc index 5967b98c7cc..2a870e58ce3 100644 --- a/storage/perfschema/table_replication_group_members.cc +++ b/storage/perfschema/table_replication_group_members.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -193,7 +193,7 @@ int table_replication_group_members::rnd_pos(const void *pos) return HA_ERR_END_OF_FILE; set_position(pos); - DBUG_ASSERT(m_pos.m_index < get_row_count()); + assert(m_pos.m_index < get_row_count()); make_row(m_pos.m_index); return 0; @@ -245,7 +245,7 @@ int table_replication_group_members::read_row_values(TABLE *table, if (unlikely(! m_row_exists)) return HA_ERR_RECORD_DELETED; - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -273,7 +273,7 @@ int table_replication_group_members::read_row_values(TABLE *table, set_field_char_utf8(f, m_row.member_state, m_row.member_state_length); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_replication_group_members.h b/storage/perfschema/table_replication_group_members.h index 8ce875eba3a..2df013fa35b 100644 --- a/storage/perfschema/table_replication_group_members.h +++ b/storage/perfschema/table_replication_group_members.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_session_account_connect_attrs.cc b/storage/perfschema/table_session_account_connect_attrs.cc index 90c9fa37d6d..563ce03d638 100644 --- a/storage/perfschema/table_session_account_connect_attrs.cc +++ b/storage/perfschema/table_session_account_connect_attrs.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -63,7 +63,7 @@ table_session_account_connect_attrs::thread_fits(PFS_thread *thread) return false; /* The thread we compare to, by definition, has some instrumentation. */ - DBUG_ASSERT(thread != NULL); + assert(thread != NULL); uint username_length= current_thread->m_username_length; uint hostname_length= current_thread->m_hostname_length; diff --git a/storage/perfschema/table_session_account_connect_attrs.h b/storage/perfschema/table_session_account_connect_attrs.h index 043f83da184..dec5295808d 100644 --- a/storage/perfschema/table_session_account_connect_attrs.h +++ b/storage/perfschema/table_session_account_connect_attrs.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2012, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_session_connect.cc b/storage/perfschema/table_session_connect.cc index 09f32feaa4d..dfb203c5d46 100644 --- a/storage/perfschema/table_session_connect.cc +++ b/storage/perfschema/table_session_connect.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -250,7 +250,7 @@ int table_session_connect::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -280,7 +280,7 @@ int table_session_connect::read_row_values(TABLE *table, set_field_ulong(f, m_row.m_ordinal_position); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_session_connect.h b/storage/perfschema/table_session_connect.h index 55433e2571a..b9be1ce304c 100644 --- a/storage/perfschema/table_session_connect.h +++ b/storage/perfschema/table_session_connect.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2012, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_session_connect_attrs.cc b/storage/perfschema/table_session_connect_attrs.cc index d0090374ddd..034ff12c91e 100644 --- a/storage/perfschema/table_session_connect_attrs.cc +++ b/storage/perfschema/table_session_connect_attrs.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_session_connect_attrs.h b/storage/perfschema/table_session_connect_attrs.h index 09b9d1c49e1..823207726f3 100644 --- a/storage/perfschema/table_session_connect_attrs.h +++ b/storage/perfschema/table_session_connect_attrs.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2012, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_session_status.cc b/storage/perfschema/table_session_status.cc index b9e19b99a69..05795af4f3c 100644 --- a/storage/perfschema/table_session_status.cc +++ b/storage/perfschema/table_session_status.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -123,7 +123,7 @@ table_session_status::rnd_pos(const void *pos) return HA_ERR_RECORD_DELETED; set_position(pos); - DBUG_ASSERT(m_pos.m_index < m_status_cache.size()); + assert(m_pos.m_index < m_status_cache.size()); if (m_status_cache.is_materialized()) { @@ -159,7 +159,7 @@ int table_session_status return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -175,7 +175,7 @@ int table_session_status m_row.m_variable_value.set_field(f); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_session_status.h b/storage/perfschema/table_session_status.h index 24634fe47b5..ed42d3fc57d 100644 --- a/storage/perfschema/table_session_status.h +++ b/storage/perfschema/table_session_status.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_session_variables.cc b/storage/perfschema/table_session_variables.cc index 3ed1314535e..dd6914d81c8 100644 --- a/storage/perfschema/table_session_variables.cc +++ b/storage/perfschema/table_session_variables.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -124,7 +124,7 @@ int table_session_variables::rnd_pos(const void *pos) return HA_ERR_RECORD_DELETED; set_position(pos); - DBUG_ASSERT(m_pos.m_index < m_sysvar_cache.size()); + assert(m_pos.m_index < m_sysvar_cache.size()); if (m_sysvar_cache.is_materialized()) { @@ -161,7 +161,7 @@ int table_session_variables return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -177,7 +177,7 @@ int table_session_variables m_row.m_variable_value.set_field(f); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_session_variables.h b/storage/perfschema/table_session_variables.h index 576bf73edbb..a32b7483bce 100644 --- a/storage/perfschema/table_session_variables.h +++ b/storage/perfschema/table_session_variables.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_setup_actors.cc b/storage/perfschema/table_setup_actors.cc index 3dadf9a031e..03f42cb6433 100644 --- a/storage/perfschema/table_setup_actors.cc +++ b/storage/perfschema/table_setup_actors.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -100,7 +100,7 @@ int table_setup_actors::write_row(TABLE *table, const unsigned char *buf, history_value= (enum_yes_no) get_field_enum(f); break; default: - DBUG_ASSERT(false); + assert(false); } } } @@ -221,7 +221,7 @@ int table_setup_actors::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); for (; (f= *fields) ; fields++) { @@ -245,7 +245,7 @@ int table_setup_actors::read_row_values(TABLE *table, set_field_enum(f, (*m_row.m_history_ptr) ? ENUM_YES : ENUM_NO); break; default: - DBUG_ASSERT(false); + assert(false); } } } @@ -287,7 +287,7 @@ int table_setup_actors::update_row_values(TABLE *table, *m_row.m_history_ptr= (value == ENUM_YES) ? true : false; break; default: - DBUG_ASSERT(false); + assert(false); } } } @@ -300,7 +300,7 @@ int table_setup_actors::delete_row_values(TABLE *table, const unsigned char *buf, Field **fields) { - DBUG_ASSERT(m_row_exists); + assert(m_row_exists); CHARSET_INFO *cs= &my_charset_utf8mb3_bin; String user(m_row.m_username, m_row.m_username_length, cs); diff --git a/storage/perfschema/table_setup_actors.h b/storage/perfschema/table_setup_actors.h index 32a603317b9..f9c316e3396 100644 --- a/storage/perfschema/table_setup_actors.h +++ b/storage/perfschema/table_setup_actors.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_setup_consumers.cc b/storage/perfschema/table_setup_consumers.cc index 02f4dc0009f..88e689b9ff8 100644 --- a/storage/perfschema/table_setup_consumers.cc +++ b/storage/perfschema/table_setup_consumers.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -194,7 +194,7 @@ int table_setup_consumers::rnd_next(void) int table_setup_consumers::rnd_pos(const void *pos) { set_position(pos); - DBUG_ASSERT(m_pos.m_index < COUNT_SETUP_CONSUMERS); + assert(m_pos.m_index < COUNT_SETUP_CONSUMERS); m_row= &all_setup_consumers_data[m_pos.m_index]; return 0; } @@ -206,11 +206,11 @@ int table_setup_consumers::read_row_values(TABLE *table, { Field *f; - DBUG_ASSERT(m_row); + assert(m_row); /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); for (; (f= *fields) ; fields++) { @@ -225,7 +225,7 @@ int table_setup_consumers::read_row_values(TABLE *table, set_field_enum(f, (*m_row->m_enabled_ptr) ? ENUM_YES : ENUM_NO); break; default: - DBUG_ASSERT(false); + assert(false); } } } @@ -241,7 +241,7 @@ int table_setup_consumers::update_row_values(TABLE *table, Field *f; enum_yes_no value; - DBUG_ASSERT(m_row); + assert(m_row); for (; (f= *fields) ; fields++) { @@ -258,7 +258,7 @@ int table_setup_consumers::update_row_values(TABLE *table, break; } default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_setup_consumers.h b/storage/perfschema/table_setup_consumers.h index 9d601622adf..77cd09dcfbb 100644 --- a/storage/perfschema/table_setup_consumers.h +++ b/storage/perfschema/table_setup_consumers.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_setup_instruments.cc b/storage/perfschema/table_setup_instruments.cc index 077c2a07b4f..86682b8a1d0 100644 --- a/storage/perfschema/table_setup_instruments.cc +++ b/storage/perfschema/table_setup_instruments.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -255,7 +255,7 @@ int table_setup_instruments::read_row_values(TABLE *table, { Field *f; - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); /* The row always exist, the instrument classes @@ -278,7 +278,7 @@ int table_setup_instruments::read_row_values(TABLE *table, set_field_enum(f, m_row.m_instr_class->m_timed ? ENUM_YES : ENUM_NO); break; default: - DBUG_ASSERT(false); + assert(false); } } } @@ -319,7 +319,7 @@ int table_setup_instruments::update_row_values(TABLE *table, } break; default: - DBUG_ASSERT(false); + assert(false); } } } @@ -363,7 +363,7 @@ int table_setup_instruments::update_row_values(TABLE *table, update_metadata_derived_flags(); break; default: - DBUG_ASSERT(false); + assert(false); break; } diff --git a/storage/perfschema/table_setup_instruments.h b/storage/perfschema/table_setup_instruments.h index 42aa2dd91d0..59378824236 100644 --- a/storage/perfschema/table_setup_instruments.h +++ b/storage/perfschema/table_setup_instruments.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_setup_objects.cc b/storage/perfschema/table_setup_objects.cc index 41551617a99..b71d3b7afa9 100644 --- a/storage/perfschema/table_setup_objects.cc +++ b/storage/perfschema/table_setup_objects.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -113,7 +113,7 @@ int table_setup_objects::write_row(TABLE *table, const unsigned char *buf, timed_value= (enum_yes_no) get_field_enum(f); break; default: - DBUG_ASSERT(false); + assert(false); } } } @@ -230,7 +230,7 @@ int table_setup_objects::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -263,7 +263,7 @@ int table_setup_objects::read_row_values(TABLE *table, set_field_enum(f, (*m_row.m_timed_ptr) ? ENUM_YES : ENUM_NO); break; default: - DBUG_ASSERT(false); + assert(false); } } } @@ -305,7 +305,7 @@ int table_setup_objects::update_row_values(TABLE *table, *m_row.m_timed_ptr= (value == ENUM_YES) ? true : false; break; default: - DBUG_ASSERT(false); + assert(false); } } } @@ -318,7 +318,7 @@ int table_setup_objects::delete_row_values(TABLE *table, const unsigned char *buf, Field **fields) { - DBUG_ASSERT(m_row_exists); + assert(m_row_exists); CHARSET_INFO *cs= &my_charset_utf8mb3_bin; enum_object_type object_type= OBJECT_TYPE_TABLE; diff --git a/storage/perfschema/table_setup_objects.h b/storage/perfschema/table_setup_objects.h index abe36f73818..feca8fc2f74 100644 --- a/storage/perfschema/table_setup_objects.h +++ b/storage/perfschema/table_setup_objects.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_setup_timers.cc b/storage/perfschema/table_setup_timers.cc index fe8931a443e..b8b70981a36 100644 --- a/storage/perfschema/table_setup_timers.cc +++ b/storage/perfschema/table_setup_timers.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -131,7 +131,7 @@ int table_setup_timers::rnd_next(void) int table_setup_timers::rnd_pos(const void *pos) { set_position(pos); - DBUG_ASSERT(m_pos.m_index < COUNT_SETUP_TIMERS); + assert(m_pos.m_index < COUNT_SETUP_TIMERS); m_row= &all_setup_timers_data[m_pos.m_index]; return 0; } @@ -143,10 +143,10 @@ int table_setup_timers::read_row_values(TABLE *table, { Field *f; - DBUG_ASSERT(m_row); + assert(m_row); /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); for (; (f= *fields) ; fields++) { @@ -161,7 +161,7 @@ int table_setup_timers::read_row_values(TABLE *table, set_field_enum(f, *(m_row->m_timer_name_ptr)); break; default: - DBUG_ASSERT(false); + assert(false); } } } @@ -177,7 +177,7 @@ int table_setup_timers::update_row_values(TABLE *table, Field *f; longlong value; - DBUG_ASSERT(m_row); + assert(m_row); for (; (f= *fields) ; fields++) { @@ -195,7 +195,7 @@ int table_setup_timers::update_row_values(TABLE *table, return HA_ERR_WRONG_COMMAND; break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_setup_timers.h b/storage/perfschema/table_setup_timers.h index 43100bf3dd0..9237fa2a059 100644 --- a/storage/perfschema/table_setup_timers.h +++ b/storage/perfschema/table_setup_timers.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_socket_instances.cc b/storage/perfschema/table_socket_instances.cc index b976f981848..ee1818b900b 100644 --- a/storage/perfschema/table_socket_instances.cc +++ b/storage/perfschema/table_socket_instances.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -164,7 +164,7 @@ int table_socket_instances::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -198,7 +198,7 @@ int table_socket_instances::read_row_values(TABLE *table, set_field_enum(f, m_row.m_state); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_socket_instances.h b/storage/perfschema/table_socket_instances.h index 4e32bbdcd00..30f18086c3a 100644 --- a/storage/perfschema/table_socket_instances.h +++ b/storage/perfschema/table_socket_instances.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_socket_summary_by_event_name.cc b/storage/perfschema/table_socket_summary_by_event_name.cc index f5214a4ea25..6efab95d5b1 100644 --- a/storage/perfschema/table_socket_summary_by_event_name.cc +++ b/storage/perfschema/table_socket_summary_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -162,7 +162,7 @@ int table_socket_summary_by_event_name::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); for (; (f= *fields) ; fields++) { @@ -244,7 +244,7 @@ int table_socket_summary_by_event_name::read_row_values(TABLE *table, break; default: - DBUG_ASSERT(false); + assert(false); break; } } // if diff --git a/storage/perfschema/table_socket_summary_by_event_name.h b/storage/perfschema/table_socket_summary_by_event_name.h index e25d38b9bfa..39361b54bb5 100644 --- a/storage/perfschema/table_socket_summary_by_event_name.h +++ b/storage/perfschema/table_socket_summary_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_socket_summary_by_instance.cc b/storage/perfschema/table_socket_summary_by_instance.cc index bbd57e73be7..4bb7a2af773 100644 --- a/storage/perfschema/table_socket_summary_by_instance.cc +++ b/storage/perfschema/table_socket_summary_by_instance.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -176,7 +176,7 @@ int table_socket_summary_by_instance::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); for (; (f= *fields) ; fields++) { @@ -261,7 +261,7 @@ int table_socket_summary_by_instance::read_row_values(TABLE *table, set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_max); break; default: - DBUG_ASSERT(false); + assert(false); break; } } diff --git a/storage/perfschema/table_socket_summary_by_instance.h b/storage/perfschema/table_socket_summary_by_instance.h index 3f6d1295728..39a02c939b5 100644 --- a/storage/perfschema/table_socket_summary_by_instance.h +++ b/storage/perfschema/table_socket_summary_by_instance.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_status_by_account.cc b/storage/perfschema/table_status_by_account.cc index 6868fab1186..347012bc064 100644 --- a/storage/perfschema/table_status_by_account.cc +++ b/storage/perfschema/table_status_by_account.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -164,7 +164,7 @@ table_status_by_account::rnd_pos(const void *pos) return HA_ERR_END_OF_FILE; set_position(pos); - DBUG_ASSERT(m_pos.m_index_1 < global_account_container.get_row_count()); + assert(m_pos.m_index_1 < global_account_container.get_row_count()); PFS_account *pfs_account= global_account_container.get(m_pos.m_index_1); @@ -216,7 +216,7 @@ int table_status_by_account return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -236,7 +236,7 @@ int table_status_by_account m_row.m_variable_value.set_field(f); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_status_by_account.h b/storage/perfschema/table_status_by_account.h index 401a184d8f1..19a4f1db1de 100644 --- a/storage/perfschema/table_status_by_account.h +++ b/storage/perfschema/table_status_by_account.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_status_by_host.cc b/storage/perfschema/table_status_by_host.cc index 756414ff06a..6b280011565 100644 --- a/storage/perfschema/table_status_by_host.cc +++ b/storage/perfschema/table_status_by_host.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -164,7 +164,7 @@ table_status_by_host::rnd_pos(const void *pos) return HA_ERR_END_OF_FILE; set_position(pos); - DBUG_ASSERT(m_pos.m_index_1 < global_host_container.get_row_count()); + assert(m_pos.m_index_1 < global_host_container.get_row_count()); PFS_host *pfs_host= global_host_container.get(m_pos.m_index_1); @@ -216,7 +216,7 @@ int table_status_by_host return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -235,7 +235,7 @@ int table_status_by_host m_row.m_variable_value.set_field(f); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_status_by_host.h b/storage/perfschema/table_status_by_host.h index e4c6bf256ef..f1c92268b02 100644 --- a/storage/perfschema/table_status_by_host.h +++ b/storage/perfschema/table_status_by_host.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_status_by_thread.cc b/storage/perfschema/table_status_by_thread.cc index 4c09dfc2b70..984a15b26eb 100644 --- a/storage/perfschema/table_status_by_thread.cc +++ b/storage/perfschema/table_status_by_thread.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -157,7 +157,7 @@ table_status_by_thread::rnd_pos(const void *pos) return HA_ERR_RECORD_DELETED; set_position(pos); - DBUG_ASSERT(m_pos.m_index_1 < global_thread_container.get_row_count()); + assert(m_pos.m_index_1 < global_thread_container.get_row_count()); PFS_thread *pfs_thread= global_thread_container.get(m_pos.m_index_1); /* @@ -210,7 +210,7 @@ int table_status_by_thread return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -229,7 +229,7 @@ int table_status_by_thread m_row.m_variable_value.set_field(f); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_status_by_thread.h b/storage/perfschema/table_status_by_thread.h index f8de21dc41e..90a1735d1e2 100644 --- a/storage/perfschema/table_status_by_thread.h +++ b/storage/perfschema/table_status_by_thread.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_status_by_user.cc b/storage/perfschema/table_status_by_user.cc index fb9324bebe7..84f81402e1c 100644 --- a/storage/perfschema/table_status_by_user.cc +++ b/storage/perfschema/table_status_by_user.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -165,7 +165,7 @@ table_status_by_user::rnd_pos(const void *pos) return HA_ERR_END_OF_FILE; set_position(pos); - DBUG_ASSERT(m_pos.m_index_1 < global_user_container.get_row_count()); + assert(m_pos.m_index_1 < global_user_container.get_row_count()); PFS_user *pfs_user= global_user_container.get(m_pos.m_index_1); @@ -217,7 +217,7 @@ int table_status_by_user return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -236,7 +236,7 @@ int table_status_by_user m_row.m_variable_value.set_field(f); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_status_by_user.h b/storage/perfschema/table_status_by_user.h index 6b4a67b4e3f..2fe2cc24407 100644 --- a/storage/perfschema/table_status_by_user.h +++ b/storage/perfschema/table_status_by_user.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_sync_instances.cc b/storage/perfschema/table_sync_instances.cc index 6187923df3e..a85dea21ba2 100644 --- a/storage/perfschema/table_sync_instances.cc +++ b/storage/perfschema/table_sync_instances.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -154,7 +154,7 @@ int table_mutex_instances::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -176,7 +176,7 @@ int table_mutex_instances::read_row_values(TABLE *table, f->set_null(); break; default: - DBUG_ASSERT(false); + assert(false); } } } @@ -307,7 +307,7 @@ int table_rwlock_instances::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -332,7 +332,7 @@ int table_rwlock_instances::read_row_values(TABLE *table, set_field_ulong(f, m_row.m_readers); break; default: - DBUG_ASSERT(false); + assert(false); } } } @@ -447,7 +447,7 @@ int table_cond_instances::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 0); + assert(table->s->null_bytes == 0); for (; (f= *fields) ; fields++) { @@ -462,7 +462,7 @@ int table_cond_instances::read_row_values(TABLE *table, set_field_ulonglong(f, (intptr) m_row.m_identity); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_sync_instances.h b/storage/perfschema/table_sync_instances.h index 6cf8f0f3669..f1f56248a12 100644 --- a/storage/perfschema/table_sync_instances.h +++ b/storage/perfschema/table_sync_instances.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_table_handles.cc b/storage/perfschema/table_table_handles.cc index 03431bbf1ad..91ab7f889e4 100644 --- a/storage/perfschema/table_table_handles.cc +++ b/storage/perfschema/table_table_handles.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2012, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -174,7 +174,7 @@ int table_table_handles::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -204,7 +204,7 @@ int table_table_handles::read_row_values(TABLE *table, set_field_lock_type(f, m_row.m_external_lock); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_table_handles.h b/storage/perfschema/table_table_handles.h index 0f1f76f4846..3b738d89413 100644 --- a/storage/perfschema/table_table_handles.h +++ b/storage/perfschema/table_table_handles.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2012, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_threads.cc b/storage/perfschema/table_threads.cc index fcf0a7ad80e..5528056c022 100644 --- a/storage/perfschema/table_threads.cc +++ b/storage/perfschema/table_threads.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -193,7 +193,7 @@ int table_threads::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 2); + assert(table->s->null_bytes == 2); buf[0]= 0; buf[1]= 0; @@ -266,7 +266,7 @@ int table_threads::read_row_values(TABLE *table, server is updating this column for those threads. To prevent this kind of issue, an assert is added. */ - DBUG_ASSERT(m_row.m_processlist_state_length <= f->char_length()); + assert(m_row.m_processlist_state_length <= f->char_length()); if (m_row.m_processlist_state_length > 0) set_field_varchar_utf8(f, m_row.m_processlist_state_ptr, m_row.m_processlist_state_length); @@ -309,7 +309,7 @@ int table_threads::read_row_values(TABLE *table, f->set_null(); break; default: - DBUG_ASSERT(false); + assert(false); } } } @@ -356,7 +356,7 @@ int table_threads::update_row_values(TABLE *table, case 16: /* THREAD_OS_ID */ return HA_ERR_WRONG_COMMAND; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_threads.h b/storage/perfschema/table_threads.h index 88302ea61de..a7ce83dad72 100644 --- a/storage/perfschema/table_threads.h +++ b/storage/perfschema/table_threads.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_tiws_by_index_usage.cc b/storage/perfschema/table_tiws_by_index_usage.cc index 8f11c35be56..7375c62ae38 100644 --- a/storage/perfschema/table_tiws_by_index_usage.cc +++ b/storage/perfschema/table_tiws_by_index_usage.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -199,7 +199,7 @@ void table_tiws_by_index_usage::make_row(PFS_table_share *pfs_share, PFS_table_share_index *pfs_index; pfs_optimistic_state lock; - DBUG_ASSERT(index <= MAX_INDEXES); + assert(index <= MAX_INDEXES); m_row_exists= false; @@ -240,7 +240,7 @@ int table_tiws_by_index_usage::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -361,7 +361,7 @@ int table_tiws_by_index_usage::read_row_values(TABLE *table, set_field_ulonglong(f, m_row.m_stat.m_delete.m_max); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_tiws_by_index_usage.h b/storage/perfschema/table_tiws_by_index_usage.h index cc6ee5ebfe7..990f2dede66 100644 --- a/storage/perfschema/table_tiws_by_index_usage.h +++ b/storage/perfschema/table_tiws_by_index_usage.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_tiws_by_table.cc b/storage/perfschema/table_tiws_by_table.cc index e6cf8e53b64..cbd754b3342 100644 --- a/storage/perfschema/table_tiws_by_table.cc +++ b/storage/perfschema/table_tiws_by_table.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -203,7 +203,7 @@ int table_tiws_by_table::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -323,7 +323,7 @@ int table_tiws_by_table::read_row_values(TABLE *table, set_field_ulonglong(f, m_row.m_stat.m_delete.m_max); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_tiws_by_table.h b/storage/perfschema/table_tiws_by_table.h index 4100a99156b..693e07f0e65 100644 --- a/storage/perfschema/table_tiws_by_table.h +++ b/storage/perfschema/table_tiws_by_table.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_tlws_by_table.cc b/storage/perfschema/table_tlws_by_table.cc index ea24d11187e..ebb01567adf 100644 --- a/storage/perfschema/table_tlws_by_table.cc +++ b/storage/perfschema/table_tlws_by_table.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -238,7 +238,7 @@ int table_tlws_by_table::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -475,7 +475,7 @@ int table_tlws_by_table::read_row_values(TABLE *table, break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_tlws_by_table.h b/storage/perfschema/table_tlws_by_table.h index 7cc4b666908..5bcf89d3a24 100644 --- a/storage/perfschema/table_tlws_by_table.h +++ b/storage/perfschema/table_tlws_by_table.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_users.cc b/storage/perfschema/table_users.cc index 007b20c15e2..d56c90c0270 100644 --- a/storage/perfschema/table_users.cc +++ b/storage/perfschema/table_users.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -123,7 +123,7 @@ int table_users::read_row_values(TABLE *table, return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -140,7 +140,7 @@ int table_users::read_row_values(TABLE *table, m_row.m_connection_stat.set_field(f->field_index - 1, f); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_users.h b/storage/perfschema/table_users.h index 1c3cc647a9d..c2476c71707 100644 --- a/storage/perfschema/table_users.h +++ b/storage/perfschema/table_users.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_uvar_by_thread.cc b/storage/perfschema/table_uvar_by_thread.cc index 36f142da7ad..b80ae2beefe 100644 --- a/storage/perfschema/table_uvar_by_thread.cc +++ b/storage/perfschema/table_uvar_by_thread.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -286,11 +286,11 @@ int table_uvar_by_thread return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; - DBUG_ASSERT(m_row.m_variable_name != NULL); - DBUG_ASSERT(m_row.m_variable_value != NULL); + assert(m_row.m_variable_name != NULL); + assert(m_row.m_variable_value != NULL); for (; (f= *fields) ; fields++) { @@ -319,7 +319,7 @@ int table_uvar_by_thread } break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_uvar_by_thread.h b/storage/perfschema/table_uvar_by_thread.h index a7334b2bdfe..cd20897743d 100644 --- a/storage/perfschema/table_uvar_by_thread.h +++ b/storage/perfschema/table_uvar_by_thread.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -79,7 +79,7 @@ public: bool is_materialized(PFS_thread *pfs) { - DBUG_ASSERT(pfs != NULL); + assert(pfs != NULL); if (m_pfs != pfs) return false; if (m_thread_internal_id != pfs->m_thread_internal_id) diff --git a/storage/perfschema/table_variables_by_thread.cc b/storage/perfschema/table_variables_by_thread.cc index b43c6cd88ef..bdf1aaf5227 100644 --- a/storage/perfschema/table_variables_by_thread.cc +++ b/storage/perfschema/table_variables_by_thread.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -142,7 +142,7 @@ table_variables_by_thread::rnd_pos(const void *pos) return HA_ERR_RECORD_DELETED; set_position(pos); - DBUG_ASSERT(m_pos.m_index_1 < global_thread_container.get_row_count()); + assert(m_pos.m_index_1 < global_thread_container.get_row_count()); PFS_thread *pfs_thread= global_thread_container.get(m_pos.m_index_1); /* @@ -200,7 +200,7 @@ int table_variables_by_thread return HA_ERR_RECORD_DELETED; /* Set the null bits */ - DBUG_ASSERT(table->s->null_bytes == 1); + assert(table->s->null_bytes == 1); buf[0]= 0; for (; (f= *fields) ; fields++) @@ -219,7 +219,7 @@ int table_variables_by_thread m_row.m_variable_value.set_field(f); break; default: - DBUG_ASSERT(false); + assert(false); } } } diff --git a/storage/perfschema/table_variables_by_thread.h b/storage/perfschema/table_variables_by_thread.h index d628707f9b4..5143067adbb 100644 --- a/storage/perfschema/table_variables_by_thread.h +++ b/storage/perfschema/table_variables_by_thread.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/CMakeLists.txt b/storage/perfschema/unittest/CMakeLists.txt index 1bba2673a1a..712f22242c3 100644 --- a/storage/perfschema/unittest/CMakeLists.txt +++ b/storage/perfschema/unittest/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/conf.txt b/storage/perfschema/unittest/conf.txt index f84ba3317b1..db9cf980c33 100644 --- a/storage/perfschema/unittest/conf.txt +++ b/storage/perfschema/unittest/conf.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2010, Oracle and/or its affiliates. +# Copyright (c) 2009, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs-t.cc b/storage/perfschema/unittest/pfs-t.cc index 43d9d8d233d..2240c2917e8 100644 --- a/storage/perfschema/unittest/pfs-t.cc +++ b/storage/perfschema/unittest/pfs-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_account-oom-t.cc b/storage/perfschema/unittest/pfs_account-oom-t.cc index 185b0a6594c..ea39903484c 100644 --- a/storage/perfschema/unittest/pfs_account-oom-t.cc +++ b/storage/perfschema/unittest/pfs_account-oom-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_connect_attr-t.cc b/storage/perfschema/unittest/pfs_connect_attr-t.cc index b57ead3ec26..e414a17a1ef 100644 --- a/storage/perfschema/unittest/pfs_connect_attr-t.cc +++ b/storage/perfschema/unittest/pfs_connect_attr-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_host-oom-t.cc b/storage/perfschema/unittest/pfs_host-oom-t.cc index e97a1170eb2..0dc77f9e307 100644 --- a/storage/perfschema/unittest/pfs_host-oom-t.cc +++ b/storage/perfschema/unittest/pfs_host-oom-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_instr-oom-t.cc b/storage/perfschema/unittest/pfs_instr-oom-t.cc index 9472d8aa001..5f0d97e6be4 100644 --- a/storage/perfschema/unittest/pfs_instr-oom-t.cc +++ b/storage/perfschema/unittest/pfs_instr-oom-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_instr-t.cc b/storage/perfschema/unittest/pfs_instr-t.cc index d4401ab7ea2..95971214c83 100644 --- a/storage/perfschema/unittest/pfs_instr-t.cc +++ b/storage/perfschema/unittest/pfs_instr-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc index 0f9d6ef07d5..da80a658f99 100644 --- a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc +++ b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_instr_class-t.cc b/storage/perfschema/unittest/pfs_instr_class-t.cc index 3dfd725cb91..09a38706b86 100644 --- a/storage/perfschema/unittest/pfs_instr_class-t.cc +++ b/storage/perfschema/unittest/pfs_instr_class-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_misc-t.cc b/storage/perfschema/unittest/pfs_misc-t.cc index d82178000c2..e2522a053e1 100644 --- a/storage/perfschema/unittest/pfs_misc-t.cc +++ b/storage/perfschema/unittest/pfs_misc-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_noop-t.cc b/storage/perfschema/unittest/pfs_noop-t.cc index 2756680dc22..e577a7cc509 100644 --- a/storage/perfschema/unittest/pfs_noop-t.cc +++ b/storage/perfschema/unittest/pfs_noop-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2013, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_server_stubs.cc b/storage/perfschema/unittest/pfs_server_stubs.cc index ca7b2300797..9fc3b2fb143 100644 --- a/storage/perfschema/unittest/pfs_server_stubs.cc +++ b/storage/perfschema/unittest/pfs_server_stubs.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify diff --git a/storage/perfschema/unittest/pfs_timer-t.cc b/storage/perfschema/unittest/pfs_timer-t.cc index 6c852242537..22fdb163aed 100644 --- a/storage/perfschema/unittest/pfs_timer-t.cc +++ b/storage/perfschema/unittest/pfs_timer-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_user-oom-t.cc b/storage/perfschema/unittest/pfs_user-oom-t.cc index 864275b765e..4cc23a018d2 100644 --- a/storage/perfschema/unittest/pfs_user-oom-t.cc +++ b/storage/perfschema/unittest/pfs_user-oom-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/stub_global_status_var.h b/storage/perfschema/unittest/stub_global_status_var.h index c870b863331..c2785d2eac1 100644 --- a/storage/perfschema/unittest/stub_global_status_var.h +++ b/storage/perfschema/unittest/stub_global_status_var.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/stub_pfs_defaults.h b/storage/perfschema/unittest/stub_pfs_defaults.h index 951508733e2..338fd9f8324 100644 --- a/storage/perfschema/unittest/stub_pfs_defaults.h +++ b/storage/perfschema/unittest/stub_pfs_defaults.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/stub_pfs_global.h b/storage/perfschema/unittest/stub_pfs_global.h index 23b731cb8b2..4371523b014 100644 --- a/storage/perfschema/unittest/stub_pfs_global.h +++ b/storage/perfschema/unittest/stub_pfs_global.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -37,7 +37,7 @@ void *pfs_malloc(PFS_builtin_memory_class *klass, size_t size, myf) /* Catch non initialized sizing parameter in the unit tests. */ - DBUG_ASSERT(size <= 100*1024*1024); + assert(size <= 100*1024*1024); if (stub_alloc_always_fails) return NULL; diff --git a/storage/perfschema/unittest/stub_print_error.h b/storage/perfschema/unittest/stub_print_error.h index 8d87fbe5923..ac1ecf1f637 100644 --- a/storage/perfschema/unittest/stub_print_error.h +++ b/storage/perfschema/unittest/stub_print_error.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt index 528181072b3..f76f91c66bf 100644 --- a/storage/rocksdb/CMakeLists.txt +++ b/storage/rocksdb/CMakeLists.txt @@ -132,7 +132,8 @@ SET(ROCKSDB_SE_SOURCES # This is a strong requirement coming from RocksDB. No conditional checks here. #ADD_DEFINITIONS(-DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX #) -if(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64") + +if (HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC) SET(ATOMIC_EXTRA_LIBS -latomic) else() SET(ATOMIC_EXTRA_LIBS) diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 978fcc945ed..82a85a0be7d 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -643,6 +643,8 @@ static my_bool rocksdb_large_prefix = 0; static my_bool rocksdb_allow_to_start_after_corruption = 0; static char* rocksdb_git_hash; +uint32_t rocksdb_ignore_datadic_errors = 0; + char *compression_types_val= const_cast<char*>(get_rocksdb_supported_compression_types()); static unsigned long rocksdb_write_policy = @@ -1913,6 +1915,15 @@ static MYSQL_SYSVAR_UINT( nullptr, nullptr, 1 /* default value */, 0 /* min value */, 2 /* max value */, 0); +static MYSQL_SYSVAR_UINT( + ignore_datadic_errors, rocksdb_ignore_datadic_errors, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "Ignore MyRocks' data directory errors. " + "(CAUTION: Use only to start the server and perform repairs. Do NOT use " + "for regular operation)", + nullptr, nullptr, 0 /* default value */, 0 /* min value */, + 1 /* max value */, 0); + static MYSQL_SYSVAR_STR(datadir, rocksdb_datadir, PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY, "RocksDB data directory", nullptr, nullptr, @@ -2148,6 +2159,8 @@ static struct st_mysql_sys_var *rocksdb_system_variables[] = { MYSQL_SYSVAR(rollback_on_timeout), MYSQL_SYSVAR(enable_insert_with_update_caching), + + MYSQL_SYSVAR(ignore_datadic_errors), nullptr}; static rocksdb::WriteOptions rdb_get_rocksdb_write_options( @@ -5223,6 +5236,13 @@ static int rocksdb_init_func(void *const p) { DBUG_ENTER_FUNC(); + if (rocksdb_ignore_datadic_errors) + { + sql_print_information( + "CAUTION: Running with rocksdb_ignore_datadic_errors=1. " + " This should only be used to perform repairs"); + } + if (rdb_check_rocksdb_corruption()) { // NO_LINT_DEBUG sql_print_error( @@ -5654,7 +5674,14 @@ static int rocksdb_init_func(void *const p) { if (ddl_manager.init(&dict_manager, &cf_manager, rocksdb_validate_tables)) { // NO_LINT_DEBUG sql_print_error("RocksDB: Failed to initialize DDL manager."); - DBUG_RETURN(HA_EXIT_FAILURE); + + if (rocksdb_ignore_datadic_errors) + { + sql_print_error("RocksDB: rocksdb_ignore_datadic_errors=1, " + "trying to continue"); + } + else + DBUG_RETURN(HA_EXIT_FAILURE); } Rdb_sst_info::init(rdb); @@ -6719,6 +6746,26 @@ int ha_rocksdb::open(const char *const name, int mode, uint test_if_locked) { "dictionary"); DBUG_RETURN(HA_ERR_ROCKSDB_INVALID_TABLE); } + if (m_tbl_def->m_key_count != table->s->keys + has_hidden_pk(table)? 1:0) + { + sql_print_error("MyRocks: DDL mismatch: .frm file has %u indexes, " + "MyRocks has %u (%s hidden pk)", + table->s->keys, m_tbl_def->m_key_count, + has_hidden_pk(table)? "1" : "no"); + + if (rocksdb_ignore_datadic_errors) + { + sql_print_error("MyRocks: rocksdb_ignore_datadic_errors=1, " + "trying to continue"); + } + else + { + my_error(ER_INTERNAL_ERROR, MYF(0), + "MyRocks: DDL mismatch. Check the error log for details"); + DBUG_RETURN(HA_ERR_ROCKSDB_INVALID_TABLE); + } + } + m_lock_rows = RDB_LOCK_NONE; m_key_descr_arr = m_tbl_def->m_key_descr_arr; @@ -11618,6 +11665,12 @@ void Rdb_drop_index_thread::run() { "from cf id %u. MyRocks data dictionary may " "get corrupted.", d.cf_id); + if (rocksdb_ignore_datadic_errors) + { + sql_print_error("RocksDB: rocksdb_ignore_datadic_errors=1, " + "trying to continue"); + continue; + } abort(); } rocksdb::ColumnFamilyHandle *cfh = cf_manager.get_cf(d.cf_id); diff --git a/storage/rocksdb/ha_rocksdb.h b/storage/rocksdb/ha_rocksdb.h index 6db0b406cc1..63bf7ffd602 100644 --- a/storage/rocksdb/ha_rocksdb.h +++ b/storage/rocksdb/ha_rocksdb.h @@ -1062,6 +1062,8 @@ std::string rdb_corruption_marker_file_name(); const int MYROCKS_MARIADB_PLUGIN_MATURITY_LEVEL= MariaDB_PLUGIN_MATURITY_STABLE; +extern uint32_t rocksdb_ignore_datadic_errors; + void sql_print_verbose_info(const char *format, ...); } // namespace myrocks diff --git a/storage/rocksdb/mysql-test/rocksdb/r/col_opt_not_null.result b/storage/rocksdb/mysql-test/rocksdb/r/col_opt_not_null.result index 1e36cc9e795..a3a138555ee 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/col_opt_not_null.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/col_opt_not_null.result @@ -157,13 +157,13 @@ Warning 1265 Data truncated for column 'v64' at row 1 Warning 1265 Data truncated for column 'v65000' at row 1 INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, CONCAT('a',v65000), CONCAT(v65000,v1) FROM t1; Warnings: -Warning 1265 Data truncated for column 'v0' at row 5 -Warning 1265 Data truncated for column 'v1' at row 5 -Warning 1265 Data truncated for column 'v64' at row 5 -Warning 1265 Data truncated for column 'v0' at row 6 -Warning 1265 Data truncated for column 'v1' at row 6 -Warning 1265 Data truncated for column 'v64' at row 6 -Warning 1265 Data truncated for column 'v65000' at row 6 +Warning 1265 Data truncated for column 'v0' at row 2 +Warning 1265 Data truncated for column 'v1' at row 2 +Warning 1265 Data truncated for column 'v64' at row 2 +Warning 1265 Data truncated for column 'v0' at row 3 +Warning 1265 Data truncated for column 'v1' at row 3 +Warning 1265 Data truncated for column 'v64' at row 3 +Warning 1265 Data truncated for column 'v65000' at row 3 SELECT HEX(v0), HEX(v1), HEX(v64), LENGTH(HEX(v65000)) FROM t1; HEX(v0) HEX(v1) HEX(v64) LENGTH(HEX(v65000)) 0 @@ -675,15 +675,15 @@ Warning 1265 Data truncated for column 'c20' at row 1 Warning 1265 Data truncated for column 'c255' at row 1 INSERT INTO t1 (c,c0,c1,c20,c255) SELECT c255, c255, c255, c255, CONCAT('a',c255,c1) FROM t1; Warnings: -Warning 1265 Data truncated for column 'c' at row 5 -Warning 1265 Data truncated for column 'c0' at row 5 -Warning 1265 Data truncated for column 'c1' at row 5 -Warning 1265 Data truncated for column 'c20' at row 5 -Warning 1265 Data truncated for column 'c' at row 6 -Warning 1265 Data truncated for column 'c0' at row 6 -Warning 1265 Data truncated for column 'c1' at row 6 -Warning 1265 Data truncated for column 'c20' at row 6 -Warning 1265 Data truncated for column 'c255' at row 6 +Warning 1265 Data truncated for column 'c' at row 2 +Warning 1265 Data truncated for column 'c0' at row 2 +Warning 1265 Data truncated for column 'c1' at row 2 +Warning 1265 Data truncated for column 'c20' at row 2 +Warning 1265 Data truncated for column 'c' at row 3 +Warning 1265 Data truncated for column 'c0' at row 3 +Warning 1265 Data truncated for column 'c1' at row 3 +Warning 1265 Data truncated for column 'c20' at row 3 +Warning 1265 Data truncated for column 'c255' at row 3 SELECT c,c0,c1,c20,c255 FROM t1; c c0 c1 c20 c255 @@ -845,13 +845,13 @@ Warning 1265 Data truncated for column 'v64' at row 1 Warning 1265 Data truncated for column 'v65000' at row 1 INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, CONCAT('a',v65000), CONCAT(v65000,v1) FROM t1; Warnings: -Warning 1265 Data truncated for column 'v0' at row 5 -Warning 1265 Data truncated for column 'v1' at row 5 -Warning 1265 Data truncated for column 'v64' at row 5 -Warning 1265 Data truncated for column 'v65000' at row 5 -Warning 1265 Data truncated for column 'v0' at row 6 -Warning 1265 Data truncated for column 'v1' at row 6 -Warning 1265 Data truncated for column 'v64' at row 6 +Warning 1265 Data truncated for column 'v0' at row 2 +Warning 1265 Data truncated for column 'v1' at row 2 +Warning 1265 Data truncated for column 'v64' at row 2 +Warning 1265 Data truncated for column 'v65000' at row 2 +Warning 1265 Data truncated for column 'v0' at row 3 +Warning 1265 Data truncated for column 'v1' at row 3 +Warning 1265 Data truncated for column 'v64' at row 3 SELECT v0, v1, v64, LENGTH(v65000) FROM t1; v0 v1 v64 LENGTH(v65000) 0 @@ -2038,70 +2038,70 @@ Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b20' at row 1 INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); Warnings: -Warning 1264 Out of range value for column 'i' at row 8 -Warning 1264 Out of range value for column 'i0' at row 8 -Warning 1264 Out of range value for column 'i1' at row 8 -Warning 1264 Out of range value for column 'i20' at row 8 -Warning 1264 Out of range value for column 't' at row 8 -Warning 1264 Out of range value for column 't0' at row 8 -Warning 1264 Out of range value for column 't1' at row 8 -Warning 1264 Out of range value for column 't20' at row 8 -Warning 1264 Out of range value for column 's' at row 8 -Warning 1264 Out of range value for column 's0' at row 8 -Warning 1264 Out of range value for column 's1' at row 8 -Warning 1264 Out of range value for column 's20' at row 8 -Warning 1264 Out of range value for column 'm' at row 8 -Warning 1264 Out of range value for column 'm0' at row 8 -Warning 1264 Out of range value for column 'm1' at row 8 -Warning 1264 Out of range value for column 'm20' at row 8 -Warning 1264 Out of range value for column 'i' at row 9 -Warning 1264 Out of range value for column 'i0' at row 9 -Warning 1264 Out of range value for column 'i1' at row 9 -Warning 1264 Out of range value for column 'i20' at row 9 -Warning 1264 Out of range value for column 't' at row 9 -Warning 1264 Out of range value for column 't0' at row 9 -Warning 1264 Out of range value for column 't1' at row 9 -Warning 1264 Out of range value for column 't20' at row 9 -Warning 1264 Out of range value for column 's' at row 9 -Warning 1264 Out of range value for column 's0' at row 9 -Warning 1264 Out of range value for column 's1' at row 9 -Warning 1264 Out of range value for column 's20' at row 9 -Warning 1264 Out of range value for column 'm' at row 9 -Warning 1264 Out of range value for column 'm0' at row 9 -Warning 1264 Out of range value for column 'm1' at row 9 -Warning 1264 Out of range value for column 'm20' at row 9 -Warning 1264 Out of range value for column 'i' at row 10 -Warning 1264 Out of range value for column 'i0' at row 10 -Warning 1264 Out of range value for column 'i1' at row 10 -Warning 1264 Out of range value for column 'i20' at row 10 -Warning 1264 Out of range value for column 't' at row 10 -Warning 1264 Out of range value for column 't0' at row 10 -Warning 1264 Out of range value for column 't1' at row 10 -Warning 1264 Out of range value for column 't20' at row 10 -Warning 1264 Out of range value for column 's' at row 10 -Warning 1264 Out of range value for column 's0' at row 10 -Warning 1264 Out of range value for column 's1' at row 10 -Warning 1264 Out of range value for column 's20' at row 10 -Warning 1264 Out of range value for column 'm' at row 10 -Warning 1264 Out of range value for column 'm0' at row 10 -Warning 1264 Out of range value for column 'm1' at row 10 -Warning 1264 Out of range value for column 'm20' at row 10 -Warning 1264 Out of range value for column 'i' at row 11 -Warning 1264 Out of range value for column 'i0' at row 11 -Warning 1264 Out of range value for column 'i1' at row 11 -Warning 1264 Out of range value for column 'i20' at row 11 -Warning 1264 Out of range value for column 't' at row 11 -Warning 1264 Out of range value for column 't0' at row 11 -Warning 1264 Out of range value for column 't1' at row 11 -Warning 1264 Out of range value for column 't20' at row 11 -Warning 1264 Out of range value for column 's' at row 11 -Warning 1264 Out of range value for column 's0' at row 11 -Warning 1264 Out of range value for column 's1' at row 11 -Warning 1264 Out of range value for column 's20' at row 11 -Warning 1264 Out of range value for column 'm' at row 11 -Warning 1264 Out of range value for column 'm0' at row 11 -Warning 1264 Out of range value for column 'm1' at row 11 -Warning 1264 Out of range value for column 'm20' at row 11 +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'i' at row 2 +Warning 1264 Out of range value for column 'i0' at row 2 +Warning 1264 Out of range value for column 'i1' at row 2 +Warning 1264 Out of range value for column 'i20' at row 2 +Warning 1264 Out of range value for column 't' at row 2 +Warning 1264 Out of range value for column 't0' at row 2 +Warning 1264 Out of range value for column 't1' at row 2 +Warning 1264 Out of range value for column 't20' at row 2 +Warning 1264 Out of range value for column 's' at row 2 +Warning 1264 Out of range value for column 's0' at row 2 +Warning 1264 Out of range value for column 's1' at row 2 +Warning 1264 Out of range value for column 's20' at row 2 +Warning 1264 Out of range value for column 'm' at row 2 +Warning 1264 Out of range value for column 'm0' at row 2 +Warning 1264 Out of range value for column 'm1' at row 2 +Warning 1264 Out of range value for column 'm20' at row 2 +Warning 1264 Out of range value for column 'i' at row 3 +Warning 1264 Out of range value for column 'i0' at row 3 +Warning 1264 Out of range value for column 'i1' at row 3 +Warning 1264 Out of range value for column 'i20' at row 3 +Warning 1264 Out of range value for column 't' at row 3 +Warning 1264 Out of range value for column 't0' at row 3 +Warning 1264 Out of range value for column 't1' at row 3 +Warning 1264 Out of range value for column 't20' at row 3 +Warning 1264 Out of range value for column 's' at row 3 +Warning 1264 Out of range value for column 's0' at row 3 +Warning 1264 Out of range value for column 's1' at row 3 +Warning 1264 Out of range value for column 's20' at row 3 +Warning 1264 Out of range value for column 'm' at row 3 +Warning 1264 Out of range value for column 'm0' at row 3 +Warning 1264 Out of range value for column 'm1' at row 3 +Warning 1264 Out of range value for column 'm20' at row 3 +Warning 1264 Out of range value for column 'i' at row 4 +Warning 1264 Out of range value for column 'i0' at row 4 +Warning 1264 Out of range value for column 'i1' at row 4 +Warning 1264 Out of range value for column 'i20' at row 4 +Warning 1264 Out of range value for column 't' at row 4 +Warning 1264 Out of range value for column 't0' at row 4 +Warning 1264 Out of range value for column 't1' at row 4 +Warning 1264 Out of range value for column 't20' at row 4 +Warning 1264 Out of range value for column 's' at row 4 +Warning 1264 Out of range value for column 's0' at row 4 +Warning 1264 Out of range value for column 's1' at row 4 +Warning 1264 Out of range value for column 's20' at row 4 +Warning 1264 Out of range value for column 'm' at row 4 +Warning 1264 Out of range value for column 'm0' at row 4 +Warning 1264 Out of range value for column 'm1' at row 4 +Warning 1264 Out of range value for column 'm20' at row 4 SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 -2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 diff --git a/storage/rocksdb/mysql-test/rocksdb/r/col_opt_null.result b/storage/rocksdb/mysql-test/rocksdb/r/col_opt_null.result index caa21caac51..f0d377890c5 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/col_opt_null.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/col_opt_null.result @@ -146,13 +146,13 @@ Warning 1265 Data truncated for column 'v64' at row 1 Warning 1265 Data truncated for column 'v65000' at row 1 INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, CONCAT('a',v65000), CONCAT(v65000,v1) FROM t1; Warnings: -Warning 1265 Data truncated for column 'v0' at row 5 -Warning 1265 Data truncated for column 'v1' at row 5 -Warning 1265 Data truncated for column 'v64' at row 5 -Warning 1265 Data truncated for column 'v0' at row 6 -Warning 1265 Data truncated for column 'v1' at row 6 -Warning 1265 Data truncated for column 'v64' at row 6 -Warning 1265 Data truncated for column 'v65000' at row 6 +Warning 1265 Data truncated for column 'v0' at row 2 +Warning 1265 Data truncated for column 'v1' at row 2 +Warning 1265 Data truncated for column 'v64' at row 2 +Warning 1265 Data truncated for column 'v0' at row 3 +Warning 1265 Data truncated for column 'v1' at row 3 +Warning 1265 Data truncated for column 'v64' at row 3 +Warning 1265 Data truncated for column 'v65000' at row 3 SELECT HEX(v0), HEX(v1), HEX(v64), LENGTH(HEX(v65000)) FROM t1; HEX(v0) HEX(v1) HEX(v64) LENGTH(HEX(v65000)) 0 @@ -587,15 +587,15 @@ Warning 1265 Data truncated for column 'c20' at row 1 Warning 1265 Data truncated for column 'c255' at row 1 INSERT INTO t1 (c,c0,c1,c20,c255) SELECT c255, c255, c255, c255, CONCAT('a',c255,c1) FROM t1; Warnings: -Warning 1265 Data truncated for column 'c' at row 5 -Warning 1265 Data truncated for column 'c0' at row 5 -Warning 1265 Data truncated for column 'c1' at row 5 -Warning 1265 Data truncated for column 'c20' at row 5 -Warning 1265 Data truncated for column 'c' at row 6 -Warning 1265 Data truncated for column 'c0' at row 6 -Warning 1265 Data truncated for column 'c1' at row 6 -Warning 1265 Data truncated for column 'c20' at row 6 -Warning 1265 Data truncated for column 'c255' at row 6 +Warning 1265 Data truncated for column 'c' at row 2 +Warning 1265 Data truncated for column 'c0' at row 2 +Warning 1265 Data truncated for column 'c1' at row 2 +Warning 1265 Data truncated for column 'c20' at row 2 +Warning 1265 Data truncated for column 'c' at row 3 +Warning 1265 Data truncated for column 'c0' at row 3 +Warning 1265 Data truncated for column 'c1' at row 3 +Warning 1265 Data truncated for column 'c20' at row 3 +Warning 1265 Data truncated for column 'c255' at row 3 SELECT c,c0,c1,c20,c255 FROM t1; c c0 c1 c20 c255 @@ -746,13 +746,13 @@ Warning 1265 Data truncated for column 'v64' at row 1 Warning 1265 Data truncated for column 'v65000' at row 1 INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, CONCAT('a',v65000), CONCAT(v65000,v1) FROM t1; Warnings: -Warning 1265 Data truncated for column 'v0' at row 5 -Warning 1265 Data truncated for column 'v1' at row 5 -Warning 1265 Data truncated for column 'v64' at row 5 -Warning 1265 Data truncated for column 'v65000' at row 5 -Warning 1265 Data truncated for column 'v0' at row 6 -Warning 1265 Data truncated for column 'v1' at row 6 -Warning 1265 Data truncated for column 'v64' at row 6 +Warning 1265 Data truncated for column 'v0' at row 2 +Warning 1265 Data truncated for column 'v1' at row 2 +Warning 1265 Data truncated for column 'v64' at row 2 +Warning 1265 Data truncated for column 'v65000' at row 2 +Warning 1265 Data truncated for column 'v0' at row 3 +Warning 1265 Data truncated for column 'v1' at row 3 +Warning 1265 Data truncated for column 'v64' at row 3 SELECT v0, v1, v64, LENGTH(v65000) FROM t1; v0 v1 v64 LENGTH(v65000) 0 @@ -1803,70 +1803,70 @@ Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b20' at row 1 INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); Warnings: -Warning 1264 Out of range value for column 'i' at row 8 -Warning 1264 Out of range value for column 'i0' at row 8 -Warning 1264 Out of range value for column 'i1' at row 8 -Warning 1264 Out of range value for column 'i20' at row 8 -Warning 1264 Out of range value for column 't' at row 8 -Warning 1264 Out of range value for column 't0' at row 8 -Warning 1264 Out of range value for column 't1' at row 8 -Warning 1264 Out of range value for column 't20' at row 8 -Warning 1264 Out of range value for column 's' at row 8 -Warning 1264 Out of range value for column 's0' at row 8 -Warning 1264 Out of range value for column 's1' at row 8 -Warning 1264 Out of range value for column 's20' at row 8 -Warning 1264 Out of range value for column 'm' at row 8 -Warning 1264 Out of range value for column 'm0' at row 8 -Warning 1264 Out of range value for column 'm1' at row 8 -Warning 1264 Out of range value for column 'm20' at row 8 -Warning 1264 Out of range value for column 'i' at row 9 -Warning 1264 Out of range value for column 'i0' at row 9 -Warning 1264 Out of range value for column 'i1' at row 9 -Warning 1264 Out of range value for column 'i20' at row 9 -Warning 1264 Out of range value for column 't' at row 9 -Warning 1264 Out of range value for column 't0' at row 9 -Warning 1264 Out of range value for column 't1' at row 9 -Warning 1264 Out of range value for column 't20' at row 9 -Warning 1264 Out of range value for column 's' at row 9 -Warning 1264 Out of range value for column 's0' at row 9 -Warning 1264 Out of range value for column 's1' at row 9 -Warning 1264 Out of range value for column 's20' at row 9 -Warning 1264 Out of range value for column 'm' at row 9 -Warning 1264 Out of range value for column 'm0' at row 9 -Warning 1264 Out of range value for column 'm1' at row 9 -Warning 1264 Out of range value for column 'm20' at row 9 -Warning 1264 Out of range value for column 'i' at row 10 -Warning 1264 Out of range value for column 'i0' at row 10 -Warning 1264 Out of range value for column 'i1' at row 10 -Warning 1264 Out of range value for column 'i20' at row 10 -Warning 1264 Out of range value for column 't' at row 10 -Warning 1264 Out of range value for column 't0' at row 10 -Warning 1264 Out of range value for column 't1' at row 10 -Warning 1264 Out of range value for column 't20' at row 10 -Warning 1264 Out of range value for column 's' at row 10 -Warning 1264 Out of range value for column 's0' at row 10 -Warning 1264 Out of range value for column 's1' at row 10 -Warning 1264 Out of range value for column 's20' at row 10 -Warning 1264 Out of range value for column 'm' at row 10 -Warning 1264 Out of range value for column 'm0' at row 10 -Warning 1264 Out of range value for column 'm1' at row 10 -Warning 1264 Out of range value for column 'm20' at row 10 -Warning 1264 Out of range value for column 'i' at row 11 -Warning 1264 Out of range value for column 'i0' at row 11 -Warning 1264 Out of range value for column 'i1' at row 11 -Warning 1264 Out of range value for column 'i20' at row 11 -Warning 1264 Out of range value for column 't' at row 11 -Warning 1264 Out of range value for column 't0' at row 11 -Warning 1264 Out of range value for column 't1' at row 11 -Warning 1264 Out of range value for column 't20' at row 11 -Warning 1264 Out of range value for column 's' at row 11 -Warning 1264 Out of range value for column 's0' at row 11 -Warning 1264 Out of range value for column 's1' at row 11 -Warning 1264 Out of range value for column 's20' at row 11 -Warning 1264 Out of range value for column 'm' at row 11 -Warning 1264 Out of range value for column 'm0' at row 11 -Warning 1264 Out of range value for column 'm1' at row 11 -Warning 1264 Out of range value for column 'm20' at row 11 +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'i' at row 2 +Warning 1264 Out of range value for column 'i0' at row 2 +Warning 1264 Out of range value for column 'i1' at row 2 +Warning 1264 Out of range value for column 'i20' at row 2 +Warning 1264 Out of range value for column 't' at row 2 +Warning 1264 Out of range value for column 't0' at row 2 +Warning 1264 Out of range value for column 't1' at row 2 +Warning 1264 Out of range value for column 't20' at row 2 +Warning 1264 Out of range value for column 's' at row 2 +Warning 1264 Out of range value for column 's0' at row 2 +Warning 1264 Out of range value for column 's1' at row 2 +Warning 1264 Out of range value for column 's20' at row 2 +Warning 1264 Out of range value for column 'm' at row 2 +Warning 1264 Out of range value for column 'm0' at row 2 +Warning 1264 Out of range value for column 'm1' at row 2 +Warning 1264 Out of range value for column 'm20' at row 2 +Warning 1264 Out of range value for column 'i' at row 3 +Warning 1264 Out of range value for column 'i0' at row 3 +Warning 1264 Out of range value for column 'i1' at row 3 +Warning 1264 Out of range value for column 'i20' at row 3 +Warning 1264 Out of range value for column 't' at row 3 +Warning 1264 Out of range value for column 't0' at row 3 +Warning 1264 Out of range value for column 't1' at row 3 +Warning 1264 Out of range value for column 't20' at row 3 +Warning 1264 Out of range value for column 's' at row 3 +Warning 1264 Out of range value for column 's0' at row 3 +Warning 1264 Out of range value for column 's1' at row 3 +Warning 1264 Out of range value for column 's20' at row 3 +Warning 1264 Out of range value for column 'm' at row 3 +Warning 1264 Out of range value for column 'm0' at row 3 +Warning 1264 Out of range value for column 'm1' at row 3 +Warning 1264 Out of range value for column 'm20' at row 3 +Warning 1264 Out of range value for column 'i' at row 4 +Warning 1264 Out of range value for column 'i0' at row 4 +Warning 1264 Out of range value for column 'i1' at row 4 +Warning 1264 Out of range value for column 'i20' at row 4 +Warning 1264 Out of range value for column 't' at row 4 +Warning 1264 Out of range value for column 't0' at row 4 +Warning 1264 Out of range value for column 't1' at row 4 +Warning 1264 Out of range value for column 't20' at row 4 +Warning 1264 Out of range value for column 's' at row 4 +Warning 1264 Out of range value for column 's0' at row 4 +Warning 1264 Out of range value for column 's1' at row 4 +Warning 1264 Out of range value for column 's20' at row 4 +Warning 1264 Out of range value for column 'm' at row 4 +Warning 1264 Out of range value for column 'm0' at row 4 +Warning 1264 Out of range value for column 'm1' at row 4 +Warning 1264 Out of range value for column 'm20' at row 4 SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 -2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 diff --git a/storage/rocksdb/mysql-test/rocksdb/r/col_opt_unsigned.result b/storage/rocksdb/mysql-test/rocksdb/r/col_opt_unsigned.result index 439f9be9a8a..13445fc9326 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/col_opt_unsigned.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/col_opt_unsigned.result @@ -656,54 +656,54 @@ Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b20' at row 1 INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); Warnings: -Warning 1264 Out of range value for column 'i' at row 8 -Warning 1264 Out of range value for column 'i0' at row 8 -Warning 1264 Out of range value for column 'i1' at row 8 -Warning 1264 Out of range value for column 'i20' at row 8 -Warning 1264 Out of range value for column 't' at row 8 -Warning 1264 Out of range value for column 't0' at row 8 -Warning 1264 Out of range value for column 't1' at row 8 -Warning 1264 Out of range value for column 't20' at row 8 -Warning 1264 Out of range value for column 's' at row 8 -Warning 1264 Out of range value for column 's0' at row 8 -Warning 1264 Out of range value for column 's1' at row 8 -Warning 1264 Out of range value for column 's20' at row 8 -Warning 1264 Out of range value for column 'm' at row 8 -Warning 1264 Out of range value for column 'm0' at row 8 -Warning 1264 Out of range value for column 'm1' at row 8 -Warning 1264 Out of range value for column 'm20' at row 8 -Warning 1264 Out of range value for column 'i' at row 9 -Warning 1264 Out of range value for column 'i0' at row 9 -Warning 1264 Out of range value for column 'i1' at row 9 -Warning 1264 Out of range value for column 'i20' at row 9 -Warning 1264 Out of range value for column 't' at row 9 -Warning 1264 Out of range value for column 't0' at row 9 -Warning 1264 Out of range value for column 't1' at row 9 -Warning 1264 Out of range value for column 't20' at row 9 -Warning 1264 Out of range value for column 's' at row 9 -Warning 1264 Out of range value for column 's0' at row 9 -Warning 1264 Out of range value for column 's1' at row 9 -Warning 1264 Out of range value for column 's20' at row 9 -Warning 1264 Out of range value for column 'm' at row 9 -Warning 1264 Out of range value for column 'm0' at row 9 -Warning 1264 Out of range value for column 'm1' at row 9 -Warning 1264 Out of range value for column 'm20' at row 9 -Warning 1264 Out of range value for column 'i' at row 10 -Warning 1264 Out of range value for column 'i0' at row 10 -Warning 1264 Out of range value for column 'i1' at row 10 -Warning 1264 Out of range value for column 'i20' at row 10 -Warning 1264 Out of range value for column 't' at row 10 -Warning 1264 Out of range value for column 't0' at row 10 -Warning 1264 Out of range value for column 't1' at row 10 -Warning 1264 Out of range value for column 't20' at row 10 -Warning 1264 Out of range value for column 's' at row 10 -Warning 1264 Out of range value for column 's0' at row 10 -Warning 1264 Out of range value for column 's1' at row 10 -Warning 1264 Out of range value for column 's20' at row 10 -Warning 1264 Out of range value for column 'm' at row 10 -Warning 1264 Out of range value for column 'm0' at row 10 -Warning 1264 Out of range value for column 'm1' at row 10 -Warning 1264 Out of range value for column 'm20' at row 10 +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'i' at row 2 +Warning 1264 Out of range value for column 'i0' at row 2 +Warning 1264 Out of range value for column 'i1' at row 2 +Warning 1264 Out of range value for column 'i20' at row 2 +Warning 1264 Out of range value for column 't' at row 2 +Warning 1264 Out of range value for column 't0' at row 2 +Warning 1264 Out of range value for column 't1' at row 2 +Warning 1264 Out of range value for column 't20' at row 2 +Warning 1264 Out of range value for column 's' at row 2 +Warning 1264 Out of range value for column 's0' at row 2 +Warning 1264 Out of range value for column 's1' at row 2 +Warning 1264 Out of range value for column 's20' at row 2 +Warning 1264 Out of range value for column 'm' at row 2 +Warning 1264 Out of range value for column 'm0' at row 2 +Warning 1264 Out of range value for column 'm1' at row 2 +Warning 1264 Out of range value for column 'm20' at row 2 +Warning 1264 Out of range value for column 'i' at row 3 +Warning 1264 Out of range value for column 'i0' at row 3 +Warning 1264 Out of range value for column 'i1' at row 3 +Warning 1264 Out of range value for column 'i20' at row 3 +Warning 1264 Out of range value for column 't' at row 3 +Warning 1264 Out of range value for column 't0' at row 3 +Warning 1264 Out of range value for column 't1' at row 3 +Warning 1264 Out of range value for column 't20' at row 3 +Warning 1264 Out of range value for column 's' at row 3 +Warning 1264 Out of range value for column 's0' at row 3 +Warning 1264 Out of range value for column 's1' at row 3 +Warning 1264 Out of range value for column 's20' at row 3 +Warning 1264 Out of range value for column 'm' at row 3 +Warning 1264 Out of range value for column 'm0' at row 3 +Warning 1264 Out of range value for column 'm1' at row 3 +Warning 1264 Out of range value for column 'm20' at row 3 SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/storage/rocksdb/mysql-test/rocksdb/r/corrupted_data_reads_debug.result b/storage/rocksdb/mysql-test/rocksdb/r/corrupted_data_reads_debug.result index 01fa9dac7fd..88a62028be9 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/corrupted_data_reads_debug.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/corrupted_data_reads_debug.result @@ -20,7 +20,7 @@ set @tmp1=@@rocksdb_verify_row_debug_checksums; set rocksdb_verify_row_debug_checksums=1; set session debug_dbug= "+d,myrocks_simulate_bad_row_read1"; select * from t1 where pk=1; -ERROR HY000: Got error 203 'Found data corruption.' from ROCKSDB +ERROR HY000: Got error 204 'Found data corruption.' from ROCKSDB set session debug_dbug= "-d,myrocks_simulate_bad_row_read1"; set rocksdb_verify_row_debug_checksums=@tmp1; select * from t1 where pk=1; @@ -28,11 +28,11 @@ pk col1 1 1 set session debug_dbug= "+d,myrocks_simulate_bad_row_read2"; select * from t1 where pk=1; -ERROR HY000: Got error 203 'Found data corruption.' from ROCKSDB +ERROR HY000: Got error 204 'Found data corruption.' from ROCKSDB set session debug_dbug= "-d,myrocks_simulate_bad_row_read2"; set session debug_dbug= "+d,myrocks_simulate_bad_row_read3"; select * from t1 where pk=1; -ERROR HY000: Got error 203 'Found data corruption.' from ROCKSDB +ERROR HY000: Got error 204 'Found data corruption.' from ROCKSDB set session debug_dbug= "-d,myrocks_simulate_bad_row_read3"; insert into t1 values(4,'0123456789'); select * from t1; @@ -56,7 +56,7 @@ pk col1 ABCD 1 set session debug_dbug= "+d,myrocks_simulate_bad_pk_read1"; select * from t2; -ERROR HY000: Got error 203 'Found data corruption.' from ROCKSDB +ERROR HY000: Got error 204 'Found data corruption.' from ROCKSDB set session debug_dbug= "-d,myrocks_simulate_bad_pk_read1"; drop table t2; create table t2 ( @@ -69,6 +69,6 @@ pk col1 ABCD 1 set session debug_dbug= "+d,myrocks_simulate_bad_pk_read1"; select * from t2; -ERROR HY000: Got error 203 'Found data corruption.' from ROCKSDB +ERROR HY000: Got error 204 'Found data corruption.' from ROCKSDB set session debug_dbug= "-d,myrocks_simulate_bad_pk_read1"; drop table t2; diff --git a/storage/rocksdb/mysql-test/rocksdb/r/group_min_max.result b/storage/rocksdb/mysql-test/rocksdb/r/group_min_max.result index b8cb4157d37..a070ba91a55 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/group_min_max.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/group_min_max.result @@ -2346,10 +2346,10 @@ a BB EXPLAIN SELECT a FROM t1 WHERE a='AA' GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref PRIMARY PRIMARY 7 const 1000 Using where; Using index +1 SIMPLE t1 range PRIMARY PRIMARY 7 NULL 501 Using where; Using index for group-by EXPLAIN SELECT a FROM t1 WHERE a='BB' GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref PRIMARY PRIMARY 7 const 1000 Using where; Using index +1 SIMPLE t1 range PRIMARY PRIMARY 7 NULL 501 Using where; Using index for group-by SELECT DISTINCT a FROM t1 WHERE a='BB'; a BB @@ -2777,7 +2777,7 @@ a b 3 13 explain extended select sql_buffer_result a, max(b)+1 from t1 where a = 0 group by a; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ref PRIMARY,index PRIMARY 4 const 15 6.67 Using index; Using temporary +1 SIMPLE t1 range PRIMARY,index PRIMARY 4 NULL 1 100.00 Using where; Using index for group-by; Using temporary Warnings: Note 1003 select sql_buffer_result `test`.`t1`.`a` AS `a`,max(`test`.`t1`.`b`) + 1 AS `max(b)+1` from `test`.`t1` where `test`.`t1`.`a` = 0 group by `test`.`t1`.`a` drop table t1; @@ -3505,7 +3505,7 @@ test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK EXPLAIN SELECT MAX(c2), c1 FROM t1 WHERE c1 = 4 GROUP BY c1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref c1 c1 5 const 28 Using index +1 SIMPLE t1 range c1 c1 5 NULL 6 Using where; Using index for group-by FLUSH STATUS; SELECT MAX(c2), c1 FROM t1 WHERE c1 = 4 GROUP BY c1; MAX(c2) c1 @@ -3513,9 +3513,9 @@ MAX(c2) c1 SHOW SESSION STATUS LIKE 'Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 -Handler_read_last 0 -Handler_read_next 20 +Handler_read_key 3 +Handler_read_last 1 +Handler_read_next 0 Handler_read_prev 0 Handler_read_retry 0 Handler_read_rnd 0 diff --git a/storage/rocksdb/mysql-test/rocksdb/r/i_s.result b/storage/rocksdb/mysql-test/rocksdb/r/i_s.result index a77a4eec0dd..a45e6c636cc 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/i_s.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/i_s.result @@ -19,141 +19,141 @@ ROCKSDB_TRX SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_CF_OPTIONS; Table Create Table ROCKSDB_CF_OPTIONS CREATE TEMPORARY TABLE `ROCKSDB_CF_OPTIONS` ( - `CF_NAME` varchar(193) NOT NULL DEFAULT '', - `OPTION_TYPE` varchar(193) NOT NULL DEFAULT '', - `VALUE` varchar(193) NOT NULL DEFAULT '' + `CF_NAME` varchar(193) NOT NULL, + `OPTION_TYPE` varchar(193) NOT NULL, + `VALUE` varchar(193) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_CFSTATS; Table Create Table ROCKSDB_CFSTATS CREATE TEMPORARY TABLE `ROCKSDB_CFSTATS` ( - `CF_NAME` varchar(193) NOT NULL DEFAULT '', - `STAT_TYPE` varchar(193) NOT NULL DEFAULT '', - `VALUE` bigint(21) NOT NULL DEFAULT 0 + `CF_NAME` varchar(193) NOT NULL, + `STAT_TYPE` varchar(193) NOT NULL, + `VALUE` bigint(21) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_COMPACTION_STATS; Table Create Table ROCKSDB_COMPACTION_STATS CREATE TEMPORARY TABLE `ROCKSDB_COMPACTION_STATS` ( - `CF_NAME` varchar(193) NOT NULL DEFAULT '', - `LEVEL` varchar(513) NOT NULL DEFAULT '', - `TYPE` varchar(513) NOT NULL DEFAULT '', - `VALUE` double NOT NULL DEFAULT 0 + `CF_NAME` varchar(193) NOT NULL, + `LEVEL` varchar(513) NOT NULL, + `TYPE` varchar(513) NOT NULL, + `VALUE` double NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_DBSTATS; Table Create Table ROCKSDB_DBSTATS CREATE TEMPORARY TABLE `ROCKSDB_DBSTATS` ( - `STAT_TYPE` varchar(193) NOT NULL DEFAULT '', - `VALUE` bigint(21) NOT NULL DEFAULT 0 + `STAT_TYPE` varchar(193) NOT NULL, + `VALUE` bigint(21) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_DDL; Table Create Table ROCKSDB_DDL CREATE TEMPORARY TABLE `ROCKSDB_DDL` ( - `TABLE_SCHEMA` varchar(193) NOT NULL DEFAULT '', - `TABLE_NAME` varchar(193) NOT NULL DEFAULT '', - `PARTITION_NAME` varchar(193) DEFAULT NULL, - `INDEX_NAME` varchar(193) NOT NULL DEFAULT '', - `COLUMN_FAMILY` int(11) NOT NULL DEFAULT 0, - `INDEX_NUMBER` int(11) NOT NULL DEFAULT 0, - `INDEX_TYPE` smallint(6) NOT NULL DEFAULT 0, - `KV_FORMAT_VERSION` smallint(6) NOT NULL DEFAULT 0, - `TTL_DURATION` bigint(21) NOT NULL DEFAULT 0, - `INDEX_FLAGS` bigint(21) NOT NULL DEFAULT 0, - `CF` varchar(193) NOT NULL DEFAULT '', - `AUTO_INCREMENT` bigint(21) unsigned DEFAULT NULL + `TABLE_SCHEMA` varchar(193) NOT NULL, + `TABLE_NAME` varchar(193) NOT NULL, + `PARTITION_NAME` varchar(193), + `INDEX_NAME` varchar(193) NOT NULL, + `COLUMN_FAMILY` int(11) NOT NULL, + `INDEX_NUMBER` int(11) NOT NULL, + `INDEX_TYPE` smallint(6) NOT NULL, + `KV_FORMAT_VERSION` smallint(6) NOT NULL, + `TTL_DURATION` bigint(21) NOT NULL, + `INDEX_FLAGS` bigint(21) NOT NULL, + `CF` varchar(193) NOT NULL, + `AUTO_INCREMENT` bigint(21) unsigned ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_DEADLOCK; Table Create Table ROCKSDB_DEADLOCK CREATE TEMPORARY TABLE `ROCKSDB_DEADLOCK` ( - `DEADLOCK_ID` bigint(21) NOT NULL DEFAULT 0, - `TIMESTAMP` bigint(21) NOT NULL DEFAULT 0, - `TRANSACTION_ID` bigint(21) NOT NULL DEFAULT 0, - `CF_NAME` varchar(193) NOT NULL DEFAULT '', - `WAITING_KEY` varchar(513) NOT NULL DEFAULT '', - `LOCK_TYPE` varchar(193) NOT NULL DEFAULT '', - `INDEX_NAME` varchar(193) NOT NULL DEFAULT '', - `TABLE_NAME` varchar(193) NOT NULL DEFAULT '', - `ROLLED_BACK` bigint(21) NOT NULL DEFAULT 0 + `DEADLOCK_ID` bigint(21) NOT NULL, + `TIMESTAMP` bigint(21) NOT NULL, + `TRANSACTION_ID` bigint(21) NOT NULL, + `CF_NAME` varchar(193) NOT NULL, + `WAITING_KEY` varchar(513) NOT NULL, + `LOCK_TYPE` varchar(193) NOT NULL, + `INDEX_NAME` varchar(193) NOT NULL, + `TABLE_NAME` varchar(193) NOT NULL, + `ROLLED_BACK` bigint(21) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO; Table Create Table ROCKSDB_GLOBAL_INFO CREATE TEMPORARY TABLE `ROCKSDB_GLOBAL_INFO` ( - `TYPE` varchar(513) NOT NULL DEFAULT '', - `NAME` varchar(513) NOT NULL DEFAULT '', - `VALUE` varchar(513) NOT NULL DEFAULT '' + `TYPE` varchar(513) NOT NULL, + `NAME` varchar(513) NOT NULL, + `VALUE` varchar(513) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_INDEX_FILE_MAP; Table Create Table ROCKSDB_INDEX_FILE_MAP CREATE TEMPORARY TABLE `ROCKSDB_INDEX_FILE_MAP` ( - `COLUMN_FAMILY` int(11) NOT NULL DEFAULT 0, - `INDEX_NUMBER` int(11) NOT NULL DEFAULT 0, - `SST_NAME` varchar(193) NOT NULL DEFAULT '', - `NUM_ROWS` bigint(21) NOT NULL DEFAULT 0, - `DATA_SIZE` bigint(21) NOT NULL DEFAULT 0, - `ENTRY_DELETES` bigint(21) NOT NULL DEFAULT 0, - `ENTRY_SINGLEDELETES` bigint(21) NOT NULL DEFAULT 0, - `ENTRY_MERGES` bigint(21) NOT NULL DEFAULT 0, - `ENTRY_OTHERS` bigint(21) NOT NULL DEFAULT 0, - `DISTINCT_KEYS_PREFIX` varchar(800) NOT NULL DEFAULT '' + `COLUMN_FAMILY` int(11) NOT NULL, + `INDEX_NUMBER` int(11) NOT NULL, + `SST_NAME` varchar(193) NOT NULL, + `NUM_ROWS` bigint(21) NOT NULL, + `DATA_SIZE` bigint(21) NOT NULL, + `ENTRY_DELETES` bigint(21) NOT NULL, + `ENTRY_SINGLEDELETES` bigint(21) NOT NULL, + `ENTRY_MERGES` bigint(21) NOT NULL, + `ENTRY_OTHERS` bigint(21) NOT NULL, + `DISTINCT_KEYS_PREFIX` varchar(800) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_LOCKS; Table Create Table ROCKSDB_LOCKS CREATE TEMPORARY TABLE `ROCKSDB_LOCKS` ( - `COLUMN_FAMILY_ID` int(11) NOT NULL DEFAULT 0, - `TRANSACTION_ID` int(11) NOT NULL DEFAULT 0, - `KEY` varchar(513) NOT NULL DEFAULT '', - `MODE` varchar(32) NOT NULL DEFAULT '' + `COLUMN_FAMILY_ID` int(11) NOT NULL, + `TRANSACTION_ID` int(11) NOT NULL, + `KEY` varchar(513) NOT NULL, + `MODE` varchar(32) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_PERF_CONTEXT; Table Create Table ROCKSDB_PERF_CONTEXT CREATE TEMPORARY TABLE `ROCKSDB_PERF_CONTEXT` ( - `TABLE_SCHEMA` varchar(193) NOT NULL DEFAULT '', - `TABLE_NAME` varchar(193) NOT NULL DEFAULT '', - `PARTITION_NAME` varchar(193) DEFAULT NULL, - `STAT_TYPE` varchar(193) NOT NULL DEFAULT '', - `VALUE` bigint(21) NOT NULL DEFAULT 0 + `TABLE_SCHEMA` varchar(193) NOT NULL, + `TABLE_NAME` varchar(193) NOT NULL, + `PARTITION_NAME` varchar(193), + `STAT_TYPE` varchar(193) NOT NULL, + `VALUE` bigint(21) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_PERF_CONTEXT_GLOBAL; Table Create Table ROCKSDB_PERF_CONTEXT_GLOBAL CREATE TEMPORARY TABLE `ROCKSDB_PERF_CONTEXT_GLOBAL` ( - `STAT_TYPE` varchar(193) NOT NULL DEFAULT '', - `VALUE` bigint(21) NOT NULL DEFAULT 0 + `STAT_TYPE` varchar(193) NOT NULL, + `VALUE` bigint(21) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_SST_PROPS; Table Create Table ROCKSDB_SST_PROPS CREATE TEMPORARY TABLE `ROCKSDB_SST_PROPS` ( - `SST_NAME` varchar(193) NOT NULL DEFAULT '', - `COLUMN_FAMILY` int(11) NOT NULL DEFAULT 0, - `DATA_BLOCKS` bigint(21) NOT NULL DEFAULT 0, - `ENTRIES` bigint(21) NOT NULL DEFAULT 0, - `RAW_KEY_SIZE` bigint(21) NOT NULL DEFAULT 0, - `RAW_VALUE_SIZE` bigint(21) NOT NULL DEFAULT 0, - `DATA_BLOCK_SIZE` bigint(21) NOT NULL DEFAULT 0, - `INDEX_BLOCK_SIZE` bigint(21) NOT NULL DEFAULT 0, - `INDEX_PARTITIONS` int(11) NOT NULL DEFAULT 0, - `TOP_LEVEL_INDEX_SIZE` bigint(21) NOT NULL DEFAULT 0, - `FILTER_BLOCK_SIZE` bigint(21) NOT NULL DEFAULT 0, - `COMPRESSION_ALGO` varchar(193) NOT NULL DEFAULT '', - `CREATION_TIME` bigint(21) NOT NULL DEFAULT 0, - `FILE_CREATION_TIME` bigint(21) NOT NULL DEFAULT 0, - `OLDEST_KEY_TIME` bigint(21) NOT NULL DEFAULT 0, - `FILTER_POLICY` varchar(193) NOT NULL DEFAULT '', - `COMPRESSION_OPTIONS` varchar(193) NOT NULL DEFAULT '' + `SST_NAME` varchar(193) NOT NULL, + `COLUMN_FAMILY` int(11) NOT NULL, + `DATA_BLOCKS` bigint(21) NOT NULL, + `ENTRIES` bigint(21) NOT NULL, + `RAW_KEY_SIZE` bigint(21) NOT NULL, + `RAW_VALUE_SIZE` bigint(21) NOT NULL, + `DATA_BLOCK_SIZE` bigint(21) NOT NULL, + `INDEX_BLOCK_SIZE` bigint(21) NOT NULL, + `INDEX_PARTITIONS` int(11) NOT NULL, + `TOP_LEVEL_INDEX_SIZE` bigint(21) NOT NULL, + `FILTER_BLOCK_SIZE` bigint(21) NOT NULL, + `COMPRESSION_ALGO` varchar(193) NOT NULL, + `CREATION_TIME` bigint(21) NOT NULL, + `FILE_CREATION_TIME` bigint(21) NOT NULL, + `OLDEST_KEY_TIME` bigint(21) NOT NULL, + `FILTER_POLICY` varchar(193) NOT NULL, + `COMPRESSION_OPTIONS` varchar(193) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SHOW CREATE TABLE INFORMATION_SCHEMA.ROCKSDB_TRX; Table Create Table ROCKSDB_TRX CREATE TEMPORARY TABLE `ROCKSDB_TRX` ( - `TRANSACTION_ID` bigint(21) NOT NULL DEFAULT 0, - `STATE` varchar(193) NOT NULL DEFAULT '', - `NAME` varchar(193) NOT NULL DEFAULT '', - `WRITE_COUNT` bigint(21) NOT NULL DEFAULT 0, - `LOCK_COUNT` bigint(21) NOT NULL DEFAULT 0, - `TIMEOUT_SEC` int(11) NOT NULL DEFAULT 0, - `WAITING_KEY` varchar(513) NOT NULL DEFAULT '', - `WAITING_COLUMN_FAMILY_ID` int(11) NOT NULL DEFAULT 0, - `IS_REPLICATION` int(11) NOT NULL DEFAULT 0, - `SKIP_TRX_API` int(11) NOT NULL DEFAULT 0, - `READ_ONLY` int(11) NOT NULL DEFAULT 0, - `HAS_DEADLOCK_DETECTION` int(11) NOT NULL DEFAULT 0, - `NUM_ONGOING_BULKLOAD` int(11) NOT NULL DEFAULT 0, - `THREAD_ID` int(11) NOT NULL DEFAULT 0, - `QUERY` varchar(193) NOT NULL DEFAULT '' + `TRANSACTION_ID` bigint(21) NOT NULL, + `STATE` varchar(193) NOT NULL, + `NAME` varchar(193) NOT NULL, + `WRITE_COUNT` bigint(21) NOT NULL, + `LOCK_COUNT` bigint(21) NOT NULL, + `TIMEOUT_SEC` int(11) NOT NULL, + `WAITING_KEY` varchar(513) NOT NULL, + `WAITING_COLUMN_FAMILY_ID` int(11) NOT NULL, + `IS_REPLICATION` int(11) NOT NULL, + `SKIP_TRX_API` int(11) NOT NULL, + `READ_ONLY` int(11) NOT NULL, + `HAS_DEADLOCK_DETECTION` int(11) NOT NULL, + `NUM_ONGOING_BULKLOAD` int(11) NOT NULL, + `THREAD_ID` int(11) NOT NULL, + `QUERY` varchar(193) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 diff --git a/storage/rocksdb/mysql-test/rocksdb/r/i_s_deadlock.result b/storage/rocksdb/mysql-test/rocksdb/r/i_s_deadlock.result index 34c2bfb3e0c..de6de581cd8 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/i_s_deadlock.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/i_s_deadlock.result @@ -13,15 +13,15 @@ connection default; show create table information_schema.rocksdb_deadlock; Table Create Table ROCKSDB_DEADLOCK CREATE TEMPORARY TABLE `ROCKSDB_DEADLOCK` ( - `DEADLOCK_ID` bigint(21) NOT NULL DEFAULT 0, - `TIMESTAMP` bigint(21) NOT NULL DEFAULT 0, - `TRANSACTION_ID` bigint(21) NOT NULL DEFAULT 0, - `CF_NAME` varchar(193) NOT NULL DEFAULT '', - `WAITING_KEY` varchar(513) NOT NULL DEFAULT '', - `LOCK_TYPE` varchar(193) NOT NULL DEFAULT '', - `INDEX_NAME` varchar(193) NOT NULL DEFAULT '', - `TABLE_NAME` varchar(193) NOT NULL DEFAULT '', - `ROLLED_BACK` bigint(21) NOT NULL DEFAULT 0 + `DEADLOCK_ID` bigint(21) NOT NULL, + `TIMESTAMP` bigint(21) NOT NULL, + `TRANSACTION_ID` bigint(21) NOT NULL, + `CF_NAME` varchar(193) NOT NULL, + `WAITING_KEY` varchar(513) NOT NULL, + `LOCK_TYPE` varchar(193) NOT NULL, + `INDEX_NAME` varchar(193) NOT NULL, + `TABLE_NAME` varchar(193) NOT NULL, + `ROLLED_BACK` bigint(21) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 create table t (i int primary key) engine=rocksdb; insert into t values (1), (2), (3); diff --git a/storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result b/storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result index 95cbc3e7026..2dc3d02d4b1 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result @@ -932,6 +932,7 @@ rocksdb_force_flush_memtable_now OFF rocksdb_force_index_records_in_range 0 rocksdb_git_hash # rocksdb_hash_index_allow_collision ON +rocksdb_ignore_datadic_errors 0 rocksdb_ignore_unknown_options ON rocksdb_index_type kBinarySearch rocksdb_info_log_level error_level diff --git a/storage/rocksdb/mysql-test/rocksdb/r/tbl_opt_data_index_dir.result b/storage/rocksdb/mysql-test/rocksdb/r/tbl_opt_data_index_dir.result index 90f163b7d4b..9691eeeffdf 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/tbl_opt_data_index_dir.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/tbl_opt_data_index_dir.result @@ -1,16 +1,16 @@ DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb DATA DIRECTORY = '/foo/bar/data'; -ERROR HY000: Can't create table `test`.`t1` (errno: 199 "Unknown error 199") +ERROR HY000: Can't create table `test`.`t1` (errno: XXX "Unknown error XXX") show warnings; Level Code Message -Error 1005 Can't create table `test`.`t1` (errno: 199 "Unknown error 199") -Warning 1296 Got error 199 'Specifying DATA DIRECTORY for an individual table is not supported.' from ROCKSDB +Error 1005 Can't create table `test`.`t1` (errno: XXX "Unknown error XXX") +Warning 1296 Got error XXX 'Specifying DATA DIRECTORY for an individual table is not supported.' from ROCKSDB CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb INDEX DIRECTORY = '/foo/bar/index'; -ERROR HY000: Can't create table `test`.`t1` (errno: 200 "Unknown error 200") +ERROR HY000: Can't create table `test`.`t1` (errno: XXX "Unknown error XXX") show warnings; Level Code Message -Error 1005 Can't create table `test`.`t1` (errno: 200 "Unknown error 200") -Warning 1296 Got error 200 'Specifying INDEX DIRECTORY for an individual table is not supported.' from ROCKSDB +Error 1005 Can't create table `test`.`t1` (errno: XXX "Unknown error XXX") +Warning 1296 Got error XXX 'Specifying INDEX DIRECTORY for an individual table is not supported.' from ROCKSDB CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY) ENGINE=rocksdb PARTITION BY RANGE (id) ( PARTITION P0 VALUES LESS THAN (1000) @@ -19,11 +19,11 @@ PARTITION P1 VALUES LESS THAN (2000) DATA DIRECTORY = '/foo/bar/data/', PARTITION P2 VALUES LESS THAN (MAXVALUE) ); -ERROR HY000: Can't create table `test`.`t1` (errno: 199 "Unknown error 199") +ERROR HY000: Can't create table `test`.`t1` (errno: XXX "Unknown error XXX") show warnings; Level Code Message -Error 1005 Can't create table `test`.`t1` (errno: 199 "Unknown error 199") -Warning 1296 Got error 199 'Specifying DATA DIRECTORY for an individual table is not supported.' from ROCKSDB +Error 1005 Can't create table `test`.`t1` (errno: XXX "Unknown error XXX") +Warning 1296 Got error XXX 'Specifying DATA DIRECTORY for an individual table is not supported.' from ROCKSDB Error 6 Error on delete of './test/t1.par' (Errcode: 2 "No such file or directory") CREATE TABLE t1 (id int not null primary key) ENGINE=rocksdb PARTITION BY RANGE (id) ( @@ -33,9 +33,9 @@ PARTITION P1 VALUES LESS THAN (2000) INDEX DIRECTORY = '/foo/bar/data/', PARTITION P2 VALUES LESS THAN (MAXVALUE) ); -ERROR HY000: Can't create table `test`.`t1` (errno: 200 "Unknown error 200") +ERROR HY000: Can't create table `test`.`t1` (errno: XXX "Unknown error XXX") show warnings; Level Code Message -Error 1005 Can't create table `test`.`t1` (errno: 200 "Unknown error 200") -Warning 1296 Got error 200 'Specifying INDEX DIRECTORY for an individual table is not supported.' from ROCKSDB +Error 1005 Can't create table `test`.`t1` (errno: XXX "Unknown error XXX") +Warning 1296 Got error XXX 'Specifying INDEX DIRECTORY for an individual table is not supported.' from ROCKSDB Error 6 Error on delete of './test/t1.par' (Errcode: 2 "No such file or directory") diff --git a/storage/rocksdb/mysql-test/rocksdb/r/type_char.result b/storage/rocksdb/mysql-test/rocksdb/r/type_char.result index 1786dfae1e7..b35b5cb1832 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/type_char.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/type_char.result @@ -29,15 +29,15 @@ Warning 1265 Data truncated for column 'c20' at row 1 Warning 1265 Data truncated for column 'c255' at row 1 INSERT INTO t1 (c,c0,c1,c20,c255) SELECT c255, c255, c255, c255, CONCAT('a',c255,c1) FROM t1; Warnings: -Warning 1265 Data truncated for column 'c' at row 5 -Warning 1265 Data truncated for column 'c0' at row 5 -Warning 1265 Data truncated for column 'c1' at row 5 -Warning 1265 Data truncated for column 'c20' at row 5 -Warning 1265 Data truncated for column 'c' at row 6 -Warning 1265 Data truncated for column 'c0' at row 6 -Warning 1265 Data truncated for column 'c1' at row 6 -Warning 1265 Data truncated for column 'c20' at row 6 -Warning 1265 Data truncated for column 'c255' at row 6 +Warning 1265 Data truncated for column 'c' at row 2 +Warning 1265 Data truncated for column 'c0' at row 2 +Warning 1265 Data truncated for column 'c1' at row 2 +Warning 1265 Data truncated for column 'c20' at row 2 +Warning 1265 Data truncated for column 'c' at row 3 +Warning 1265 Data truncated for column 'c0' at row 3 +Warning 1265 Data truncated for column 'c1' at row 3 +Warning 1265 Data truncated for column 'c20' at row 3 +Warning 1265 Data truncated for column 'c255' at row 3 SELECT c,c0,c1,c20,c255 FROM t1; c c0 c1 c20 c255 diff --git a/storage/rocksdb/mysql-test/rocksdb/r/type_int.result b/storage/rocksdb/mysql-test/rocksdb/r/type_int.result index 306042912d0..b949a723f22 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/type_int.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/type_int.result @@ -129,70 +129,70 @@ Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b20' at row 1 INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); Warnings: -Warning 1264 Out of range value for column 'i' at row 8 -Warning 1264 Out of range value for column 'i0' at row 8 -Warning 1264 Out of range value for column 'i1' at row 8 -Warning 1264 Out of range value for column 'i20' at row 8 -Warning 1264 Out of range value for column 't' at row 8 -Warning 1264 Out of range value for column 't0' at row 8 -Warning 1264 Out of range value for column 't1' at row 8 -Warning 1264 Out of range value for column 't20' at row 8 -Warning 1264 Out of range value for column 's' at row 8 -Warning 1264 Out of range value for column 's0' at row 8 -Warning 1264 Out of range value for column 's1' at row 8 -Warning 1264 Out of range value for column 's20' at row 8 -Warning 1264 Out of range value for column 'm' at row 8 -Warning 1264 Out of range value for column 'm0' at row 8 -Warning 1264 Out of range value for column 'm1' at row 8 -Warning 1264 Out of range value for column 'm20' at row 8 -Warning 1264 Out of range value for column 'i' at row 9 -Warning 1264 Out of range value for column 'i0' at row 9 -Warning 1264 Out of range value for column 'i1' at row 9 -Warning 1264 Out of range value for column 'i20' at row 9 -Warning 1264 Out of range value for column 't' at row 9 -Warning 1264 Out of range value for column 't0' at row 9 -Warning 1264 Out of range value for column 't1' at row 9 -Warning 1264 Out of range value for column 't20' at row 9 -Warning 1264 Out of range value for column 's' at row 9 -Warning 1264 Out of range value for column 's0' at row 9 -Warning 1264 Out of range value for column 's1' at row 9 -Warning 1264 Out of range value for column 's20' at row 9 -Warning 1264 Out of range value for column 'm' at row 9 -Warning 1264 Out of range value for column 'm0' at row 9 -Warning 1264 Out of range value for column 'm1' at row 9 -Warning 1264 Out of range value for column 'm20' at row 9 -Warning 1264 Out of range value for column 'i' at row 10 -Warning 1264 Out of range value for column 'i0' at row 10 -Warning 1264 Out of range value for column 'i1' at row 10 -Warning 1264 Out of range value for column 'i20' at row 10 -Warning 1264 Out of range value for column 't' at row 10 -Warning 1264 Out of range value for column 't0' at row 10 -Warning 1264 Out of range value for column 't1' at row 10 -Warning 1264 Out of range value for column 't20' at row 10 -Warning 1264 Out of range value for column 's' at row 10 -Warning 1264 Out of range value for column 's0' at row 10 -Warning 1264 Out of range value for column 's1' at row 10 -Warning 1264 Out of range value for column 's20' at row 10 -Warning 1264 Out of range value for column 'm' at row 10 -Warning 1264 Out of range value for column 'm0' at row 10 -Warning 1264 Out of range value for column 'm1' at row 10 -Warning 1264 Out of range value for column 'm20' at row 10 -Warning 1264 Out of range value for column 'i' at row 11 -Warning 1264 Out of range value for column 'i0' at row 11 -Warning 1264 Out of range value for column 'i1' at row 11 -Warning 1264 Out of range value for column 'i20' at row 11 -Warning 1264 Out of range value for column 't' at row 11 -Warning 1264 Out of range value for column 't0' at row 11 -Warning 1264 Out of range value for column 't1' at row 11 -Warning 1264 Out of range value for column 't20' at row 11 -Warning 1264 Out of range value for column 's' at row 11 -Warning 1264 Out of range value for column 's0' at row 11 -Warning 1264 Out of range value for column 's1' at row 11 -Warning 1264 Out of range value for column 's20' at row 11 -Warning 1264 Out of range value for column 'm' at row 11 -Warning 1264 Out of range value for column 'm0' at row 11 -Warning 1264 Out of range value for column 'm1' at row 11 -Warning 1264 Out of range value for column 'm20' at row 11 +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'i' at row 2 +Warning 1264 Out of range value for column 'i0' at row 2 +Warning 1264 Out of range value for column 'i1' at row 2 +Warning 1264 Out of range value for column 'i20' at row 2 +Warning 1264 Out of range value for column 't' at row 2 +Warning 1264 Out of range value for column 't0' at row 2 +Warning 1264 Out of range value for column 't1' at row 2 +Warning 1264 Out of range value for column 't20' at row 2 +Warning 1264 Out of range value for column 's' at row 2 +Warning 1264 Out of range value for column 's0' at row 2 +Warning 1264 Out of range value for column 's1' at row 2 +Warning 1264 Out of range value for column 's20' at row 2 +Warning 1264 Out of range value for column 'm' at row 2 +Warning 1264 Out of range value for column 'm0' at row 2 +Warning 1264 Out of range value for column 'm1' at row 2 +Warning 1264 Out of range value for column 'm20' at row 2 +Warning 1264 Out of range value for column 'i' at row 3 +Warning 1264 Out of range value for column 'i0' at row 3 +Warning 1264 Out of range value for column 'i1' at row 3 +Warning 1264 Out of range value for column 'i20' at row 3 +Warning 1264 Out of range value for column 't' at row 3 +Warning 1264 Out of range value for column 't0' at row 3 +Warning 1264 Out of range value for column 't1' at row 3 +Warning 1264 Out of range value for column 't20' at row 3 +Warning 1264 Out of range value for column 's' at row 3 +Warning 1264 Out of range value for column 's0' at row 3 +Warning 1264 Out of range value for column 's1' at row 3 +Warning 1264 Out of range value for column 's20' at row 3 +Warning 1264 Out of range value for column 'm' at row 3 +Warning 1264 Out of range value for column 'm0' at row 3 +Warning 1264 Out of range value for column 'm1' at row 3 +Warning 1264 Out of range value for column 'm20' at row 3 +Warning 1264 Out of range value for column 'i' at row 4 +Warning 1264 Out of range value for column 'i0' at row 4 +Warning 1264 Out of range value for column 'i1' at row 4 +Warning 1264 Out of range value for column 'i20' at row 4 +Warning 1264 Out of range value for column 't' at row 4 +Warning 1264 Out of range value for column 't0' at row 4 +Warning 1264 Out of range value for column 't1' at row 4 +Warning 1264 Out of range value for column 't20' at row 4 +Warning 1264 Out of range value for column 's' at row 4 +Warning 1264 Out of range value for column 's0' at row 4 +Warning 1264 Out of range value for column 's1' at row 4 +Warning 1264 Out of range value for column 's20' at row 4 +Warning 1264 Out of range value for column 'm' at row 4 +Warning 1264 Out of range value for column 'm0' at row 4 +Warning 1264 Out of range value for column 'm1' at row 4 +Warning 1264 Out of range value for column 'm20' at row 4 SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 -2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 diff --git a/storage/rocksdb/mysql-test/rocksdb/r/type_varbinary.result b/storage/rocksdb/mysql-test/rocksdb/r/type_varbinary.result index 6de8c0331cd..090a9dbb4e2 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/type_varbinary.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/type_varbinary.result @@ -65,13 +65,13 @@ Warning 1265 Data truncated for column 'v64' at row 1 Warning 1265 Data truncated for column 'v65000' at row 1 INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, CONCAT('a',v65000), CONCAT(v65000,v1) FROM t1; Warnings: -Warning 1265 Data truncated for column 'v0' at row 5 -Warning 1265 Data truncated for column 'v1' at row 5 -Warning 1265 Data truncated for column 'v64' at row 5 -Warning 1265 Data truncated for column 'v0' at row 6 -Warning 1265 Data truncated for column 'v1' at row 6 -Warning 1265 Data truncated for column 'v64' at row 6 -Warning 1265 Data truncated for column 'v65000' at row 6 +Warning 1265 Data truncated for column 'v0' at row 2 +Warning 1265 Data truncated for column 'v1' at row 2 +Warning 1265 Data truncated for column 'v64' at row 2 +Warning 1265 Data truncated for column 'v0' at row 3 +Warning 1265 Data truncated for column 'v1' at row 3 +Warning 1265 Data truncated for column 'v64' at row 3 +Warning 1265 Data truncated for column 'v65000' at row 3 SELECT HEX(v0), HEX(v1), HEX(v64), LENGTH(HEX(v65000)) FROM t1; HEX(v0) HEX(v1) HEX(v64) LENGTH(HEX(v65000)) 0 diff --git a/storage/rocksdb/mysql-test/rocksdb/r/type_varchar.result b/storage/rocksdb/mysql-test/rocksdb/r/type_varchar.result index 4c5ef47590a..745cfa5991e 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/type_varchar.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/type_varchar.result @@ -110,13 +110,13 @@ Warning 1265 Data truncated for column 'v64' at row 1 Warning 1265 Data truncated for column 'v65000' at row 1 INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, CONCAT('a',v65000), CONCAT(v65000,v1) FROM t1; Warnings: -Warning 1265 Data truncated for column 'v0' at row 5 -Warning 1265 Data truncated for column 'v1' at row 5 -Warning 1265 Data truncated for column 'v64' at row 5 -Warning 1265 Data truncated for column 'v65000' at row 5 -Warning 1265 Data truncated for column 'v0' at row 6 -Warning 1265 Data truncated for column 'v1' at row 6 -Warning 1265 Data truncated for column 'v64' at row 6 +Warning 1265 Data truncated for column 'v0' at row 2 +Warning 1265 Data truncated for column 'v1' at row 2 +Warning 1265 Data truncated for column 'v64' at row 2 +Warning 1265 Data truncated for column 'v65000' at row 2 +Warning 1265 Data truncated for column 'v0' at row 3 +Warning 1265 Data truncated for column 'v1' at row 3 +Warning 1265 Data truncated for column 'v64' at row 3 SELECT v0, v1, v64, LENGTH(v65000) FROM t1; v0 v1 v64 LENGTH(v65000) 0 diff --git a/storage/rocksdb/mysql-test/rocksdb/t/tbl_opt_data_index_dir.test b/storage/rocksdb/mysql-test/rocksdb/t/tbl_opt_data_index_dir.test index 6fcfd491af1..e2595b10fd7 100644 --- a/storage/rocksdb/mysql-test/rocksdb/t/tbl_opt_data_index_dir.test +++ b/storage/rocksdb/mysql-test/rocksdb/t/tbl_opt_data_index_dir.test @@ -17,23 +17,23 @@ DROP TABLE IF EXISTS t1; # opposed to "Unknown error nn" on Linux/etc. # Replacing 'error:' with 'error' below to make the output uniform. ---replace_result error: error +--replace_regex /err(no:|or):? \d+/err\1 XXX/ --error ER_CANT_CREATE_TABLE CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb DATA DIRECTORY = '/foo/bar/data'; ---replace_result error: error +--replace_regex /err(no:|or):? \d+/err\1 XXX/ show warnings; ---replace_result error: error +--replace_regex /err(no:|or):? \d+/err\1 XXX/ --error ER_CANT_CREATE_TABLE CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(8)) ENGINE=rocksdb INDEX DIRECTORY = '/foo/bar/index'; ---replace_result error: error +--replace_regex /err(no:|or):? \d+/err\1 XXX/ show warnings; # # Verify that we'll get the same error codes when using the partitions. # ---replace_result error: error +--replace_regex /err(no:|or):? \d+/err\1 XXX/ --error ER_CANT_CREATE_TABLE CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY) ENGINE=rocksdb PARTITION BY RANGE (id) ( @@ -43,10 +43,10 @@ CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY) ENGINE=rocksdb PARTITION BY RANGE DATA DIRECTORY = '/foo/bar/data/', PARTITION P2 VALUES LESS THAN (MAXVALUE) ); ---replace_result error: error +--replace_regex /err(no:|or):? \d+/err\1 XXX/ show warnings; ---replace_result error: error +--replace_regex /err(no:|or):? \d+/err\1 XXX/ --error ER_CANT_CREATE_TABLE CREATE TABLE t1 (id int not null primary key) ENGINE=rocksdb PARTITION BY RANGE (id) ( @@ -56,5 +56,5 @@ CREATE TABLE t1 (id int not null primary key) ENGINE=rocksdb PARTITION BY RANGE INDEX DIRECTORY = '/foo/bar/data/', PARTITION P2 VALUES LESS THAN (MAXVALUE) ); ---replace_result error: error +--replace_regex /err(no:|or):? \d+/err\1 XXX/ show warnings; diff --git a/storage/rocksdb/mysql-test/rocksdb_sys_vars/r/rocksdb_ignore_datadic_errors_basic.result b/storage/rocksdb/mysql-test/rocksdb_sys_vars/r/rocksdb_ignore_datadic_errors_basic.result new file mode 100644 index 00000000000..daa70a80683 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_sys_vars/r/rocksdb_ignore_datadic_errors_basic.result @@ -0,0 +1,7 @@ +SET @start_global_value = @@global.ROCKSDB_IGNORE_DATADIC_ERRORS; +SELECT @start_global_value; +@start_global_value +0 +"Trying to set variable @@global.ROCKSDB_IGNORE_DATADIC_ERRORS to 444. It should fail because it is readonly." +SET @@global.ROCKSDB_IGNORE_DATADIC_ERRORS = 444; +ERROR HY000: Variable 'rocksdb_ignore_datadic_errors' is a read only variable diff --git a/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_ignore_datadic_errors_basic.test b/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_ignore_datadic_errors_basic.test new file mode 100644 index 00000000000..b412a018869 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_ignore_datadic_errors_basic.test @@ -0,0 +1,6 @@ +--source include/have_rocksdb.inc + +--let $sys_var=ROCKSDB_IGNORE_DATADIC_ERRORS +--let $read_only=1 +--let $session=0 +--source include/rocksdb_sys_var.inc diff --git a/storage/rocksdb/rdb_datadic.cc b/storage/rocksdb/rdb_datadic.cc index b377edceab4..164f6ba8205 100644 --- a/storage/rocksdb/rdb_datadic.cc +++ b/storage/rocksdb/rdb_datadic.cc @@ -5266,6 +5266,12 @@ void Rdb_dict_manager::log_start_drop_index(GL_INDEX_ID gl_index_id, "from index id (%u,%u). MyRocks data dictionary may " "get corrupted.", gl_index_id.cf_id, gl_index_id.index_id); + if (rocksdb_ignore_datadic_errors) + { + sql_print_error("RocksDB: rocksdb_ignore_datadic_errors=1, " + "trying to continue"); + return; + } abort(); } } diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc index f51e67559b7..f9ab0892437 100644 --- a/storage/spider/ha_spider.cc +++ b/storage/spider/ha_spider.cc @@ -1070,7 +1070,8 @@ THR_LOCK_DATA **ha_spider::store_lock( if ( wide_handler->sql_command == SQLCOM_DROP_TABLE || wide_handler->sql_command == SQLCOM_ALTER_TABLE || - wide_handler->sql_command == SQLCOM_SHOW_CREATE + wide_handler->sql_command == SQLCOM_SHOW_CREATE || + wide_handler->sql_command == SQLCOM_SHOW_FIELDS ) { if ( lock_type == TL_READ_NO_INSERT && @@ -8521,7 +8522,8 @@ int ha_spider::info( spider_param_table_init_error_interval()) { pthread_mutex_unlock(&share->sts_mutex); - if (wide_handler->sql_command == SQLCOM_SHOW_CREATE) + if (wide_handler->sql_command == SQLCOM_SHOW_CREATE || + wide_handler->sql_command == SQLCOM_SHOW_FIELDS) { if (thd->is_error()) { @@ -8594,7 +8596,8 @@ int ha_spider::info( share->init_error = TRUE; share->init = TRUE; } - if (wide_handler->sql_command == SQLCOM_SHOW_CREATE) + if (wide_handler->sql_command == SQLCOM_SHOW_CREATE || + wide_handler->sql_command == SQLCOM_SHOW_FIELDS) { if (thd->is_error()) { @@ -8658,7 +8661,8 @@ int ha_spider::info( share->init_error = TRUE; share->init = TRUE; } - if (wide_handler->sql_command == SQLCOM_SHOW_CREATE) + if (wide_handler->sql_command == SQLCOM_SHOW_CREATE || + wide_handler->sql_command == SQLCOM_SHOW_FIELDS) { if (thd->is_error()) { @@ -8687,7 +8691,8 @@ int ha_spider::info( if ((error_num = spider_create_sts_thread(share))) { pthread_mutex_unlock(&share->sts_mutex); - if (wide_handler->sql_command == SQLCOM_SHOW_CREATE) + if (wide_handler->sql_command == SQLCOM_SHOW_CREATE || + wide_handler->sql_command == SQLCOM_SHOW_FIELDS) { if (thd->is_error()) { @@ -8718,7 +8723,8 @@ int ha_spider::info( { if ((error_num = check_crd())) { - if (wide_handler->sql_command == SQLCOM_SHOW_CREATE) + if (wide_handler->sql_command == SQLCOM_SHOW_CREATE || + wide_handler->sql_command == SQLCOM_SHOW_FIELDS) { if (thd->is_error()) { diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_26583.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_26583.result new file mode 100644 index 00000000000..0ce268af7e3 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_26583.result @@ -0,0 +1,34 @@ +# +# MDEV-26583 SIGSEGV's in spider_get_select_limit_from_select_lex when DELAYED INSERT is used +# +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection child2_1; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +CREATE TABLE tbl_a ( +a INT AUTO_INCREMENT KEY, +b INT,INDEX i (b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +CREATE TABLE tbl_a ( +a INT AUTO_INCREMENT KEY, +b INT,INDEX i (b) +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='srv "s_2_1", table "tbl_a"'; +INSERT DELAYED INTO tbl_a VALUES (0,0),(0,0),(0,0); +connection master_1; +DROP DATABASE auto_test_local; +connection child2_1; +DROP DATABASE auto_test_remote; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_26583.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_26583.cnf new file mode 100644 index 00000000000..05dfd8a0bce --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_26583.cnf @@ -0,0 +1,3 @@ +!include include/default_mysqld.cnf +!include ../my_1_1.cnf +!include ../my_2_1.cnf diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_26583.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_26583.test new file mode 100644 index 00000000000..e4a2d64ba6d --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_26583.test @@ -0,0 +1,44 @@ +--echo # +--echo # MDEV-26583 SIGSEGV's in spider_get_select_limit_from_select_lex when DELAYED INSERT is used +--echo # + +--disable_query_log +--disable_result_log +--source ../../t/test_init.inc +--enable_result_log +--enable_query_log + +--connection child2_1 +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +eval CREATE TABLE tbl_a ( + a INT AUTO_INCREMENT KEY, + b INT,INDEX i (b) +) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; + +--connection master_1 +CREATE DATABASE auto_test_local; +USE auto_test_local; + +eval CREATE TABLE tbl_a ( + a INT AUTO_INCREMENT KEY, + b INT,INDEX i (b) +) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='srv "s_2_1", table "tbl_a"'; + +INSERT DELAYED INTO tbl_a VALUES (0,0),(0,0),(0,0); + +let $wait_condition=select count(*)=3 from tbl_a +source include/wait_condition.inc; + +--connection master_1 +DROP DATABASE auto_test_local; + +--connection child2_1 +DROP DATABASE auto_test_remote; + +--disable_query_log +--disable_result_log +--source ../../t/test_deinit.inc +--enable_result_log +--enable_query_log diff --git a/storage/spider/mysql-test/spider/r/ha_part.result b/storage/spider/mysql-test/spider/r/ha_part.result index 315f37298bc..d70d62404c0 100644 --- a/storage/spider/mysql-test/spider/r/ha_part.result +++ b/storage/spider/mysql-test/spider/r/ha_part.result @@ -248,6 +248,15 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 8 g 2011-05-05 21:33:30 9 h 2011-05-05 22:32:10 DROP TABLE ta_l2; +connection master_1; +CREATE TABLE t (c INT) PARTITION BY LIST COLUMNS (c) (PARTITION p DEFAULT ENGINE=SPIDER); +SHOW FIELDS FROM t; +Field Type Null Key Default Extra +c int(11) YES NULL +SHOW FIELDS FROM t; +Field Type Null Key Default Extra +c int(11) YES NULL +DROP TABLE t; deinit connection master_1; diff --git a/storage/spider/mysql-test/spider/t/ha_part.test b/storage/spider/mysql-test/spider/t/ha_part.test index 33fe9850b68..21b5837c0d2 100644 --- a/storage/spider/mysql-test/spider/t/ha_part.test +++ b/storage/spider/mysql-test/spider/t/ha_part.test @@ -982,6 +982,13 @@ if ($HAVE_PARTITION) } } +--connection master_1 + +CREATE TABLE t (c INT) PARTITION BY LIST COLUMNS (c) (PARTITION p DEFAULT ENGINE=SPIDER); +SHOW FIELDS FROM t; +SHOW FIELDS FROM t; +DROP TABLE t; + --echo --echo deinit --disable_warnings diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index 1e1b21aee34..2491a5ff7ed 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -54,7 +54,7 @@ const char charset_name_big5[]= "big5"; #define IS_MB1_CHAR(x) ((uchar) (x) < 0x80) #define IS_MB2_CHAR(x,y) (isbig5head(x) && isbig5tail(y)) #define DEFINE_ASIAN_ROUTINES -#include "ctype-mb.ic" +#include "ctype-mb.inl" static const uchar ctype_big5[257] = @@ -6685,14 +6685,14 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)), #define WEIGHT_MB2(x,y) (big5code(x, y)) #define WEIGHT_MB2_FRM(x,y) (big5strokexfrm((uint16) WEIGHT_MB2(x, y))) #define DEFINE_STRNXFRM -#include "strcoll.ic" +#include "strcoll.inl" #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" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD @@ -6701,7 +6701,7 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)), #define WEIGHT_MB2(x,y) (big5code(x, y)) #define WEIGHT_MB2_FRM(x,y) (big5strokexfrm((uint16) WEIGHT_MB2(x, y))) #define DEFINE_STRNXFRM -#include "strcoll.ic" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD @@ -6709,7 +6709,7 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)), #define WEIGHT_MB1(x) ((uchar) (x)) #define WEIGHT_MB2(x,y) (big5code(x, y)) #define STRCOLL_MB7_BIN -#include "strcoll.ic" +#include "strcoll.inl" static MY_COLLATION_HANDLER my_collation_handler_big5_chinese_ci= @@ -6717,6 +6717,7 @@ static MY_COLLATION_HANDLER my_collation_handler_big5_chinese_ci= NULL, /* init */ my_strnncoll_big5_chinese_ci, my_strnncollsp_big5_chinese_ci, + my_strnncollsp_nchars_big5_chinese_ci, my_strnxfrm_big5_chinese_ci, my_strnxfrmlen_simple, my_like_range_mb, @@ -6735,6 +6736,7 @@ static MY_COLLATION_HANDLER my_collation_handler_big5_bin= NULL, /* init */ my_strnncoll_big5_bin, my_strnncollsp_big5_bin, + my_strnncollsp_nchars_big5_bin, my_strnxfrm_mb, my_strnxfrmlen_simple, my_like_range_mb, @@ -6753,6 +6755,7 @@ static MY_COLLATION_HANDLER my_collation_handler_big5_chinese_nopad_ci= NULL, /* init */ my_strnncoll_big5_chinese_ci, my_strnncollsp_big5_chinese_nopad_ci, + my_strnncollsp_nchars_big5_chinese_nopad_ci, my_strnxfrm_big5_chinese_nopad_ci, my_strnxfrmlen_simple, my_like_range_mb, @@ -6771,6 +6774,7 @@ static MY_COLLATION_HANDLER my_collation_handler_big5_nopad_bin= NULL, /* init */ my_strnncoll_big5_bin, my_strnncollsp_big5_nopad_bin, + my_strnncollsp_nchars_big5_nopad_bin, my_strnxfrm_mb_nopad, my_strnxfrmlen_simple, my_like_range_mb, diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index b142cab523a..bb746ad90b0 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -129,6 +129,17 @@ static int my_strnncollsp_binary(CHARSET_INFO * cs __attribute__((unused)), } +static int my_strnncollsp_nchars_binary(CHARSET_INFO * cs __attribute__((unused)), + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + size_t nchars) +{ + set_if_smaller(slen, nchars); + set_if_smaller(tlen, nchars); + return my_strnncoll_binary(cs, s, slen, t, tlen, 0); +} + + static int my_strnncoll_8bit_bin(CHARSET_INFO * cs __attribute__((unused)), const uchar *s, size_t slen, const uchar *t, size_t tlen, @@ -203,6 +214,17 @@ static int my_strnncollsp_8bit_bin(CHARSET_INFO * cs __attribute__((unused)), } +static int my_strnncollsp_nchars_8bit_bin(CHARSET_INFO * cs, + const uchar *a, size_t a_length, + const uchar *b, size_t b_length, + size_t nchars) +{ + set_if_smaller(a_length, nchars); + set_if_smaller(b_length, nchars); + return my_strnncollsp_8bit_bin(cs, a, a_length, b, b_length); +} + + static int my_strnncollsp_8bit_nopad_bin(CHARSET_INFO * cs __attribute__((unused)), const uchar *a, size_t a_length, @@ -491,6 +513,7 @@ MY_COLLATION_HANDLER my_collation_8bit_bin_handler = my_coll_init_8bit_bin, my_strnncoll_8bit_bin, my_strnncollsp_8bit_bin, + my_strnncollsp_nchars_8bit_bin, my_strnxfrm_8bit_bin, my_strnxfrmlen_simple, my_like_range_simple, @@ -509,6 +532,7 @@ MY_COLLATION_HANDLER my_collation_8bit_nopad_bin_handler = my_coll_init_8bit_bin, my_strnncoll_8bit_bin, my_strnncollsp_8bit_nopad_bin, + my_strnncollsp_nchars_8bit_bin, my_strnxfrm_8bit_nopad_bin, my_strnxfrmlen_simple, my_like_range_simple, @@ -527,6 +551,7 @@ static MY_COLLATION_HANDLER my_collation_binary_handler = NULL, /* init */ my_strnncoll_binary, my_strnncollsp_binary, + my_strnncollsp_nchars_binary, my_strnxfrm_8bit_bin, my_strnxfrmlen_simple, my_like_range_simple, diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c index 847d3559a39..af3de05509d 100644 --- a/strings/ctype-cp932.c +++ b/strings/ctype-cp932.c @@ -191,7 +191,7 @@ static const uchar sort_order_cp932[]= #define IS_MB1_CHAR(x) ((uchar) (x) < 0x80 || iscp932kata(x)) #define IS_MB2_CHAR(x,y) (iscp932head(x) && iscp932tail(y)) #define DEFINE_ASIAN_ROUTINES -#include "ctype-mb.ic" +#include "ctype-mb.inl" #define cp932code(c,d) ((((uint) (uchar)(c)) << 8) | (uint) (uchar) (d)) @@ -34640,7 +34640,7 @@ size_t my_numcells_cp932(CHARSET_INFO *cs __attribute__((unused)), #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" +#include "strcoll.inl" #define MY_FUNCTION_NAME(x) my_ ## x ## _cp932_bin @@ -34648,7 +34648,7 @@ size_t my_numcells_cp932(CHARSET_INFO *cs __attribute__((unused)), #define WEIGHT_MB1(x) (256 * (int) (uchar) (x)) #define WEIGHT_MB2(x,y) (cp932code(x, y)) #define STRCOLL_MB7_BIN -#include "strcoll.ic" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD @@ -34657,7 +34657,7 @@ size_t my_numcells_cp932(CHARSET_INFO *cs __attribute__((unused)), #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" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD @@ -34666,7 +34666,7 @@ size_t my_numcells_cp932(CHARSET_INFO *cs __attribute__((unused)), #define WEIGHT_MB1(x) (256 * (int) (uchar) (x)) #define WEIGHT_MB2(x,y) (cp932code(x, y)) #define STRCOLL_MB7_BIN -#include "strcoll.ic" +#include "strcoll.inl" static MY_COLLATION_HANDLER my_collation_handler_cp932_japanese_ci= @@ -34674,6 +34674,7 @@ static MY_COLLATION_HANDLER my_collation_handler_cp932_japanese_ci= NULL, /* init */ my_strnncoll_cp932_japanese_ci, my_strnncollsp_cp932_japanese_ci, + my_strnncollsp_nchars_cp932_japanese_ci, my_strnxfrm_mb, my_strnxfrmlen_simple, my_like_range_mb, @@ -34692,6 +34693,7 @@ static MY_COLLATION_HANDLER my_collation_handler_cp932_bin= NULL, /* init */ my_strnncoll_cp932_bin, my_strnncollsp_cp932_bin, + my_strnncollsp_nchars_cp932_bin, my_strnxfrm_mb, my_strnxfrmlen_simple, my_like_range_mb, @@ -34710,6 +34712,7 @@ static MY_COLLATION_HANDLER my_collation_handler_cp932_japanese_nopad_ci= NULL, /* init */ my_strnncoll_cp932_japanese_ci, my_strnncollsp_cp932_japanese_nopad_ci, + my_strnncollsp_nchars_cp932_japanese_nopad_ci, my_strnxfrm_mb_nopad, my_strnxfrmlen_simple, my_like_range_mb, @@ -34728,6 +34731,7 @@ static MY_COLLATION_HANDLER my_collation_handler_cp932_nopad_bin= NULL, /* init */ my_strnncoll_cp932_bin, my_strnncollsp_cp932_nopad_bin, + my_strnncollsp_nchars_cp932_nopad_bin, my_strnxfrm_mb_nopad, my_strnxfrmlen_simple, my_like_range_mb, diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c index ca331dc667f..058e1e36b3a 100644 --- a/strings/ctype-czech.c +++ b/strings/ctype-czech.c @@ -611,6 +611,7 @@ static MY_COLLATION_HANDLER my_collation_latin2_czech_cs_handler = NULL, /* init */ my_strnncoll_czech, my_strnncollsp_czech, + my_strnncollsp_nchars_generic_8bit, my_strnxfrm_czech, my_strnxfrmlen_czech, my_like_range_czech, diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c index 4d2b9090053..1f62ebaf636 100644 --- a/strings/ctype-euc_kr.c +++ b/strings/ctype-euc_kr.c @@ -210,7 +210,7 @@ static const uchar sort_order_euc_kr[]= #define IS_MB1_CHAR(x) ((uchar) (x) < 0x80) #define IS_MB2_CHAR(x,y) (iseuc_kr_head(x) && iseuc_kr_tail(y)) #define DEFINE_ASIAN_ROUTINES -#include "ctype-mb.ic" +#include "ctype-mb.inl" static MY_UNICASE_CHARACTER cA3[256]= @@ -9933,14 +9933,14 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)), #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" +#include "strcoll.inl" #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" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD @@ -9948,7 +9948,7 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)), #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" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD @@ -9956,7 +9956,7 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)), #define WEIGHT_MB1(x) ((uchar) (x)) #define WEIGHT_MB2(x,y) (euckrcode(x, y)) #define STRCOLL_MB7_BIN -#include "strcoll.ic" +#include "strcoll.inl" static MY_COLLATION_HANDLER my_collation_handler_euckr_korean_ci= @@ -9964,6 +9964,7 @@ static MY_COLLATION_HANDLER my_collation_handler_euckr_korean_ci= NULL, /* init */ my_strnncoll_euckr_korean_ci, my_strnncollsp_euckr_korean_ci, + my_strnncollsp_nchars_euckr_korean_ci, my_strnxfrm_mb, my_strnxfrmlen_simple, my_like_range_mb, @@ -9982,6 +9983,7 @@ static MY_COLLATION_HANDLER my_collation_handler_euckr_bin= NULL, /* init */ my_strnncoll_euckr_bin, my_strnncollsp_euckr_bin, + my_strnncollsp_nchars_euckr_bin, my_strnxfrm_mb, my_strnxfrmlen_simple, my_like_range_mb, @@ -10000,6 +10002,7 @@ static MY_COLLATION_HANDLER my_collation_handler_euckr_korean_nopad_ci= NULL, /* init */ my_strnncoll_euckr_korean_ci, my_strnncollsp_euckr_korean_nopad_ci, + my_strnncollsp_nchars_euckr_korean_nopad_ci, my_strnxfrm_mb_nopad, my_strnxfrmlen_simple, my_like_range_mb, @@ -10018,6 +10021,7 @@ static MY_COLLATION_HANDLER my_collation_handler_euckr_nopad_bin= NULL, /* init */ my_strnncoll_euckr_bin, my_strnncollsp_euckr_nopad_bin, + my_strnncollsp_nchars_euckr_nopad_bin, my_strnxfrm_mb_nopad, my_strnxfrmlen_simple, my_like_range_mb, diff --git a/strings/ctype-eucjpms.c b/strings/ctype-eucjpms.c index 9c2b23ea918..ed48917e333 100644 --- a/strings/ctype-eucjpms.c +++ b/strings/ctype-eucjpms.c @@ -204,7 +204,7 @@ static const uchar sort_order_eucjpms[]= #define IS_MB3_CHAR(x,y,z) (iseucjpms_ss3(x) && IS_MB2_JIS(y,z)) #define IS_MB_PREFIX2(x,y) (iseucjpms_ss3(x) && iseucjpms(y)) #define DEFINE_ASIAN_ROUTINES -#include "ctype-mb.ic" +#include "ctype-mb.inl" #define MY_FUNCTION_NAME(x) my_ ## x ## _eucjpms_japanese_ci #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) @@ -213,7 +213,7 @@ static const uchar sort_order_eucjpms[]= (((uint) (uchar) (y)) << 8)) #define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z)) #define STRCOLL_MB7_TOUPPER -#include "strcoll.ic" +#include "strcoll.inl" #define MY_FUNCTION_NAME(x) my_ ## x ## _eucjpms_bin @@ -223,7 +223,7 @@ static const uchar sort_order_eucjpms[]= (((uint) (uchar) (y)) << 8)) #define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z)) #define STRCOLL_MB7_BIN -#include "strcoll.ic" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD @@ -234,7 +234,7 @@ static const uchar sort_order_eucjpms[]= (((uint) (uchar) (y)) << 8)) #define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z)) #define STRCOLL_MB7_TOUPPER -#include "strcoll.ic" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD @@ -245,7 +245,7 @@ static const uchar sort_order_eucjpms[]= (((uint) (uchar) (y)) << 8)) #define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z)) #define STRCOLL_MB7_BIN -#include "strcoll.ic" +#include "strcoll.inl" /* Case info pages for JIS-X-0208 range */ @@ -67502,6 +67502,7 @@ static MY_COLLATION_HANDLER my_collation_eucjpms_japanese_ci_handler = NULL, /* init */ my_strnncoll_eucjpms_japanese_ci, my_strnncollsp_eucjpms_japanese_ci, + my_strnncollsp_nchars_eucjpms_japanese_ci, my_strnxfrm_mb, /* strnxfrm */ my_strnxfrmlen_simple, my_like_range_mb, /* like_range */ @@ -67520,6 +67521,7 @@ static MY_COLLATION_HANDLER my_collation_eucjpms_bin_handler = NULL, /* init */ my_strnncoll_eucjpms_bin, my_strnncollsp_eucjpms_bin, + my_strnncollsp_nchars_eucjpms_bin, my_strnxfrm_mb, my_strnxfrmlen_simple, my_like_range_mb, @@ -67538,6 +67540,7 @@ static MY_COLLATION_HANDLER my_collation_eucjpms_japanese_nopad_ci_handler = NULL, /* init */ my_strnncoll_eucjpms_japanese_ci, my_strnncollsp_eucjpms_japanese_nopad_ci, + my_strnncollsp_nchars_eucjpms_japanese_nopad_ci, my_strnxfrm_mb_nopad, /* strnxfrm */ my_strnxfrmlen_simple, my_like_range_mb, /* like_range */ @@ -67556,6 +67559,7 @@ static MY_COLLATION_HANDLER my_collation_eucjpms_nopad_bin_handler = NULL, /* init */ my_strnncoll_eucjpms_bin, my_strnncollsp_eucjpms_nopad_bin, + my_strnncollsp_nchars_eucjpms_nopad_bin, my_strnxfrm_mb_nopad, my_strnxfrmlen_simple, my_like_range_mb, diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c index 70ac2c9b958..dd3581366fe 100644 --- a/strings/ctype-gb2312.c +++ b/strings/ctype-gb2312.c @@ -174,7 +174,7 @@ static const uchar sort_order_gb2312[]= #define IS_MB1_CHAR(x) ((uchar) (x) < 0x80) #define IS_MB2_CHAR(x,y) (isgb2312head(x) && isgb2312tail(y)) #define DEFINE_ASIAN_ROUTINES -#include "ctype-mb.ic" +#include "ctype-mb.inl" static MY_UNICASE_CHARACTER cA2[256]= @@ -6338,21 +6338,21 @@ my_mb_wc_gb2312(CHARSET_INFO *cs __attribute__((unused)), #define MY_FUNCTION_NAME(x) my_ ## x ## _gb2312_chinese_ci #define WEIGHT_MB1(x) (sort_order_gb2312[(uchar) (x)]) #define WEIGHT_MB2(x,y) (gb2312code(x, y)) -#include "strcoll.ic" +#include "strcoll.inl" #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" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD #define MY_FUNCTION_NAME(x) my_ ## x ## _gb2312_chinese_nopad_ci #define WEIGHT_MB1(x) (sort_order_gb2312[(uchar) (x)]) #define WEIGHT_MB2(x,y) (gb2312code(x, y)) -#include "strcoll.ic" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD @@ -6360,7 +6360,7 @@ my_mb_wc_gb2312(CHARSET_INFO *cs __attribute__((unused)), #define WEIGHT_MB1(x) ((uchar) (x)) #define WEIGHT_MB2(x,y) (gb2312code(x, y)) #define STRCOLL_MB7_BIN -#include "strcoll.ic" +#include "strcoll.inl" static MY_COLLATION_HANDLER my_collation_handler_gb2312_chinese_ci= @@ -6368,6 +6368,7 @@ static MY_COLLATION_HANDLER my_collation_handler_gb2312_chinese_ci= NULL, /* init */ my_strnncoll_gb2312_chinese_ci, my_strnncollsp_gb2312_chinese_ci, + my_strnncollsp_nchars_gb2312_chinese_ci, my_strnxfrm_mb, /* strnxfrm */ my_strnxfrmlen_simple, my_like_range_mb, /* like_range */ @@ -6386,6 +6387,7 @@ static MY_COLLATION_HANDLER my_collation_handler_gb2312_bin= NULL, /* init */ my_strnncoll_gb2312_bin, my_strnncollsp_gb2312_bin, + my_strnncollsp_nchars_gb2312_bin, my_strnxfrm_mb, my_strnxfrmlen_simple, my_like_range_mb, @@ -6404,6 +6406,7 @@ static MY_COLLATION_HANDLER my_collation_handler_gb2312_chinese_nopad_ci= NULL, /* init */ my_strnncoll_gb2312_chinese_ci, my_strnncollsp_gb2312_chinese_nopad_ci, + my_strnncollsp_nchars_gb2312_chinese_nopad_ci, my_strnxfrm_mb_nopad, my_strnxfrmlen_simple, my_like_range_mb, @@ -6422,6 +6425,7 @@ static MY_COLLATION_HANDLER my_collation_handler_gb2312_nopad_bin= NULL, /* init */ my_strnncoll_gb2312_bin, my_strnncollsp_gb2312_nopad_bin, + my_strnncollsp_nchars_gb2312_nopad_bin, my_strnxfrm_mb_nopad, my_strnxfrmlen_simple, my_like_range_mb, diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c index ba5ba02bf5e..2e72d5bd7a4 100644 --- a/strings/ctype-gbk.c +++ b/strings/ctype-gbk.c @@ -50,7 +50,7 @@ const char charset_name_gbk[]= "gbk"; #define IS_MB1_CHAR(x) ((uchar) (x) < 0x80) #define IS_MB2_CHAR(x,y) (isgbkhead(x) && isgbktail(y)) #define DEFINE_ASIAN_ROUTINES -#include "ctype-mb.ic" +#include "ctype-mb.inl" static const uchar ctype_gbk[257] = @@ -10619,14 +10619,14 @@ my_mb_wc_gbk(CHARSET_INFO *cs __attribute__((unused)), #define WEIGHT_MB1(x) (sort_order_gbk[(uchar) (x)]) #define WEIGHT_MB2(x,y) (gbksortorder(gbkcode(x,y))) #define DEFINE_STRNXFRM -#include "strcoll.ic" +#include "strcoll.inl" #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" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD @@ -10634,7 +10634,7 @@ my_mb_wc_gbk(CHARSET_INFO *cs __attribute__((unused)), #define WEIGHT_MB1(x) (sort_order_gbk[(uchar) (x)]) #define WEIGHT_MB2(x,y) (gbksortorder(gbkcode(x,y))) #define DEFINE_STRNXFRM -#include "strcoll.ic" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD @@ -10642,7 +10642,7 @@ my_mb_wc_gbk(CHARSET_INFO *cs __attribute__((unused)), #define WEIGHT_MB1(x) ((uchar) (x)) #define WEIGHT_MB2(x,y) (gbkcode(x,y)) #define STRCOLL_MB7_BIN -#include "strcoll.ic" +#include "strcoll.inl" static MY_COLLATION_HANDLER my_collation_handler_gbk_chinese_ci= @@ -10650,6 +10650,7 @@ static MY_COLLATION_HANDLER my_collation_handler_gbk_chinese_ci= NULL, /* init */ my_strnncoll_gbk_chinese_ci, my_strnncollsp_gbk_chinese_ci, + my_strnncollsp_nchars_gbk_chinese_ci, my_strnxfrm_gbk_chinese_ci, my_strnxfrmlen_simple, my_like_range_mb, @@ -10668,6 +10669,7 @@ static MY_COLLATION_HANDLER my_collation_handler_gbk_bin= NULL, /* init */ my_strnncoll_gbk_bin, my_strnncollsp_gbk_bin, + my_strnncollsp_nchars_gbk_bin, my_strnxfrm_mb, my_strnxfrmlen_simple, my_like_range_mb, @@ -10686,6 +10688,7 @@ static MY_COLLATION_HANDLER my_collation_handler_gbk_chinese_nopad_ci= NULL, /* init */ my_strnncoll_gbk_chinese_ci, my_strnncollsp_gbk_chinese_nopad_ci, + my_strnncollsp_nchars_gbk_chinese_nopad_ci, my_strnxfrm_gbk_chinese_nopad_ci, my_strnxfrmlen_simple, my_like_range_mb, @@ -10704,6 +10707,7 @@ static MY_COLLATION_HANDLER my_collation_handler_gbk_nopad_bin= NULL, /* init */ my_strnncoll_gbk_bin, my_strnncollsp_gbk_nopad_bin, + my_strnncollsp_nchars_gbk_nopad_bin, my_strnxfrm_mb_nopad, my_strnxfrmlen_simple, my_like_range_mb, diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c index 9412f212420..00c48d8821e 100644 --- a/strings/ctype-latin1.c +++ b/strings/ctype-latin1.c @@ -731,6 +731,7 @@ static MY_COLLATION_HANDLER my_collation_german2_ci_handler= NULL, /* init */ my_strnncoll_latin1_de, my_strnncollsp_latin1_de, + my_strnncollsp_nchars_generic_8bit, my_strnxfrm_latin1_de, my_strnxfrmlen_simple, my_like_range_simple, diff --git a/strings/ctype-mb.ic b/strings/ctype-mb.inl index 6cde31a34ad..6cde31a34ad 100644 --- a/strings/ctype-mb.ic +++ b/strings/ctype-mb.inl diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index a0ba4357d5e..b579f0af203 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -209,6 +209,18 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, size_t a_length, } +static int +my_strnncollsp_nchars_simple(CHARSET_INFO * cs, + const uchar *a, size_t a_length, + const uchar *b, size_t b_length, + size_t nchars) +{ + set_if_smaller(a_length, nchars); + set_if_smaller(b_length, nchars); + return my_strnncollsp_simple(cs, a, a_length, b, b_length); +} + + int my_strnncollsp_simple_nopad(CHARSET_INFO * cs, const uchar *a, size_t a_length, const uchar *b, size_t b_length) @@ -2127,6 +2139,7 @@ MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler = my_coll_init_simple, /* init */ my_strnncoll_simple, my_strnncollsp_simple, + my_strnncollsp_nchars_simple, my_strnxfrm_simple, my_strnxfrmlen_simple, my_like_range_simple, @@ -2145,6 +2158,7 @@ MY_COLLATION_HANDLER my_collation_8bit_simple_nopad_ci_handler = my_coll_init_simple, /* init */ my_strnncoll_simple, my_strnncollsp_simple_nopad, + my_strnncollsp_nchars_simple, my_strnxfrm_simple_nopad, my_strnxfrmlen_simple, my_like_range_simple, diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index abae90008ea..c3e64ce0d11 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -192,7 +192,7 @@ static const uchar sort_order_sjis[]= #define IS_MB1_CHAR(x) ((uchar) (x) < 0x80 || issjiskata(x)) #define IS_MB2_CHAR(x,y) (issjishead(x) && issjistail(y)) #define DEFINE_ASIAN_ROUTINES -#include "ctype-mb.ic" +#include "ctype-mb.inl" #define sjiscode(c,d) ((((uint) (uchar)(c)) << 8) | (uint) (uchar) (d)) @@ -34028,7 +34028,7 @@ my_wc_to_printable_sjis(CHARSET_INFO *cs, my_wc_t wc, #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" +#include "strcoll.inl" #define MY_FUNCTION_NAME(x) my_ ## x ## _sjis_bin @@ -34036,7 +34036,7 @@ my_wc_to_printable_sjis(CHARSET_INFO *cs, my_wc_t wc, #define WEIGHT_MB1(x) (256 * (int) (uchar) (x)) #define WEIGHT_MB2(x,y) (sjiscode(x, y)) #define STRCOLL_MB7_BIN -#include "strcoll.ic" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD @@ -34045,7 +34045,7 @@ my_wc_to_printable_sjis(CHARSET_INFO *cs, my_wc_t wc, #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" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD @@ -34054,7 +34054,7 @@ my_wc_to_printable_sjis(CHARSET_INFO *cs, my_wc_t wc, #define WEIGHT_MB1(x) (256 * (int) (uchar) (x)) #define WEIGHT_MB2(x,y) (sjiscode(x, y)) #define STRCOLL_MB7_BIN -#include "strcoll.ic" +#include "strcoll.inl" static MY_COLLATION_HANDLER my_collation_handler_sjis_japanese_ci= @@ -34062,6 +34062,7 @@ static MY_COLLATION_HANDLER my_collation_handler_sjis_japanese_ci= NULL, /* init */ my_strnncoll_sjis_japanese_ci, my_strnncollsp_sjis_japanese_ci, + my_strnncollsp_nchars_sjis_japanese_ci, my_strnxfrm_mb, my_strnxfrmlen_simple, my_like_range_mb, @@ -34080,6 +34081,7 @@ static MY_COLLATION_HANDLER my_collation_handler_sjis_bin= NULL, /* init */ my_strnncoll_sjis_bin, my_strnncollsp_sjis_bin, + my_strnncollsp_nchars_sjis_bin, my_strnxfrm_mb, my_strnxfrmlen_simple, my_like_range_mb, @@ -34098,6 +34100,7 @@ static MY_COLLATION_HANDLER my_collation_handler_sjis_japanese_nopad_ci= NULL, /* init */ my_strnncoll_sjis_japanese_ci, my_strnncollsp_sjis_japanese_nopad_ci, + my_strnncollsp_nchars_sjis_japanese_nopad_ci, my_strnxfrm_mb_nopad, my_strnxfrmlen_simple, my_like_range_mb, @@ -34116,6 +34119,7 @@ static MY_COLLATION_HANDLER my_collation_handler_sjis_nopad_bin= NULL, /* init */ my_strnncoll_sjis_bin, my_strnncollsp_sjis_nopad_bin, + my_strnncollsp_nchars_sjis_nopad_bin, my_strnxfrm_mb_nopad, my_strnxfrmlen_simple, my_like_range_mb, diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index 389f6d910fa..ce5e56ba542 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -856,6 +856,7 @@ static MY_COLLATION_HANDLER my_collation_ci_handler = NULL, /* init */ my_strnncoll_tis620, my_strnncollsp_tis620, + my_strnncollsp_nchars_generic_8bit, my_strnxfrm_tis620, my_strnxfrmlen_simple, my_like_range_simple, @@ -873,6 +874,7 @@ static MY_COLLATION_HANDLER my_collation_nopad_ci_handler = NULL, /* init */ my_strnncoll_tis620, my_strnncollsp_tis620_nopad, + my_strnncollsp_nchars_generic_8bit, my_strnxfrm_tis620_nopad, my_strnxfrmlen_simple, my_like_range_simple, diff --git a/strings/ctype-uca-scanner_next.inl b/strings/ctype-uca-scanner_next.inl new file mode 100644 index 00000000000..79d25487b42 --- /dev/null +++ b/strings/ctype-uca-scanner_next.inl @@ -0,0 +1,179 @@ +/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. + Copyright (c) 2009, 2021, MariaDB + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; version 2 + of the License. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1335 USA */ + + +#ifdef SCANNER_NEXT_NCHARS + +#define SCANNER_NEXT_RETURN(_w,_n) \ + do { weight_and_nchars_t rc= {_w, _n}; return rc; } while(0) + +#define SCANNER_NEXT_RETURN_CONTRACTION(_cnt,_ignorable_nchars) \ + do { \ + weight_and_nchars_t rc= { _cnt->weight[0], \ + _ignorable_nchars + \ + my_contraction_char_length(_cnt) }; \ + return rc; \ + } while(0) + +#else + +#define SCANNER_NEXT_RETURN(_w,_n) do { return _w; } while (0) + +#define SCANNER_NEXT_RETURN_CONTRACTION(_cnt,_ignorable_nchars) \ + do { return _cnt->weight[0]; } while(0) + +#endif + +static inline +#ifdef SCANNER_NEXT_NCHARS +weight_and_nchars_t +MY_FUNCTION_NAME(scanner_next_with_nchars)(my_uca_scanner *scanner, + size_t nchars) +#else +int +MY_FUNCTION_NAME(scanner_next)(my_uca_scanner *scanner) +#endif +{ +#ifdef SCANNER_NEXT_NCHARS + uint ignorable_nchars; +#define LOCAL_MAX_CONTRACTION_LENGTH nchars +#else +#define LOCAL_MAX_CONTRACTION_LENGTH MY_UCA_MAX_CONTRACTION +#endif + /* + Check if the weights for the previous character have been + already fully scanned. If yes, then get the next character and + initialize wbeg and wlength to its weight string. + */ + + if (scanner->wbeg[0]) + { + /* + More weights left from the previous step. + Return the next weight from the current expansion. + Return "0" as "nchars". The real nchars was set on a previous + iteration. + */ + SCANNER_NEXT_RETURN(*scanner->wbeg++, 0); + } + +#ifdef SCANNER_NEXT_NCHARS + for (ignorable_nchars= 0 ; ; ignorable_nchars++) +#else + for ( ; ; ) +#endif + { + const uint16 *wpage; + my_wc_t wc[MY_UCA_MAX_CONTRACTION]; + int mblen; + + /* Get next character */ +#if MY_UCA_ASCII_OPTIMIZE + /* Get next ASCII character */ + if (scanner->sbeg < scanner->send && scanner->sbeg[0] < 0x80) + { + wc[0]= scanner->sbeg[0]; + scanner->sbeg+= 1; + +#if MY_UCA_COMPILE_CONTRACTIONS + if (my_uca_needs_context_handling(scanner->level, wc[0])) + { + const MY_CONTRACTION *cnt= my_uca_context_weight_find(scanner, wc, + LOCAL_MAX_CONTRACTION_LENGTH); + if (cnt) + SCANNER_NEXT_RETURN_CONTRACTION(cnt, ignorable_nchars); + } +#endif + + scanner->page= 0; + scanner->code= (int) wc[0]; + scanner->wbeg= scanner->level->weights[0] + scanner->code * scanner->level->lengths[0]; + if (scanner->wbeg[0]) + SCANNER_NEXT_RETURN(*scanner->wbeg++, ignorable_nchars + 1); + continue; + } + else +#endif + /* Get next MB character */ + if (((mblen= MY_MB_WC(scanner, wc, scanner->sbeg, + scanner->send)) <= 0)) + { + if (scanner->sbeg >= scanner->send) + { + /* No more bytes, end of line reached */ + SCANNER_NEXT_RETURN(-1, ignorable_nchars); + } + /* + There are some more bytes left. Non-positive mb_len means that + we got an incomplete or a bad byte sequence. Consume mbminlen bytes. + */ + if ((scanner->sbeg+= scanner->cs->mbminlen) > scanner->send) + { + /* For safety purposes don't go beyond the string range. */ + scanner->sbeg= scanner->send; + } + /* + Treat every complete or incomplete mbminlen unit as a weight which is + greater than weight for any possible normal character. + 0xFFFF is greater than any possible weight in the UCA weight table. + */ + SCANNER_NEXT_RETURN(0xFFFF, ignorable_nchars + 1); + } + + scanner->sbeg+= mblen; + if (wc[0] > scanner->level->maxchar) + { + /* Return 0xFFFD as weight for all characters outside BMP */ + scanner->wbeg= nochar; + SCANNER_NEXT_RETURN(0xFFFD, ignorable_nchars + 1); + } + +#if MY_UCA_COMPILE_CONTRACTIONS + if (my_uca_needs_context_handling(scanner->level, wc[0])) + { + const MY_CONTRACTION *cnt= my_uca_context_weight_find(scanner, wc, + LOCAL_MAX_CONTRACTION_LENGTH); + if (cnt) + SCANNER_NEXT_RETURN_CONTRACTION(cnt, ignorable_nchars); + } +#endif + + /* Process single character */ + scanner->page= wc[0] >> 8; + scanner->code= wc[0] & 0xFF; + + /* If weight page for w[0] does not exist, then calculate algoritmically */ + if (!(wpage= scanner->level->weights[scanner->page])) + SCANNER_NEXT_RETURN(my_uca_scanner_next_implicit(scanner), + ignorable_nchars + 1); + + /* Calculate pointer to w[0]'s weight, using page and offset */ + scanner->wbeg= wpage + + scanner->code * scanner->level->lengths[scanner->page]; + if (scanner->wbeg[0]) + break; + /* Skip ignorable character and continue the loop */ + } + + SCANNER_NEXT_RETURN(*scanner->wbeg++, ignorable_nchars + 1); +} + +#undef SCANNER_NEXT_NCHARS +#undef SCANNER_NEXT_RETURN +#undef SCANNER_NEXT_RETURN_CONTRACTION +#undef LOCAL_MAX_CONTRACTION_LENGTH diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 2bcc16bb734..863a29eae4e 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -35,6 +35,12 @@ #include "strings_def.h" #include <m_ctype.h> +typedef struct +{ + int weight; + uint nchars; +} weight_and_nchars_t; + #define MY_CS_COMMON_UCA_FLAGS (MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NON1TO1) #define MY_UCA_CNT_FLAG_SIZE 4096 @@ -31450,6 +31456,21 @@ my_wmemcmp(my_wc_t *a, my_wc_t *b, size_t len) } +/* + Return the number of characters in a contraction. +*/ +static inline uint my_contraction_char_length(const MY_CONTRACTION *cnt) +{ + uint i; + for (i= 2; i < array_elements(cnt->ch); i++) + { + if (cnt->ch[i] == 0) + return i; + } + return array_elements(cnt->ch); +} + + /** Check if a string is a contraction, and return its weight array on success. @@ -31460,11 +31481,11 @@ my_wmemcmp(my_wc_t *a, my_wc_t *b, size_t len) @return Weight array @retval NULL - Input string is not a known contraction - @retval ptr - contraction weight array + @retval ptr - the address of the MY_CONTRACTION found */ -static inline uint16 * -my_uca_contraction_weight(const MY_CONTRACTIONS *list, my_wc_t *wc, size_t len) +static inline const MY_CONTRACTION * +my_uca_contraction_find(const MY_CONTRACTIONS *list, my_wc_t *wc, size_t len) { MY_CONTRACTION *c, *last; DBUG_ASSERT(len <= MY_UCA_MAX_CONTRACTION); @@ -31474,7 +31495,7 @@ my_uca_contraction_weight(const MY_CONTRACTIONS *list, my_wc_t *wc, size_t len) if ((len >= MY_UCA_MAX_CONTRACTION || c->ch[len] == 0) && !c->with_context && !my_wmemcmp(c->ch, wc, len)) - return c->weight; + return c; } return NULL; } @@ -31487,16 +31508,18 @@ my_uca_contraction_weight(const MY_CONTRACTIONS *list, my_wc_t *wc, size_t len) a contraction part. Then try to find real contraction among the candidates, starting from the longest. - @param scanner Pointer to UCA scanner - @param[OUT] *wc Where to store the scanned string + @param scanner Pointer to UCA scanner + @param[OUT] *wc Where to store the scanned string + @param max_char_length The longest contraction character length allowed @return Weight array @retval NULL - no contraction found - @retval ptr - contraction weight array + @retval ptr - the address of MY_CONTRACTION found */ -static uint16 * -my_uca_scanner_contraction_find(my_uca_scanner *scanner, my_wc_t *wc) +static const MY_CONTRACTION * +my_uca_scanner_contraction_find(my_uca_scanner *scanner, my_wc_t *wc, + size_t max_char_length) { size_t clen= 1; int flag; @@ -31505,7 +31528,7 @@ my_uca_scanner_contraction_find(my_uca_scanner *scanner, my_wc_t *wc) /* Scan all contraction candidates */ for (s= scanner->sbeg, flag= MY_UCA_CNT_MID1; - clen < MY_UCA_MAX_CONTRACTION; + clen < max_char_length; flag<<= 1) { int mblen; @@ -31520,15 +31543,15 @@ my_uca_scanner_contraction_find(my_uca_scanner *scanner, my_wc_t *wc) /* Find among candidates the longest real contraction */ for ( ; clen > 1; clen--) { - uint16 *cweight; + const MY_CONTRACTION *cnt; if (my_uca_can_be_contraction_tail(&scanner->level->contractions, wc[clen - 1]) && - (cweight= my_uca_contraction_weight(&scanner->level->contractions, - wc, clen))) + (cnt= my_uca_contraction_find(&scanner->level->contractions, + wc, clen))) { - scanner->wbeg= cweight + 1; + scanner->wbeg= cnt->weight + 1; scanner->sbeg= beg[clen - 1]; - return cweight; + return cnt; } } @@ -31546,10 +31569,10 @@ my_uca_scanner_contraction_find(my_uca_scanner *scanner, my_wc_t *wc) @return Weight array @retval NULL - no contraction with context found - @retval ptr - contraction weight array + @retval ptr - the address of MY_CONTRACTION found */ -static uint16 * +static const MY_CONTRACTION * my_uca_previous_context_find(my_uca_scanner *scanner, my_wc_t wc0, my_wc_t wc1) { @@ -31560,7 +31583,7 @@ my_uca_previous_context_find(my_uca_scanner *scanner, if (c->with_context && wc0 == c->ch[0] && wc1 == c->ch[1]) { scanner->wbeg= c->weight + 1; - return c->weight; + return c; } } return NULL; @@ -31581,13 +31604,16 @@ my_uca_previous_context_find(my_uca_scanner *scanner, If wc[0] and the previous character make a previous context pair, then wc[1] is set to the previous character. + @param max_char_length - the longest contraction character length allowed. + @retval NULL if could not find any contextual weights for wc[0] - @retval non null pointer to a zero-terminated weight string otherwise + @retval non null pointer - the address of MY_CONTRACTION found */ -static inline uint16 * -my_uca_context_weight_find(my_uca_scanner *scanner, my_wc_t *wc) +static inline const MY_CONTRACTION * +my_uca_context_weight_find(my_uca_scanner *scanner, my_wc_t *wc, + size_t max_char_length) { - uint16 *cweight; + const MY_CONTRACTION *cnt; DBUG_ASSERT(scanner->level->contractions.nitems); /* If we have scanned a character which can have previous context, @@ -31604,17 +31630,17 @@ my_uca_context_weight_find(my_uca_scanner *scanner, my_wc_t *wc) my_uca_can_be_previous_context_head(&scanner->level->contractions, (wc[1]= ((scanner->page << 8) + scanner->code))) && - (cweight= my_uca_previous_context_find(scanner, wc[1], wc[0]))) + (cnt= my_uca_previous_context_find(scanner, wc[1], wc[0]))) { scanner->page= scanner->code= 0; /* Clear for the next character */ - return cweight; + return cnt; } else if (my_uca_can_be_contraction_head(&scanner->level->contractions, wc[0])) { /* Check if w[0] starts a contraction */ - if ((cweight= my_uca_scanner_contraction_find(scanner, wc))) - return cweight; + if ((cnt= my_uca_scanner_contraction_find(scanner, wc, max_char_length))) + return cnt; } return NULL; } @@ -33212,9 +33238,11 @@ my_char_weight_put(MY_UCA_WEIGHT_LEVEL *dst, for (chlen= len; chlen > 1; chlen--) { + const MY_CONTRACTION *cnt; if (chlen <= MY_UCA_MAX_CONTRACTION && - (from= my_uca_contraction_weight(&dst->contractions, str, chlen))) + (cnt= my_uca_contraction_find(&dst->contractions, str, chlen))) { + from= cnt->weight; str+= chlen; len-= chlen; break; diff --git a/strings/ctype-uca.ic b/strings/ctype-uca.ic index cee12cf4d7b..1fc3480e5b5 100644 --- a/strings/ctype-uca.ic +++ b/strings/ctype-uca.ic @@ -36,108 +36,9 @@ #error MY_UCA_COLL_INIT is not defined #endif - -static inline int -MY_FUNCTION_NAME(scanner_next)(my_uca_scanner *scanner) -{ - /* - Check if the weights for the previous character have been - already fully scanned. If yes, then get the next character and - initialize wbeg and wlength to its weight string. - */ - - if (scanner->wbeg[0]) /* More weights left from the previous step: */ - return *scanner->wbeg++; /* return the next weight from expansion */ - - do - { - const uint16 *wpage; - my_wc_t wc[MY_UCA_MAX_CONTRACTION]; - int mblen; - - /* Get next character */ -#if MY_UCA_ASCII_OPTIMIZE - /* Get next ASCII character */ - if (scanner->sbeg < scanner->send && scanner->sbeg[0] < 0x80) - { - wc[0]= scanner->sbeg[0]; - scanner->sbeg+= 1; - -#if MY_UCA_COMPILE_CONTRACTIONS - if (my_uca_needs_context_handling(scanner->level, wc[0])) - { - uint16 *cweight= my_uca_context_weight_find(scanner, wc); - if (cweight) - return *cweight; - } -#endif - - scanner->page= 0; - scanner->code= (int) wc[0]; - scanner->wbeg= scanner->level->weights[0] + scanner->code * scanner->level->lengths[0]; - if (scanner->wbeg[0]) - return *scanner->wbeg++; - continue; - } - else -#endif - /* Get next MB character */ - if (((mblen= MY_MB_WC(scanner, wc, scanner->sbeg, - scanner->send)) <= 0)) - { - if (scanner->sbeg >= scanner->send) - return -1; /* No more bytes, end of line reached */ - /* - There are some more bytes left. Non-positive mb_len means that - we got an incomplete or a bad byte sequence. Consume mbminlen bytes. - */ - if ((scanner->sbeg+= scanner->cs->mbminlen) > scanner->send) - { - /* For safety purposes don't go beyond the string range. */ - scanner->sbeg= scanner->send; - } - /* - Treat every complete or incomplete mbminlen unit as a weight which is - greater than weight for any possible normal character. - 0xFFFF is greater than any possible weight in the UCA weight table. - */ - return 0xFFFF; - } - - scanner->sbeg+= mblen; - if (wc[0] > scanner->level->maxchar) - { - /* Return 0xFFFD as weight for all characters outside BMP */ - scanner->wbeg= nochar; - return 0xFFFD; - } - -#if MY_UCA_COMPILE_CONTRACTIONS - if (my_uca_needs_context_handling(scanner->level, wc[0])) - { - uint16 *cweight= my_uca_context_weight_find(scanner, wc); - if (cweight) - return *cweight; - } -#endif - - /* Process single character */ - scanner->page= wc[0] >> 8; - scanner->code= wc[0] & 0xFF; - - /* If weight page for w[0] does not exist, then calculate algoritmically */ - if (!(wpage= scanner->level->weights[scanner->page])) - return my_uca_scanner_next_implicit(scanner); - - /* Calculate pointer to w[0]'s weight, using page and offset */ - scanner->wbeg= wpage + - scanner->code * scanner->level->lengths[scanner->page]; - } while (!scanner->wbeg[0]); /* Skip ignorable characters */ - - return *scanner->wbeg++; -} - - +#include "ctype-uca-scanner_next.inl" +#define SCANNER_NEXT_NCHARS +#include "ctype-uca-scanner_next.inl" /* Compares two strings according to the collation @@ -410,6 +311,173 @@ MY_FUNCTION_NAME(strnncollsp_nopad_multilevel)(CHARSET_INFO *cs, } +/* + Scan the next weight and perform space padding + or trimming according to "nchars". +*/ +static inline weight_and_nchars_t +MY_FUNCTION_NAME(scanner_next_pad_trim)(my_uca_scanner *scanner, + size_t nchars, + uint *generated) +{ + weight_and_nchars_t res; + if (nchars > 0 || + scanner->wbeg[0] /* Some weights from a previous expansion left */) + { + if ((res= MY_FUNCTION_NAME(scanner_next_with_nchars)(scanner, + nchars)).weight < 0) + { + /* + We reached the end of the string, but the caller wants more weights. + Perform space padding. + */ + res.weight= my_space_weight(scanner->level); + res.nchars= 1; + (*generated)++; + } + else if (res.nchars > nchars) + { + /* + We scanned the next collation element, but it does not fit into + the "nchars" limit. This is possible in case of: + - A contraction, e.g. Czech 'ch' with nchars=1 + - A sequence of ignorable characters followed by non-ignorable ones, + e.g. CONCAT(x'00','a') with nchars=1. + Perform trimming. + */ + res.weight= scanner->cs->state & MY_CS_NOPAD ? + 0 : my_space_weight(scanner->level); + res.nchars= (uint) nchars; + (*generated)++; + } + } + else + { + /* The caller wants nchars==0. Perform trimming. */ + res.weight= scanner->cs->state & MY_CS_NOPAD ? + 0 : my_space_weight(scanner->level); + res.nchars= 0; + (*generated)++; + } + return res; +} + + +static int +MY_FUNCTION_NAME(strnncollsp_nchars_onelevel)(CHARSET_INFO *cs, + const MY_UCA_WEIGHT_LEVEL *level, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + size_t nchars) +{ + my_uca_scanner sscanner; + my_uca_scanner tscanner; + size_t s_nchars_left= nchars; + size_t t_nchars_left= nchars; + + my_uca_scanner_init_any(&sscanner, cs, level, s, slen); + my_uca_scanner_init_any(&tscanner, cs, level, t, tlen); + + for ( ; ; ) + { + weight_and_nchars_t s_res; + weight_and_nchars_t t_res; + uint generated= 0; + int diff; + + s_res= MY_FUNCTION_NAME(scanner_next_pad_trim)(&sscanner, s_nchars_left, + &generated); + t_res= MY_FUNCTION_NAME(scanner_next_pad_trim)(&tscanner, t_nchars_left, + &generated); + if ((diff= (s_res.weight - t_res.weight))) + return diff; + + if (generated == 2) + { + if (cs->state & MY_CS_NOPAD) + { + /* + Both values are auto-generated. There's no real data any more. + We need to handle the remaining virtual trailing spaces. + The two strings still have s_nchars_left and t_nchars_left imaginary + trailing spaces at the end. If s_nchars_left != t_nchars_left, + the strings will be not equal in case of a NOPAD collation. + + Example: + "B" is German "U+00DF LATIN SMALL LETTER SHARP S" + When we have these values in a + CHAR(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_nopad_ci + column: + 'B ' (one character, two trailing spaces) + 'ss ' (two characters, one trailing space) + The 'B ' is greater than the 'ss '. + They are compared in the following steps: + 1. 'B' == 'ss' + 2. ' ' == ' ' + 3. ' ' > '' + + We need to emulate the same behavior in this function even if + it's called with strings 'B' and 'ss' (with space trimmed). + The side which has more remaining virtual spaces at the end + is greater. + */ + if (s_nchars_left < t_nchars_left) + return -1; + if (s_nchars_left > t_nchars_left) + return +1; + } + return 0; + } + + DBUG_ASSERT(s_nchars_left >= s_res.nchars); + DBUG_ASSERT(t_nchars_left >= t_res.nchars); + s_nchars_left-= s_res.nchars; + t_nchars_left-= t_res.nchars; + } + + return 0; +} + + +/* + One-level collations. +*/ +static int +MY_FUNCTION_NAME(strnncollsp_nchars)(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + size_t nchars) +{ + return MY_FUNCTION_NAME(strnncollsp_nchars_onelevel)(cs, &cs->uca->level[0], + s, slen, t, tlen, + nchars); +} + + +/* + Multi-level collations. +*/ +static int +MY_FUNCTION_NAME(strnncollsp_nchars_multilevel)(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + size_t nchars) +{ + uint num_level= cs->levels_for_order; + uint i; + for (i= 0; i != num_level; i++) + { + int ret= MY_FUNCTION_NAME(strnncollsp_nchars_onelevel)(cs, + &cs->uca->level[i], + s, slen, + t, tlen, + nchars); + if (ret) + return ret; + } + return 0; +} + /* Calculates hash value for the given string, @@ -753,6 +821,7 @@ MY_COLLATION_HANDLER MY_FUNCTION_NAME(collation_handler)= MY_UCA_COLL_INIT, MY_FUNCTION_NAME(strnncoll), MY_FUNCTION_NAME(strnncollsp), + MY_FUNCTION_NAME(strnncollsp_nchars), MY_FUNCTION_NAME(strnxfrm), my_strnxfrmlen_any_uca, MY_LIKE_RANGE, @@ -776,6 +845,7 @@ MY_COLLATION_HANDLER MY_FUNCTION_NAME(collation_handler_nopad)= MY_UCA_COLL_INIT, MY_FUNCTION_NAME(strnncoll), MY_FUNCTION_NAME(strnncollsp_nopad), + MY_FUNCTION_NAME(strnncollsp_nchars), MY_FUNCTION_NAME(strnxfrm_nopad), my_strnxfrmlen_any_uca, MY_LIKE_RANGE, /* my_like_range_mb or my_like_range_generic */ @@ -797,6 +867,7 @@ MY_COLLATION_HANDLER MY_FUNCTION_NAME(collation_handler_multilevel)= MY_UCA_COLL_INIT, MY_FUNCTION_NAME(strnncoll_multilevel), MY_FUNCTION_NAME(strnncollsp_multilevel), + MY_FUNCTION_NAME(strnncollsp_nchars_multilevel), MY_FUNCTION_NAME(strnxfrm_multilevel), my_strnxfrmlen_any_uca_multilevel, MY_LIKE_RANGE, @@ -818,6 +889,7 @@ MY_COLLATION_HANDLER MY_FUNCTION_NAME(collation_handler_nopad_multilevel)= MY_UCA_COLL_INIT, MY_FUNCTION_NAME(strnncoll_multilevel), MY_FUNCTION_NAME(strnncollsp_nopad_multilevel), + MY_FUNCTION_NAME(strnncollsp_nchars_multilevel), MY_FUNCTION_NAME(strnxfrm_multilevel), my_strnxfrmlen_any_uca_multilevel, MY_LIKE_RANGE, diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index c230c65d3d6..7ced12d846f 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1211,27 +1211,27 @@ static inline int my_weight_mb2_utf16mb2_general_ci(uchar b0, uchar b1) #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB2(b0,b1) my_weight_mb2_utf16mb2_general_ci(b0,b1) #define WEIGHT_MB4(b0,b1,b2,b3) MY_CS_REPLACEMENT_CHARACTER -#include "strcoll.ic" +#include "strcoll.inl" #define MY_FUNCTION_NAME(x) my_ ## x ## _utf16_bin #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB2(b0,b1) ((int) MY_UTF16_WC2(b0, b1)) #define WEIGHT_MB4(b0,b1,b2,b3) ((int) MY_UTF16_WC4(b0, b1, b2, b3)) -#include "strcoll.ic" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD #define MY_FUNCTION_NAME(x) my_ ## x ## _utf16_general_nopad_ci #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB2(b0,b1) my_weight_mb2_utf16mb2_general_ci(b0,b1) #define WEIGHT_MB4(b0,b1,b2,b3) MY_CS_REPLACEMENT_CHARACTER -#include "strcoll.ic" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD #define MY_FUNCTION_NAME(x) my_ ## x ## _utf16_nopad_bin #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB2(b0,b1) ((int) MY_UTF16_WC2(b0, b1)) #define WEIGHT_MB4(b0,b1,b2,b3) ((int) MY_UTF16_WC4(b0, b1, b2, b3)) -#include "strcoll.ic" +#include "strcoll.inl" #undef IS_MB2_CHAR #undef IS_MB4_CHAR @@ -1414,7 +1414,7 @@ my_charlen_utf16(CHARSET_INFO *cs, const uchar *str, const uchar *end) #define MY_FUNCTION_NAME(x) my_ ## x ## _utf16 #define CHARLEN(cs,str,end) my_charlen_utf16(cs,str,end) #define DEFINE_WELL_FORMED_CHAR_LENGTH_USING_CHARLEN -#include "ctype-mb.ic" +#include "ctype-mb.inl" #undef MY_FUNCTION_NAME #undef CHARLEN #undef DEFINE_WELL_FORMED_CHAR_LENGTH_USING_CHARLEN @@ -1507,6 +1507,7 @@ static MY_COLLATION_HANDLER my_collation_utf16_general_ci_handler = NULL, /* init */ my_strnncoll_utf16_general_ci, my_strnncollsp_utf16_general_ci, + my_strnncollsp_nchars_utf16_general_ci, my_strnxfrm_utf16_general_ci, my_strnxfrmlen_unicode, my_like_range_generic, @@ -1525,6 +1526,7 @@ static MY_COLLATION_HANDLER my_collation_utf16_bin_handler = NULL, /* init */ my_strnncoll_utf16_bin, my_strnncollsp_utf16_bin, + my_strnncollsp_nchars_utf16_bin, my_strnxfrm_unicode_full_bin, my_strnxfrmlen_unicode_full_bin, my_like_range_generic, @@ -1543,6 +1545,7 @@ static MY_COLLATION_HANDLER my_collation_utf16_general_nopad_ci_handler = NULL, /* init */ my_strnncoll_utf16_general_ci, my_strnncollsp_utf16_general_nopad_ci, + my_strnncollsp_nchars_utf16_general_nopad_ci, my_strnxfrm_nopad_utf16_general_ci, my_strnxfrmlen_unicode, my_like_range_generic, @@ -1561,6 +1564,7 @@ static MY_COLLATION_HANDLER my_collation_utf16_nopad_bin_handler = NULL, /* init */ my_strnncoll_utf16_bin, my_strnncollsp_utf16_nopad_bin, + my_strnncollsp_nchars_utf16_nopad_bin, my_strnxfrm_unicode_full_nopad_bin, my_strnxfrmlen_unicode_full_bin, my_like_range_generic, @@ -1755,27 +1759,27 @@ struct charset_info_st my_charset_utf16_nopad_bin= #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB2(b0,b1) my_weight_mb2_utf16mb2_general_ci(b1,b0) #define WEIGHT_MB4(b0,b1,b2,b3) MY_CS_REPLACEMENT_CHARACTER -#include "strcoll.ic" +#include "strcoll.inl" #define MY_FUNCTION_NAME(x) my_ ## x ## _utf16le_bin #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB2(b0,b1) ((int) MY_UTF16_WC2(b1, b0)) #define WEIGHT_MB4(b0,b1,b2,b3) ((int) MY_UTF16_WC4(b1, b0, b3, b2)) -#include "strcoll.ic" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD #define MY_FUNCTION_NAME(x) my_ ## x ## _utf16le_general_nopad_ci #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB2(b0,b1) my_weight_mb2_utf16mb2_general_ci(b1,b0) #define WEIGHT_MB4(b0,b1,b2,b3) MY_CS_REPLACEMENT_CHARACTER -#include "strcoll.ic" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD #define MY_FUNCTION_NAME(x) my_ ## x ## _utf16le_nopad_bin #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB2(b0,b1) ((int) MY_UTF16_WC2(b1, b0)) #define WEIGHT_MB4(b0,b1,b2,b3) ((int) MY_UTF16_WC4(b1, b0, b3, b2)) -#include "strcoll.ic" +#include "strcoll.inl" #undef IS_MB2_CHAR #undef IS_MB4_CHAR @@ -1856,6 +1860,7 @@ static MY_COLLATION_HANDLER my_collation_utf16le_general_ci_handler = NULL, /* init */ my_strnncoll_utf16le_general_ci, my_strnncollsp_utf16le_general_ci, + my_strnncollsp_nchars_utf16le_general_ci, my_strnxfrm_utf16le_general_ci, my_strnxfrmlen_unicode, my_like_range_generic, @@ -1874,6 +1879,7 @@ static MY_COLLATION_HANDLER my_collation_utf16le_bin_handler = NULL, /* init */ my_strnncoll_utf16le_bin, my_strnncollsp_utf16le_bin, + my_strnncollsp_nchars_utf16le_bin, my_strnxfrm_unicode_full_bin, my_strnxfrmlen_unicode_full_bin, my_like_range_generic, @@ -1892,6 +1898,7 @@ static MY_COLLATION_HANDLER my_collation_utf16le_general_nopad_ci_handler = NULL, /* init */ my_strnncoll_utf16le_general_ci, my_strnncollsp_utf16le_general_nopad_ci, + my_strnncollsp_nchars_utf16le_general_nopad_ci, my_strnxfrm_nopad_utf16le_general_ci, my_strnxfrmlen_unicode, my_like_range_generic, @@ -1910,6 +1917,7 @@ static MY_COLLATION_HANDLER my_collation_utf16le_nopad_bin_handler = NULL, /* init */ my_strnncoll_utf16le_bin, my_strnncollsp_utf16le_nopad_bin, + my_strnncollsp_nchars_utf16le_nopad_bin, my_strnxfrm_unicode_full_nopad_bin, my_strnxfrmlen_unicode_full_bin, my_like_range_generic, @@ -2127,24 +2135,24 @@ static inline int my_weight_utf32_general_ci(uchar b0, uchar b1, #define UNICASE_PAGES my_unicase_default_pages #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB4(b0,b1,b2,b3) my_weight_utf32_general_ci(b0, b1, b2, b3) -#include "strcoll.ic" +#include "strcoll.inl" #define MY_FUNCTION_NAME(x) my_ ## x ## _utf32_bin #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB4(b0,b1,b2,b3) ((int) MY_UTF32_WC4(b0, b1, b2, b3)) -#include "strcoll.ic" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD #define MY_FUNCTION_NAME(x) my_ ## x ## _utf32_general_nopad_ci #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB4(b0,b1,b2,b3) my_weight_utf32_general_ci(b0, b1, b2, b3) -#include "strcoll.ic" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD #define MY_FUNCTION_NAME(x) my_ ## x ## _utf32_nopad_bin #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB4(b0,b1,b2,b3) ((int) MY_UTF32_WC4(b0, b1, b2, b3)) -#include "strcoll.ic" +#include "strcoll.inl" #undef IS_MB2_CHAR #undef IS_MB4_CHAR @@ -2314,7 +2322,7 @@ my_charlen_utf32(CHARSET_INFO *cs __attribute__((unused)), #define MY_FUNCTION_NAME(x) my_ ## x ## _utf32 #define CHARLEN(cs,str,end) my_charlen_utf32(cs,str,end) #define DEFINE_WELL_FORMED_CHAR_LENGTH_USING_CHARLEN -#include "ctype-mb.ic" +#include "ctype-mb.inl" #undef MY_FUNCTION_NAME #undef CHARLEN #undef DEFINE_WELL_FORMED_CHAR_LENGTH_USING_CHARLEN @@ -2690,6 +2698,7 @@ static MY_COLLATION_HANDLER my_collation_utf32_general_ci_handler = NULL, /* init */ my_strnncoll_utf32_general_ci, my_strnncollsp_utf32_general_ci, + my_strnncollsp_nchars_utf32_general_ci, my_strnxfrm_utf32_general_ci, my_strnxfrmlen_unicode, my_like_range_generic, @@ -2708,6 +2717,7 @@ static MY_COLLATION_HANDLER my_collation_utf32_bin_handler = NULL, /* init */ my_strnncoll_utf32_bin, my_strnncollsp_utf32_bin, + my_strnncollsp_nchars_utf32_bin, my_strnxfrm_unicode_full_bin, my_strnxfrmlen_unicode_full_bin, my_like_range_generic, @@ -2726,6 +2736,7 @@ static MY_COLLATION_HANDLER my_collation_utf32_general_nopad_ci_handler = NULL, /* init */ my_strnncoll_utf32_general_ci, my_strnncollsp_utf32_general_nopad_ci, + my_strnncollsp_nchars_utf32_general_nopad_ci, my_strnxfrm_nopad_utf32_general_ci, my_strnxfrmlen_unicode, my_like_range_generic, @@ -2744,6 +2755,7 @@ static MY_COLLATION_HANDLER my_collation_utf32_nopad_bin_handler = NULL, /* init */ my_strnncoll_utf32_bin, my_strnncollsp_utf32_nopad_bin, + my_strnncollsp_nchars_utf32_nopad_bin, my_strnxfrm_unicode_full_nopad_bin, my_strnxfrmlen_unicode_full_bin, my_like_range_generic, @@ -2990,7 +3002,7 @@ static const uchar to_upper_ucs2[] = { }; -/* Definitions for strcoll.ic */ +/* Definitions for strcoll.inl */ #define IS_MB2_CHAR(x,y) (1) #define UCS2_CODE(b0,b1) (((uchar) b0) << 8 | ((uchar) b1)) @@ -3013,7 +3025,7 @@ static inline int my_weight_mb2_ucs2_general_ci(uchar b0, uchar b1) #define UNICASE_PAGES my_unicase_default_pages #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB2(b0,b1) my_weight_mb2_ucs2_general_ci(b0,b1) -#include "strcoll.ic" +#include "strcoll.inl" #define MY_FUNCTION_NAME(x) my_ ## x ## _ucs2_bin @@ -3022,21 +3034,21 @@ static inline int my_weight_mb2_ucs2_general_ci(uchar b0, uchar b1) #define OPTIMIZE_ASCII 0 #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB2(b0,b1) UCS2_CODE(b0,b1) -#include "strcoll.ic" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD #define MY_FUNCTION_NAME(x) my_ ## x ## _ucs2_general_nopad_ci #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB2(b0,b1) my_weight_mb2_ucs2_general_ci(b0,b1) -#include "strcoll.ic" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD #define MY_FUNCTION_NAME(x) my_ ## x ## _ucs2_nopad_bin #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB2(b0,b1) UCS2_CODE(b0,b1) -#include "strcoll.ic" +#include "strcoll.inl" static int @@ -3289,6 +3301,7 @@ static MY_COLLATION_HANDLER my_collation_ucs2_general_ci_handler = NULL, /* init */ my_strnncoll_ucs2_general_ci, my_strnncollsp_ucs2_general_ci, + my_strnncollsp_nchars_ucs2_general_ci, my_strnxfrm_ucs2_general_ci, my_strnxfrmlen_unicode, my_like_range_generic, @@ -3307,6 +3320,7 @@ static MY_COLLATION_HANDLER my_collation_ucs2_bin_handler = NULL, /* init */ my_strnncoll_ucs2_bin, my_strnncollsp_ucs2_bin, + my_strnncollsp_nchars_ucs2_bin, my_strnxfrm_ucs2_bin, my_strnxfrmlen_unicode, my_like_range_generic, @@ -3325,6 +3339,7 @@ static MY_COLLATION_HANDLER my_collation_ucs2_general_nopad_ci_handler = NULL, /* init */ my_strnncoll_ucs2_general_ci, my_strnncollsp_ucs2_general_nopad_ci, + my_strnncollsp_nchars_ucs2_general_nopad_ci, my_strnxfrm_nopad_ucs2_general_ci, my_strnxfrmlen_unicode, my_like_range_generic, @@ -3343,6 +3358,7 @@ static MY_COLLATION_HANDLER my_collation_ucs2_nopad_bin_handler = NULL, /* init */ my_strnncoll_ucs2_bin, my_strnncollsp_ucs2_nopad_bin, + my_strnncollsp_nchars_ucs2_nopad_bin, my_strnxfrm_nopad_ucs2_bin, my_strnxfrmlen_unicode, my_like_range_generic, diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c index 79c552fd430..adcd4825d88 100644 --- a/strings/ctype-ujis.c +++ b/strings/ctype-ujis.c @@ -203,7 +203,7 @@ static const uchar sort_order_ujis[]= #define IS_MB3_CHAR(x, y, z) (isujis_ss3(x) && IS_MB2_JIS(y,z)) #define IS_MB_PREFIX2(x,y) (isujis_ss3(x) && isujis(y)) #define DEFINE_ASIAN_ROUTINES -#include "ctype-mb.ic" +#include "ctype-mb.inl" #define MY_FUNCTION_NAME(x) my_ ## x ## _ujis_japanese_ci #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) @@ -212,7 +212,7 @@ static const uchar sort_order_ujis[]= (((uint) (uchar) (y)) << 8)) #define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z)) #define STRCOLL_MB7_TOUPPER -#include "strcoll.ic" +#include "strcoll.inl" #define MY_FUNCTION_NAME(x) my_ ## x ## _ujis_bin @@ -222,7 +222,7 @@ static const uchar sort_order_ujis[]= (((uint) (uchar) (y)) << 8)) #define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z)) #define STRCOLL_MB7_BIN -#include "strcoll.ic" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD @@ -233,7 +233,7 @@ static const uchar sort_order_ujis[]= (((uint) (uchar) (y)) << 8)) #define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z)) #define STRCOLL_MB7_TOUPPER -#include "strcoll.ic" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD @@ -244,7 +244,7 @@ static const uchar sort_order_ujis[]= (((uint) (uchar) (y)) << 8)) #define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z)) #define STRCOLL_MB7_BIN -#include "strcoll.ic" +#include "strcoll.inl" static @@ -67246,6 +67246,7 @@ static MY_COLLATION_HANDLER my_collation_ujis_japanese_ci_handler = NULL, /* init */ my_strnncoll_ujis_japanese_ci, my_strnncollsp_ujis_japanese_ci, + my_strnncollsp_nchars_ujis_japanese_ci, my_strnxfrm_mb, /* strnxfrm */ my_strnxfrmlen_simple, my_like_range_mb, /* like_range */ @@ -67264,6 +67265,7 @@ static MY_COLLATION_HANDLER my_collation_ujis_bin_handler = NULL, /* init */ my_strnncoll_ujis_bin, my_strnncollsp_ujis_bin, + my_strnncollsp_nchars_ujis_bin, my_strnxfrm_mb, my_strnxfrmlen_simple, my_like_range_mb, @@ -67282,6 +67284,7 @@ static MY_COLLATION_HANDLER my_collation_ujis_japanese_nopad_ci_handler = NULL, /* init */ my_strnncoll_ujis_japanese_ci, my_strnncollsp_ujis_japanese_nopad_ci, + my_strnncollsp_nchars_ujis_japanese_nopad_ci, my_strnxfrm_mb_nopad, my_strnxfrmlen_simple, my_like_range_mb, @@ -67300,6 +67303,7 @@ static MY_COLLATION_HANDLER my_collation_ujis_nopad_bin_handler = NULL, /* init */ my_strnncoll_ujis_bin, my_strnncollsp_ujis_nopad_bin, + my_strnncollsp_nchars_ujis_nopad_bin, my_strnxfrm_mb_nopad, my_strnxfrmlen_simple, my_like_range_mb, diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 28e01d71bde..40a01d4cba6 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -32,7 +32,7 @@ #include "ctype-unidata.h" -/* Definitions for strcoll.ic */ +/* Definitions for strcoll.inl */ #define IS_MB1_CHAR(x) ((uchar) (x) < 0x80) #define IS_MB1_MBHEAD_UNUSED_GAP(x) ((uchar) (x) < 0xC2) #define IS_MB2_CHAR(x,y) IS_UTF8MB2_STEP2(x,y) @@ -5476,7 +5476,7 @@ int my_charlen_utf8mb3(CHARSET_INFO *cs __attribute__((unused)), #define MY_FUNCTION_NAME(x) my_ ## x ## _utf8mb3 #define CHARLEN(cs,str,end) my_charlen_utf8mb3(cs,str,end) #define DEFINE_WELL_FORMED_CHAR_LENGTH_USING_CHARLEN -#include "ctype-mb.ic" +#include "ctype-mb.inl" #undef MY_FUNCTION_NAME #undef CHARLEN #undef DEFINE_WELL_FORMED_CHAR_LENGTH_USING_CHARLEN @@ -5528,7 +5528,7 @@ static inline int my_weight_mb3_utf8mb3_general_ci(uchar b0, uchar b1, uchar b2) #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" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD @@ -5538,7 +5538,7 @@ static inline int my_weight_mb3_utf8mb3_general_ci(uchar b0, uchar b1, uchar b2) #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" +#include "strcoll.inl" static inline int my_weight_mb1_utf8mb3_general_mysql500_ci(uchar b) @@ -5580,7 +5580,7 @@ my_weight_mb3_utf8mb3_general_mysql500_ci(uchar b0, uchar b1, uchar b2) #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" +#include "strcoll.inl" #define MY_FUNCTION_NAME(x) my_ ## x ## _utf8mb3_bin @@ -5592,7 +5592,7 @@ my_weight_mb3_utf8mb3_general_mysql500_ci(uchar b0, uchar b1, uchar b2) #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" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD @@ -5602,7 +5602,7 @@ my_weight_mb3_utf8mb3_general_mysql500_ci(uchar b0, uchar b1, uchar b2) #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" +#include "strcoll.inl" /* TODO-10.2: join this with pad_max_char() in ctype-mb.c @@ -5641,6 +5641,7 @@ static MY_COLLATION_HANDLER my_collation_utf8mb3_general_ci_handler = NULL, /* init */ my_strnncoll_utf8mb3_general_ci, my_strnncollsp_utf8mb3_general_ci, + my_strnncollsp_nchars_utf8mb3_general_ci, my_strnxfrm_utf8mb3_general_ci, my_strnxfrmlen_unicode, my_like_range_mb, @@ -5659,6 +5660,7 @@ static MY_COLLATION_HANDLER my_collation_utf8mb3_general_mysql500_ci_handler = NULL, /* init */ my_strnncoll_utf8mb3_general_mysql500_ci, my_strnncollsp_utf8mb3_general_mysql500_ci, + my_strnncollsp_nchars_utf8mb3_general_mysql500_ci, my_strnxfrm_utf8mb3_general_mysql500_ci, my_strnxfrmlen_unicode, my_like_range_mb, @@ -5677,6 +5679,7 @@ static MY_COLLATION_HANDLER my_collation_utf8mb3_bin_handler = NULL, /* init */ my_strnncoll_utf8mb3_bin, my_strnncollsp_utf8mb3_bin, + my_strnncollsp_nchars_utf8mb3_bin, my_strnxfrm_utf8mb3_bin, my_strnxfrmlen_unicode, my_like_range_mb, @@ -5695,6 +5698,7 @@ static MY_COLLATION_HANDLER my_collation_utf8mb3_general_nopad_ci_handler = NULL, /* init */ my_strnncoll_utf8mb3_general_ci, my_strnncollsp_utf8mb3_general_nopad_ci, + my_strnncollsp_nchars_utf8mb3_general_nopad_ci, my_strnxfrm_nopad_utf8mb3_general_ci, my_strnxfrmlen_unicode, my_like_range_mb, @@ -5713,6 +5717,7 @@ static MY_COLLATION_HANDLER my_collation_utf8mb3_nopad_bin_handler = NULL, /* init */ my_strnncoll_utf8mb3_bin, my_strnncollsp_utf8mb3_nopad_bin, + my_strnncollsp_nchars_utf8mb3_nopad_bin, my_strnxfrm_nopad_utf8mb3_bin, my_strnxfrmlen_unicode, my_like_range_mb, @@ -6045,6 +6050,7 @@ static MY_COLLATION_HANDLER my_collation_cs_handler = NULL, /* init */ my_strnncoll_utf8mb3_cs, my_strnncollsp_utf8mb3_cs, + my_strnncollsp_nchars_generic, my_strnxfrm_utf8mb3_general_ci, my_strnxfrmlen_unicode, my_like_range_simple, @@ -7336,7 +7342,7 @@ my_wc_to_printable_filename(CHARSET_INFO *cs, my_wc_t wc, #define MY_FUNCTION_NAME(x) my_ ## x ## _filename #define CHARLEN(cs,str,end) my_charlen_filename(cs,str,end) #define DEFINE_WELL_FORMED_CHAR_LENGTH_USING_CHARLEN -#include "ctype-mb.ic" +#include "ctype-mb.inl" #undef MY_FUNCTION_NAME #undef CHARLEN #undef DEFINE_WELL_FORMED_CHAR_LENGTH_USING_CHARLEN @@ -7357,7 +7363,7 @@ my_wc_to_printable_filename(CHARSET_INFO *cs, my_wc_t wc, #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) */ -#include "strcoll.ic" +#include "strcoll.inl" static MY_COLLATION_HANDLER my_collation_filename_handler = @@ -7365,6 +7371,7 @@ static MY_COLLATION_HANDLER my_collation_filename_handler = NULL, /* init */ my_strnncoll_simple, my_strnncollsp_simple, + my_strnncollsp_nchars_generic, my_strnxfrm_filename, my_strnxfrmlen_unicode, my_like_range_mb, @@ -7942,7 +7949,7 @@ my_charlen_utf8mb4(CHARSET_INFO *cs __attribute__((unused)), #define MY_FUNCTION_NAME(x) my_ ## x ## _utf8mb4 #define CHARLEN(cs,str,end) my_charlen_utf8mb4(cs,str,end) #define DEFINE_WELL_FORMED_CHAR_LENGTH_USING_CHARLEN -#include "ctype-mb.ic" +#include "ctype-mb.inl" #undef MY_FUNCTION_NAME #undef CHARLEN #undef DEFINE_WELL_FORMED_CHAR_LENGTH_USING_CHARLEN @@ -7967,7 +7974,7 @@ my_charlen_utf8mb4(CHARSET_INFO *cs __attribute__((unused)), */ #define WEIGHT_MB4(b0,b1,b2,b3) MY_CS_REPLACEMENT_CHARACTER #define STRCOLL_MB7_TOUPPER -#include "strcoll.ic" +#include "strcoll.inl" #define MY_FUNCTION_NAME(x) my_ ## x ## _utf8mb4_bin @@ -7977,7 +7984,7 @@ my_charlen_utf8mb4(CHARSET_INFO *cs __attribute__((unused)), #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" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD @@ -7992,7 +7999,7 @@ my_charlen_utf8mb4(CHARSET_INFO *cs __attribute__((unused)), */ #define WEIGHT_MB4(b0,b1,b2,b3) MY_CS_REPLACEMENT_CHARACTER #define STRCOLL_MB7_TOUPPER -#include "strcoll.ic" +#include "strcoll.inl" #define DEFINE_STRNNCOLLSP_NOPAD @@ -8003,7 +8010,7 @@ my_charlen_utf8mb4(CHARSET_INFO *cs __attribute__((unused)), #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" +#include "strcoll.inl" static MY_COLLATION_HANDLER my_collation_utf8mb4_general_ci_handler= @@ -8011,6 +8018,7 @@ static MY_COLLATION_HANDLER my_collation_utf8mb4_general_ci_handler= NULL, /* init */ my_strnncoll_utf8mb4_general_ci, my_strnncollsp_utf8mb4_general_ci, + my_strnncollsp_nchars_utf8mb4_general_ci, my_strnxfrm_utf8mb4_general_ci, my_strnxfrmlen_unicode, my_like_range_mb, @@ -8029,6 +8037,7 @@ static MY_COLLATION_HANDLER my_collation_utf8mb4_bin_handler = NULL, /* init */ my_strnncoll_utf8mb4_bin, my_strnncollsp_utf8mb4_bin, + my_strnncollsp_nchars_utf8mb4_bin, my_strnxfrm_unicode_full_bin, my_strnxfrmlen_unicode_full_bin, my_like_range_mb, @@ -8047,6 +8056,7 @@ static MY_COLLATION_HANDLER my_collation_utf8mb4_general_nopad_ci_handler= NULL, /* init */ my_strnncoll_utf8mb4_general_ci, my_strnncollsp_utf8mb4_general_nopad_ci, + my_strnncollsp_nchars_utf8mb4_general_nopad_ci, my_strnxfrm_nopad_utf8mb4_general_ci, my_strnxfrmlen_unicode, my_like_range_mb, @@ -8065,6 +8075,7 @@ static MY_COLLATION_HANDLER my_collation_utf8mb4_nopad_bin_handler = NULL, /* init */ my_strnncoll_utf8mb4_bin, my_strnncollsp_utf8mb4_nopad_bin, + my_strnncollsp_nchars_utf8mb4_nopad_bin, my_strnxfrm_unicode_full_nopad_bin, my_strnxfrmlen_unicode_full_bin, my_like_range_mb, diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c index 689b20b8936..97cc7d8c763 100644 --- a/strings/ctype-win1250ch.c +++ b/strings/ctype-win1250ch.c @@ -678,6 +678,7 @@ static MY_COLLATION_HANDLER my_collation_czech_cs_handler = NULL, /* init */ my_strnncoll_win1250ch, my_strnncollsp_win1250ch, + my_strnncollsp_nchars_generic_8bit, my_strnxfrm_win1250ch, my_strnxfrmlen_simple, my_like_range_win1250ch, diff --git a/strings/ctype.c b/strings/ctype.c index 1409f68a722..a4bdd1bc62c 100644 --- a/strings/ctype.c +++ b/strings/ctype.c @@ -1352,3 +1352,32 @@ outp: copy_status->m_source_end_pos= from; return to - to_start; } + + +int my_strnncollsp_nchars_generic(CHARSET_INFO *cs, + const uchar *str1, size_t len1, + const uchar *str2, size_t len2, + size_t nchars) +{ + int error; + len1= my_well_formed_length(cs, (const char *) str1, + (const char *) str1 + len1, + nchars, &error); + len2= my_well_formed_length(cs, (const char *) str2, + (const char *) str2 + len2, + nchars, &error); + DBUG_ASSERT((cs->state & MY_CS_NOPAD) == 0); + return cs->coll->strnncollsp(cs, str1, len1, str2, len2); +} + + +int my_strnncollsp_nchars_generic_8bit(CHARSET_INFO *cs, + const uchar *str1, size_t len1, + const uchar *str2, size_t len2, + size_t nchars) +{ + set_if_smaller(len1, nchars); + set_if_smaller(len2, nchars); + DBUG_ASSERT((cs->state & MY_CS_NOPAD) == 0); + return cs->coll->strnncollsp(cs, str1, len1, str2, len2); +} diff --git a/strings/json_lib.c b/strings/json_lib.c index 7b895c216b5..3803b2649a5 100644 --- a/strings/json_lib.c +++ b/strings/json_lib.c @@ -807,10 +807,13 @@ static json_state_handler json_actions[NR_JSON_STATES][NR_C_CLASSES]= int json_scan_start(json_engine_t *je, CHARSET_INFO *i_cs, const uchar *str, const uchar *end) { + static const uchar no_time_to_die= 0; + json_string_setup(&je->s, i_cs, str, end); je->stack[0]= JST_DONE; je->stack_p= 0; je->state= JST_VALUE; + je->killed_ptr = (uchar*)&no_time_to_die; return 0; } @@ -971,7 +974,7 @@ int json_scan_next(json_engine_t *j) int t_next; get_first_nonspace(&j->s, &t_next, &j->sav_c_len); - return json_actions[j->state][t_next](j); + return *j->killed_ptr || json_actions[j->state][t_next](j); } diff --git a/strings/strcoll.ic b/strings/strcoll.inl index bf011245981..eb5c6e3c717 100644 --- a/strings/strcoll.ic +++ b/strings/strcoll.inl @@ -373,6 +373,56 @@ MY_FUNCTION_NAME(strnncollsp)(CHARSET_INFO *cs __attribute__((unused)), } #endif /* DEFINE_STRNNCOLLSP_NOPAD */ + +/** + Compare two strings according to the collation, + with trailing space padding or trimming, according to "nchars". + + @param cs - the character set and collation + @param a - the left string + @param a_length - the length of the left string + @param b - the right string + @param b_length - the length of the right string + @param nchars - compare this amount of characters only + @return - the comparison result +*/ +static int +MY_FUNCTION_NAME(strnncollsp_nchars)(CHARSET_INFO *cs __attribute__((unused)), + const uchar *a, size_t a_length, + const uchar *b, size_t b_length, + size_t nchars) +{ + const uchar *a_end= a + a_length; + const uchar *b_end= b + b_length; + for ( ; nchars ; nchars--) + { + 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); + + if ((res= (a_weight - b_weight))) + { + /* Got two different weights. See comments in strnncollsp above. */ + return res; + } + if (!a_wlen && !b_wlen) + { + /* Got two auto-generated trailing spaces. */ + DBUG_ASSERT(a == a_end); + DBUG_ASSERT(b == b_end); + return 0; + } + /* + At least one of the strings has not ended yet, continue comparison. + */ + DBUG_ASSERT(a < a_end || b < b_end); + a+= a_wlen; + b+= b_wlen; + } + return 0; +} + + #endif /* DEFINE_STRNNCOLL */ diff --git a/strings/strings_def.h b/strings/strings_def.h index 3e5298bc4ec..19c167d116d 100644 --- a/strings/strings_def.h +++ b/strings/strings_def.h @@ -105,6 +105,16 @@ static inline const uchar *skip_trailing_space(const uchar *ptr,size_t len) } +int my_strnncollsp_nchars_generic(CHARSET_INFO *cs, + const uchar *str1, size_t len1, + const uchar *str2, size_t len2, + size_t nchars); + +int my_strnncollsp_nchars_generic_8bit(CHARSET_INFO *cs, + const uchar *str1, size_t len1, + const uchar *str2, size_t len2, + size_t nchars); + uint my_8bit_charset_flags_from_data(CHARSET_INFO *cs); uint my_8bit_collation_flags_from_data(CHARSET_INFO *cs); diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt index 90e79954fd1..e0ea78e282e 100644 --- a/support-files/CMakeLists.txt +++ b/support-files/CMakeLists.txt @@ -29,6 +29,7 @@ ELSE() SET(CFLAGS ${CMAKE_C_FLAGS}) SET(CXXFLAGS ${CMAKE_CXX_FLAGS}) SET(MYSQLD_USER "mysql") + SET(MYSQLD_GROUP "mysql") SET(ini_file_extension "cnf") SET(HOSTNAME "uname -n") ENDIF() @@ -79,7 +80,7 @@ IF(UNIX AND NOT WITHOUT_SERVER) INSTALL(FILES ${out} DESTINATION ${inst_location}/policy/selinux COMPONENT SupportFiles) ENDFOREACH() IF(RPM) - EXECUTE_PROCESS(COMMAND rpm -q --qf "%{VERSION}" libsepol + EXECUTE_PROCESS(COMMAND rpm -q --qf "%{VERSION}" libsepol."${CMAKE_SYSTEM_PROCESSOR}" OUTPUT_VARIABLE LIBSEPOL_VERSION RESULT_VARIABLE err) IF (NOT err) SET(CPACK_RPM_server_PACKAGE_REQUIRES diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in index ae3ef3cb7db..c9f78870619 100644 --- a/support-files/mariadb.service.in +++ b/support-files/mariadb.service.in @@ -60,6 +60,8 @@ PrivateDevices=false # Prevent writes to /usr, /boot, and /etc ProtectSystem=full +@SYSTEMD_READWRITEPATH@ + # Doesn't yet work properly with SELinux enabled # NoNewPrivileges=true diff --git a/support-files/mariadb@.service.in b/support-files/mariadb@.service.in index 3e62ae906e2..1160bf62167 100644 --- a/support-files/mariadb@.service.in +++ b/support-files/mariadb@.service.in @@ -190,6 +190,8 @@ PrivateDevices=false # Prevent writes to /usr, /boot, and /etc ProtectSystem=full +@SYSTEMD_READWRITEPATH@ + # Requires kernel 4.14 or later and SELinux transition rule for mysqld_t # (https://github.com/systemd/systemd/issues/3845) # NoNewPrivileges=true diff --git a/support-files/mysql-log-rotate.sh b/support-files/mysql-log-rotate.sh index 37ae018c1d1..c89aa6e0b99 100644 --- a/support-files/mysql-log-rotate.sh +++ b/support-files/mysql-log-rotate.sh @@ -20,6 +20,7 @@ @localstatedir@/mysqld.log { # create 600 mysql mysql + su mysql mysql notifempty daily rotate 3 diff --git a/support-files/policy/selinux/mariadb-server.te b/support-files/policy/selinux/mariadb-server.te index 71924012283..851f8add61c 100644 --- a/support-files/policy/selinux/mariadb-server.te +++ b/support-files/policy/selinux/mariadb-server.te @@ -77,6 +77,7 @@ allow mysqld_t user_tmp_t:dir { write add_name }; allow mysqld_t user_tmp_t:file create; allow mysqld_t bin_t:lnk_file read; allow mysqld_t tmp_t:file { append create read write open getattr unlink setattr }; +allow mysqld_t usermodehelper_t:file { read open }; # Allows too much leeway - the mariabackup/wsrep rules in fc should fix it, but # keep for the moment. diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 16396daf585..6fe2b462db8 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -1,5 +1,5 @@ /* Copyright (c) 2002, 2014, Oracle and/or its affiliates. - Copyright (c) 2008, 2021, MariaDB + Copyright (c) 2008, 2022, 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 @@ -20858,6 +20858,91 @@ static void test_mdev_26145() myquery(rc); } +static void test_mdev24827() +{ + int rc; + MYSQL_STMT *stmt; + unsigned long cursor = CURSOR_TYPE_READ_ONLY; + const char* query= + "SELECT t2.c1 AS c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 " + "WHERE EXISTS (SELECT 1 FROM t1 WHERE c2 = -1) ORDER BY c1"; + + myheader("test_mdev24827"); + + rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1"); + myquery(rc); + + rc= mysql_query(mysql, "DROP TABLE IF EXISTS t2"); + myquery(rc); + + rc= mysql_query(mysql, "CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT)"); + myquery(rc); + + rc= mysql_query(mysql, "CREATE TABLE t2 (c1 INT PRIMARY KEY, c2 INT, " + "KEY idx_c2(c2))"); + myquery(rc); + + rc= mysql_query(mysql, "INSERT INTO t1 (c1, c2) " + "SELECT seq, seq FROM seq_1_to_10000"); + myquery(rc); + + rc= mysql_query(mysql, "INSERT INTO t2 (c1, c2) " + "SELECT seq, seq FROM seq_1_to_20000"); + myquery(rc); + + stmt= mysql_stmt_init(mysql); + check_stmt(stmt); + + rc= mysql_stmt_prepare(stmt, query, strlen(query)); + check_execute(stmt, rc); + + rc= mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, &cursor); + check_execute(stmt, rc); + + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + mysql_stmt_close(stmt); + + rc= mysql_query(mysql, "DROP TABLE t1"); + myquery(rc); + + rc= mysql_query(mysql, "DROP TABLE t2"); + myquery(rc); +} + +static void test_mdev_20516() +{ + MYSQL_STMT *stmt; + int rc; + unsigned long cursor= CURSOR_TYPE_READ_ONLY; + const char* query= + "CREATE VIEW v1 AS SELECT * FROM t1"; + + myheader("test_mdev_20516"); + + rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1"); + myquery(rc); + + rc= mysql_query(mysql, "CREATE TABLE t1(a INT)"); + myquery(rc); + + stmt= mysql_stmt_init(mysql); + check_stmt(stmt); + + rc= mysql_stmt_prepare(stmt, query, strlen(query)); + check_execute(stmt, rc); + + rc= mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, &cursor); + check_execute(stmt, rc); + + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + mysql_stmt_close(stmt); + + rc= mysql_query(mysql, "DROP TABLE t1"); + myquery(rc); +} + static void print_metadata(MYSQL_RES *rs_metadata, int num_fields) { int i; @@ -21612,6 +21697,8 @@ void test_mdev_10075() } static struct my_tests_st my_tests[]= { + { "test_mdev_20516", test_mdev_20516 }, + { "test_mdev24827", test_mdev24827 }, { "test_mdev_26145", test_mdev_26145 }, { "disable_query_logs", disable_query_logs }, { "test_view_sp_list_fields", test_view_sp_list_fields }, diff --git a/unittest/strings/strings-t.c b/unittest/strings/strings-t.c index 2141d09c949..7532244b0a2 100644 --- a/unittest/strings/strings-t.c +++ b/unittest/strings/strings-t.c @@ -20,6 +20,30 @@ /* + U+00DF LATIN SMALL LETTER SHARP S = _utf8 x'C39F' = _latin1 x'DF' +*/ + +#define UTF8_sz "\xC3\x9F" +#define LATIN1_sz "\xDF" + +/* + U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE = _utf8 x'C385' +*/ + +#define UTF8_ARING "\xC3\x85" + +/* + U+00E4 LATIN SMALL LETTER A WITH DIAERESIS = _utf8 x'C3A4' +*/ +#define UTF8_auml "\xC3\xA4" +#define LATIN1_auml "\xE4" + +#define UCS2_a "\x00\x61" +#define UCS2_b "\x00\x62" +#define UCS2_sp "\x00\x20" + + +/* Test that like_range() returns well-formed results. */ static int @@ -1013,11 +1037,483 @@ static int test_minmax_str() return failed; } -int main() +typedef struct +{ + LEX_CSTRING a; + LEX_CSTRING b; + size_t nchars; + int res; +} STRNNCOLLSP_CHAR_PARAM; + + +/* + Some lines in the below test data are marked as follows: + + IF - An ignorable failure. The scanner finds an ignorable character + followed by a normal character (or by a contraction), + but the "nchars" limit allows only one character to be scanned. + The whole sequence is ignored an is treated as end-of-line. + CF - A contraction failure. The scanner finds a contraction consisting + of two characters, but the "nchars" limit allows only one character + to be scanned. The whole contraction is ignored and is treated + as end-of-line. +*/ + + +/* + Tests for mbminlen1 character sets, + for both PAD SPACE and NOPAD collations +*/ +static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_mbminlen1_xpad_common[]= +{ + {{CSTR("a")}, {CSTR("a")}, 0, 0}, + {{CSTR("a")}, {CSTR("a")}, 1, 0}, + {{CSTR("a")}, {CSTR("a")}, 2, 0}, + {{CSTR("a")}, {CSTR("a")}, 3, 0}, + {{CSTR("a")}, {CSTR("a")}, 100, 0}, + + {{CSTR("a")}, {CSTR("ab")}, 0, 0}, + {{CSTR("a")}, {CSTR("ab")}, 1, 0}, + {{CSTR("a")}, {CSTR("ab")}, 2, -1}, + {{CSTR("a")}, {CSTR("ab")}, 3, -1}, + {{CSTR("a")}, {CSTR("ab")}, 100, -1}, + + {{CSTR("a")}, {CSTR("a ")}, 0, 0}, + {{CSTR("a")}, {CSTR("a ")}, 1, 0}, + {{CSTR("a")}, {CSTR("a ")}, 2, 0}, + {{CSTR("a")}, {CSTR("a ")}, 3, 0}, + {{CSTR("a")}, {CSTR("a ")}, 100, 0}, + + {{CSTR("a")}, {CSTR("a ")}, 0, 0}, + {{CSTR("a")}, {CSTR("a ")}, 1, 0}, + {{CSTR("a")}, {CSTR("a ")}, 2, 0}, + {{CSTR("a")}, {CSTR("a ")}, 3, 0}, + {{CSTR("a")}, {CSTR("a ")}, 100, 0}, + + {{CSTR("ss")}, {CSTR("ss")}, 0, 0}, + {{CSTR("ss")}, {CSTR("ss")}, 1, 0}, + {{CSTR("ss")}, {CSTR("ss")}, 2, 0}, + {{CSTR("ss")}, {CSTR("ss")}, 3, 0}, + {{CSTR("ss")}, {CSTR("ss")}, 100, 0}, + + {{NULL, 0}, {NULL, 0}, 0, 0} +}; + + +/* Tests for utf8, for both PAD SPACE and NOPAD collations */ +static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mbx_xpad_common[]= +{ + {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 0, 0}, + {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 1, 0}, + {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 2, 0}, + {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 3, 0}, + {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 100, 0}, + + {{NULL, 0}, {NULL, 0}, 0, 0} +}; + + +/* Tests for latin1, for both PAD and NOPAD collations */ +static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_latin1_xpad_common[]= +{ + {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 0, 0}, + {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 1, 0}, + {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 2, 0}, + {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 3, 0}, + {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 100, 0}, + + {{NULL, 0}, {NULL, 0}, 0, 0} +}; + + +/* Tests for utf8 collations that sort "A WITH DIAERESIS" equal to "A" */ +static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mbx_xpad_a_eq_auml[]= +{ + {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 0, 0}, + {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 1, 0}, + {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 2, 0}, + {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 3, 0}, + {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 100, 0}, + + {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 0, 0}, + {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 1, 0}, + {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 2, 0}, + {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 3, 0}, + {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 100, 0}, + + {{NULL, 0}, {NULL, 0}, 0, 0} +}; + + +static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mb3_unicode_ci[]= +{ + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 0, 0}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 1, 0}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}/*IF*/, 2, 1}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 3, 0}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 4, 0}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 100, 0}, + + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, -1}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 4, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, 0}, + + {{NULL, 0}, {NULL, 0}, 0, 0} +}; + + +static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mb3_unicode_nopad_ci[]= +{ + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 0, 0}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 1, 0}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}/*IF*/, 2, 1}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 3, 1}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 4, 1}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 100, 1}, + + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, -1}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, -1}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, -1}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 4, -1}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, -1}, + + {{NULL, 0}, {NULL, 0}, 0, 0} +}; + + +static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mb3_danish_ci[]= +{ + {{CSTR("aa")}, {CSTR("")}, 0, 0}, + {{CSTR("aa")}/*CF*/, {CSTR("")}, 1, 1}, + {{CSTR("aa")}, {CSTR("")}, 2, 1}, + {{CSTR("aa")}, {CSTR("")}, 3, 1}, + {{CSTR("aa")}, {CSTR("")}, 100, 1}, + + {{CSTR("aa")}, {CSTR("a")}, 0, 0}, + {{CSTR("aa")}/*CF*/, {CSTR("a")}, 1, 0}, + {{CSTR("aa")}, {CSTR("a")}, 2, 1}, + {{CSTR("aa")}, {CSTR("a")}, 3, 1}, + {{CSTR("aa")}, {CSTR("a")}, 100, 1}, + + {{CSTR("aa")}, {CSTR("aa")}, 0, 0}, + {{CSTR("aa")}/*CF*/, {CSTR("aa")}/*CF*/, 1, 0}, + {{CSTR("aa")}, {CSTR("aa")}, 2, 0}, + {{CSTR("aa")}, {CSTR("aa")}, 3, 0}, + {{CSTR("aa")}, {CSTR("aa")}, 100, 0}, + + {{CSTR("aa")}, {CSTR("\x00" "a")}, 0, 0}, + {{CSTR("aa")}/*CF*/, {CSTR("\x00" "a")}/*IF*/, 1, 1}, + {{CSTR("aa")}, {CSTR("\x00" "a")}, 2, 1}, + {{CSTR("aa")}, {CSTR("\x00" "a")}, 3, 1}, + {{CSTR("aa")}, {CSTR("\x00" "a")}, 100, 1}, + + {{CSTR("aa")}, {CSTR("\x00" "aa")}, 0, 0}, + {{CSTR("aa")}/*CF*/, {CSTR("\x00" "aa")}/*IF*/, 1, 1}, + {{CSTR("aa")}, {CSTR("\x00" "aa")}/*IF*/, 2, 1}, + {{CSTR("aa")}, {CSTR("\x00" "aa")}, 3, 0}, + {{CSTR("aa")}, {CSTR("\x00" "aa")}, 100, 0}, + + {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 0, 0}, + {{CSTR("aa")}/*CF*/, {CSTR("a" "\x00" "a")}, 1, 0}, + {{CSTR("aa")}, {CSTR("a" "\x00" "a")}/*IF*/, 2, 1}, + {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 3, 1}, + {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 100, 1}, + + {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 0, 0}, + {{CSTR("aa")}/*CF*/, {CSTR(UTF8_ARING)}, 1, -1}, + {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 2, 0}, + {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 3, 0}, + {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 100, 0}, + + {{NULL, 0}, {NULL, 0}, 0, 0} +}; + + +static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_latin1_german2_ci[]= +{ + {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 0, 0}, + {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 1, -1}, + {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 2, 0}, + {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 3, 0}, + {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 100, 0}, + + {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 0, 0}, + {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 1, -1}, + {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 2, 0}, + {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 3, 0}, + {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 100, 0}, + + {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 0, 0}, + {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 1, -1}, + {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 2, 0}, + {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 3, 0}, + {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 100, 0}, + + {{NULL, 0}, {NULL, 0}, 0, 0} +}; + + +static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mbx_german2_ci[]= +{ + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, -1}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, 0}, + + {{CSTR("ae")}, {CSTR(UTF8_auml)}, 0, 0}, + {{CSTR("ae")}, {CSTR(UTF8_auml)}, 1, -1}, + {{CSTR("ae")}, {CSTR(UTF8_auml)}, 2, 0}, + {{CSTR("ae")}, {CSTR(UTF8_auml)}, 3, 0}, + {{CSTR("ae")}, {CSTR(UTF8_auml)}, 100, 0}, + + {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 0, 0}, + {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 1, -1}, + {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 2, 0}, + {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 3, 0}, + {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 100, 0}, + + {{NULL, 0}, {NULL, 0}, 0, 0} +}; + + +static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_mbminlen1_xpad_czech[]= +{ + {{CSTR("c")}, {CSTR("ch")}, 0, 0}, + {{CSTR("c")}, {CSTR("ch")}, 1, 0}, + {{CSTR("c")}, {CSTR("ch")}, 2, -1}, + + {{CSTR("h")}, {CSTR("ch")}, 0, 0}, + {{CSTR("h")}, {CSTR("ch")}, 1, 1}, + {{CSTR("h")}, {CSTR("ch")}, 2, -1}, + + {{CSTR("i")}, {CSTR("ch")}, 0, 0}, + {{CSTR("i")}, {CSTR("ch")}, 1, 1}, + {{CSTR("i")}, {CSTR("ch")}, 2, 1}, + + {{NULL, 0}, {NULL, 0}, 0, 0} +}; + + +static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_mbminlen2_xpad_common[]= +{ + {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 0, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 1, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 2, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 3, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 100, 0}, + + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 0, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 1, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 2, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 3, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 100, 0}, + + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 0, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 1, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 2, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 3, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 100, 0}, + + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 0, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 1, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 2, -1}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 3, -1}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 100, -1}, + + {{NULL, 0}, {NULL, 0}, 0, 0} +}; + + +static int +strnncollsp_char_one(CHARSET_INFO *cs, const STRNNCOLLSP_CHAR_PARAM *p) +{ + int failed= 0; + char ahex[64], bhex[64]; + int res= cs->coll->strnncollsp_nchars(cs, + (uchar *) p->a.str, p->a.length, + (uchar *) p->b.str, p->b.length, + p->nchars); + str2hex(ahex, sizeof(ahex), p->a.str, p->a.length); + str2hex(bhex, sizeof(bhex), p->b.str, p->b.length); + diag("%-25s %-12s %-12s %3d %7d %7d%s", + cs->cs_name.str, ahex, bhex, (int) p->nchars, p->res, res, + eqres(res, p->res) ? "" : " FAILED"); + if (!eqres(res, p->res)) + { + failed++; + } + else + { + /* Test in reverse order */ + res= cs->coll->strnncollsp_nchars(cs, + (uchar *) p->b.str, p->b.length, + (uchar *) p->a.str, p->a.length, + p->nchars); + if (!eqres(res, -p->res)) + { + diag("Comparison in reverse order failed. Expected %d, got %d", + -p->res, res); + failed++; + } + } + return failed; +} + + +static int +strnncollsp_char(const char *collation, const STRNNCOLLSP_CHAR_PARAM *param) +{ + int failed= 0; + const STRNNCOLLSP_CHAR_PARAM *p; + CHARSET_INFO *cs= get_charset_by_name(collation, MYF(0)); + + if (!cs) + { + diag("get_charset_by_name() failed"); + return 1; + } + + diag("%-25s %-12s %-12s %-3s %7s %7s", + "Collation", "a", "b", "Nch", "ExpSign", "Actual"); + + for (p= param; p->a.str; p++) + { + failed+= strnncollsp_char_one(cs, p); + } + + return failed; +} + + +static int +strnncollsp_char_mbminlen1(const char *collation, + const STRNNCOLLSP_CHAR_PARAM *specific) +{ + int failed= 0; + failed+= strnncollsp_char(collation, strnncollsp_char_mbminlen1_xpad_common); + if (specific) + failed+= strnncollsp_char(collation, specific); + return failed; +} + + +static int +strnncollsp_char_mbminlen2(const char *collation, + const STRNNCOLLSP_CHAR_PARAM *specific) +{ + int failed= 0; + failed+= strnncollsp_char(collation, strnncollsp_char_mbminlen2_xpad_common); + if (specific) + failed+= strnncollsp_char(collation, specific); + return failed; +} + + +static int +strnncollsp_char_latin1(const char *collation, + const STRNNCOLLSP_CHAR_PARAM *specific) +{ + int failed= 0; + failed+= strnncollsp_char(collation, strnncollsp_char_mbminlen1_xpad_common); + failed+= strnncollsp_char(collation, strnncollsp_char_latin1_xpad_common); + if (specific) + failed+= strnncollsp_char(collation, specific); + return failed; +} + + +static int +strnncollsp_char_utf8mbx(const char *collation, + const STRNNCOLLSP_CHAR_PARAM *specific) +{ + int failed= 0; + failed+= strnncollsp_char(collation, strnncollsp_char_mbminlen1_xpad_common); + failed+= strnncollsp_char(collation, strnncollsp_char_utf8mbx_xpad_common); + + if (!strstr(collation, "_bin") && + !strstr(collation, "_german2") && + !strstr(collation, "_danish")) + failed+= strnncollsp_char(collation, + strnncollsp_char_utf8mbx_xpad_a_eq_auml); + if (specific) + failed+= strnncollsp_char(collation, specific); + return failed; +} + + +static int +test_strnncollsp_char() +{ + int failed= 0; + failed+= strnncollsp_char_latin1("latin1_swedish_ci", NULL); + failed+= strnncollsp_char_latin1("latin1_swedish_nopad_ci", NULL); + failed+= strnncollsp_char_latin1("latin1_bin", NULL); + failed+= strnncollsp_char_latin1("latin1_nopad_bin", NULL); + failed+= strnncollsp_char_latin1("latin1_german2_ci", + strnncollsp_char_latin1_german2_ci); + +#ifdef HAVE_CHARSET_cp1250 + failed+= strnncollsp_char_mbminlen1("cp1250_czech_cs", + strnncollsp_char_mbminlen1_xpad_czech); +#endif + +#ifdef HAVE_CHARSET_latin2 + failed+= strnncollsp_char_mbminlen1("latin2_czech_cs", + strnncollsp_char_mbminlen1_xpad_czech); +#endif + +#ifdef HAVE_CHARSET_tis620 + failed+= strnncollsp_char_mbminlen1("tis620_thai_ci", NULL); +#endif + +#ifdef HAVE_CHARSET_big5 + failed+= strnncollsp_char_mbminlen1("big5_chinese_ci", NULL); + failed+= strnncollsp_char_mbminlen1("big5_chinese_nopad_ci", NULL); + failed+= strnncollsp_char_mbminlen1("big5_bin", NULL); + failed+= strnncollsp_char_mbminlen1("big5_nopad_bin", NULL); +#endif + + failed+= strnncollsp_char_utf8mbx("utf8mb3_general_ci", NULL); + failed+= strnncollsp_char_utf8mbx("utf8mb3_general_nopad_ci", NULL); + failed+= strnncollsp_char_utf8mbx("utf8mb3_bin", NULL); + failed+= strnncollsp_char_utf8mbx("utf8mb3_nopad_bin", NULL); + + failed+= strnncollsp_char_utf8mbx("utf8mb3_unicode_ci", + strnncollsp_char_utf8mb3_unicode_ci); + failed+= strnncollsp_char_utf8mbx("utf8mb3_unicode_nopad_ci", + strnncollsp_char_utf8mb3_unicode_nopad_ci); + failed+= strnncollsp_char_utf8mbx("utf8mb3_danish_ci", + strnncollsp_char_utf8mb3_danish_ci); + failed+= strnncollsp_char_utf8mbx("utf8mb3_german2_ci", + strnncollsp_char_utf8mbx_german2_ci); + failed+= strnncollsp_char_utf8mbx("utf8mb3_czech_ci", + strnncollsp_char_mbminlen1_xpad_czech); + +#ifdef HAVE_CHARSET_ucs2 + failed+= strnncollsp_char_mbminlen2("ucs2_general_ci", NULL); + failed+= strnncollsp_char_mbminlen2("ucs2_general_nopad_ci", NULL); + failed+= strnncollsp_char_mbminlen2("ucs2_bin", NULL); + failed+= strnncollsp_char_mbminlen2("ucs2_nopad_bin", NULL); + failed+= strnncollsp_char_mbminlen2("ucs2_unicode_ci", NULL); + failed+= strnncollsp_char_mbminlen2("ucs2_unicode_nopad_ci", NULL); +#endif + + return failed; +} + + +int main(int ac, char **av) { size_t i, failed= 0; - - plan(3); + + MY_INIT(av[0]); + + plan(4); diag("Testing my_like_range_xxx() functions"); for (i= 0; i < array_elements(charset_list); i++) @@ -1039,5 +1535,11 @@ int main() failed= test_minmax_str(); ok(failed == 0, "Testing min_str() and max_str() functions"); + diag("Testing cs->coll->strnncollsp_char()"); + failed= test_strnncollsp_char(); + ok(failed == 0, "Testing cs->coll->strnncollsp_char()"); + + my_end(0); + return exit_status(); } diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c index 82bc7d6d6c1..8ff71212878 100644 --- a/vio/viosslfactories.c +++ b/vio/viosslfactories.c @@ -25,7 +25,7 @@ static my_bool ssl_algorithms_added = FALSE; static my_bool ssl_error_strings_loaded= FALSE; /* the function below was generated with "openssl dhparam -2 -C 2048" */ - +#ifndef HAVE_WOLFSSL static DH *get_dh2048() { @@ -72,6 +72,7 @@ DH *get_dh2048() } return dh; } +#endif static const char* ssl_error_string[] = @@ -228,7 +229,6 @@ new_VioSSLFd(const char *key_file, const char *cert_file, enum enum_ssl_init_error *error, const char *crl_file, const char *crl_path, ulonglong tls_version) { - DH *dh; struct st_VioSSLFd *ssl_fd; long ssl_ctx_options; DBUG_ENTER("new_VioSSLFd"); @@ -359,18 +359,21 @@ new_VioSSLFd(const char *key_file, const char *cert_file, goto err2; } +#ifndef HAVE_WOLFSSL /* DH stuff */ if (!is_client_method) { - dh=get_dh2048(); + DH *dh= get_dh2048(); if (!SSL_CTX_set_tmp_dh(ssl_fd->ssl_context, dh)) { *error= SSL_INITERR_DH; - goto err3; + DH_free(dh); + goto err2; } DH_free(dh); } +#endif #ifdef HAVE_WOLFSSL /* set IO functions used by wolfSSL */ @@ -382,8 +385,6 @@ new_VioSSLFd(const char *key_file, const char *cert_file, DBUG_RETURN(ssl_fd); -err3: - DH_free(dh); err2: SSL_CTX_free(ssl_fd->ssl_context); err1: diff --git a/win/packaging/ca/CustomAction.cpp b/win/packaging/ca/CustomAction.cpp index cbef4d2ee41..328e73accb8 100644 --- a/win/packaging/ca/CustomAction.cpp +++ b/win/packaging/ca/CustomAction.cpp @@ -187,6 +187,27 @@ bool IsDirectoryEmptyOrNonExisting(const wchar_t *dir) { return empty; } +extern "C" UINT __stdcall CheckInstallDirectory(MSIHANDLE hInstall) +{ + HRESULT hr= S_OK; + UINT er= ERROR_SUCCESS; + wchar_t *path= 0; + + hr= WcaInitialize(hInstall, __FUNCTION__); + ExitOnFailure(hr, "Failed to initialize"); + WcaGetFormattedString(L"[INSTALLDIR]", &path); + if (!IsDirectoryEmptyOrNonExisting(path)) + { + wchar_t msg[2*MAX_PATH]; + swprintf(msg,countof(msg), L"Installation directory '%s' exists and is not empty. Choose a " + "different install directory",path); + WcaSetProperty(L"INSTALLDIRERROR", msg); + } +LExit: + ReleaseStr(path); + return WcaFinalize(er); +} + /* Check for valid data directory is empty during install A valid data directory is non-existing, or empty. diff --git a/win/packaging/ca/CustomAction.def b/win/packaging/ca/CustomAction.def index aed69cf7827..c18a0d92058 100644 --- a/win/packaging/ca/CustomAction.def +++ b/win/packaging/ca/CustomAction.def @@ -8,3 +8,4 @@ CheckDatabaseProperties CheckDataDirectory CheckDBInUse CheckServiceUpgrades +CheckInstallDirectory diff --git a/win/packaging/extra.wxs.in b/win/packaging/extra.wxs.in index d003cea26d6..8b06ea1c24d 100644 --- a/win/packaging/extra.wxs.in +++ b/win/packaging/extra.wxs.in @@ -346,6 +346,7 @@ <Property Id="CRLF" Value="
" /> <CustomAction Id="CheckDataDirectory" BinaryKey="wixca.dll" DllEntry="CheckDataDirectory" Execute="immediate" Impersonate="yes"/> + <CustomAction Id="CheckInstallDirectory" BinaryKey="wixca.dll" DllEntry="CheckInstallDirectory" Execute="immediate" Impersonate="yes"/> <!-- What to do when navigation buttons are clicked --> <UI Id="MyWixUI_Mondo"> <UIRef Id="WixUI_FeatureTree" /> @@ -365,6 +366,12 @@ <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="NewOrUpgradeInstanceDlg" Order="999"> NOT Installed AND UpgradableServiceFound </Publish> + <Publish Dialog="CustomizeDlg" Control="Next" Event="DoAction" Value="CheckInstallDirectory" Order="1">NOT Installed</Publish> + <Publish Dialog="CustomizeDlg" Control="Next" Property="WarningText" Order="2" + Value="[INSTALLDIRERROR]"> + INSTALLDIRERROR + </Publish> + <Publish Dialog="CustomizeDlg" Control="Next" Event="SpawnDialog" Value="WarningDlg" Order="3">WarningText</Publish> <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="ConfirmDataCleanupDlg" Order="4"> <![CDATA[(&DBInstance=2) AND (!DBInstance=3)]]> </Publish> @@ -409,9 +416,6 @@ <RegistryValue Root='HKLM' Key='SOFTWARE\@CPACK_WIX_PACKAGE_NAME@' Name='DATADIR' Value='[DATADIR]' Type='string' KeyPath='yes'/> - <CreateFolder> - <util:PermissionEx User="NetworkService" GenericAll="yes" /> - </CreateFolder> </Component> <Component Id="C.datadir.permissions" Directory="DATADIR"> @@ -531,6 +535,29 @@ AllowAdvertise='no' Level='1' Display='hidden'> + + <Component Id="C_Permissions.bin" Guid="2ce05496-3273-4866-a5b5-1eff2837b4cb" Directory="D.bin"> + <!-- in case service is installed now on it the future --> + <CreateFolder> + <util:PermissionEx User="ALL SERVICES" Domain="NT SERVICE" GenericRead="yes" GenericExecute="yes" /> + </CreateFolder> + <Condition>SERVICENAME</Condition> + </Component> + + <Component Id="C_Permissions.lib.plugin" Guid="ff2e8f47-83fd-4dee-9e22-f103600cfc80" Directory="D.lib.plugin"> + <CreateFolder> + <util:PermissionEx User="ALL SERVICES" Domain="NT SERVICE" GenericRead="yes" GenericExecute="yes" /> + </CreateFolder> + <Condition>SERVICENAME</Condition> + </Component> + + <Component Id="C_Permissions.share" Guid="be8ee2fb-a837-4b31-b59a-68a506d97d81" Directory="D.share"> + <CreateFolder> + <util:PermissionEx User="ALL SERVICES" Domain="NT SERVICE" GenericRead="yes" GenericExecute="yes" /> + </CreateFolder> + <Condition>SERVICENAME</Condition> + </Component> + <ComponentRef Id='C.bin.mysql.exe'/> <ComponentRef Id='C.bin.mysqladmin.exe'/> <ComponentRef Id='C.bin.mysql_upgrade.exe'/> @@ -551,20 +578,6 @@ </Component> <?if $(var.HaveUpgradeWizard) != "0" ?> <ComponentRef Id='C.bin.mysql_upgrade_wizard.exe'/> - <!-- - <Component Id="c.shortcuts.upgrade_wizard" Guid="*" Directory="ShortcutFolder" Transitive="yes"> - <RegistryValue - Root="HKCU" Key="Software\@CPACK_WIX_PACKAGE_NAME@\Uninstall" - Name="shortcuts.upgrade_wizard" - Value="1" Type="string" KeyPath="yes" /> - <Shortcut Id="shortcut.upgrade_wizard" - Name="Upgrade Wizard (@CPACK_WIX_PACKAGE_NAME@)" - Target="[INSTALLDIR]bin\mysql_upgrade_wizard.exe" - Directory="ShortcutFolder" - Description="Upgrades older instances of MariaDB/MySQL services to version @MAJOR_VERSION@.@MINOR_VERSION@" - Advertise="no"/> - </Component> - --> <?endif?> </Feature> @@ -639,11 +652,17 @@ <CustomAction Id='ErrorDataDir' Error='Invalid data directory, choose a different one. Error : [DATADIRERROR]'/> + <CustomAction Id="ErrorInstallDir" + Error="[INSTALLDIRERROR]" /> <InstallExecuteSequence> <Custom Action="CheckDataDirectory" After="CostFinalize"> <![CDATA[&DBInstance=3 AND NOT !DBInstance=3 AND OLDERVERSIONBEINGUPGRADED=""]]> </Custom> - <Custom Action="ErrorDataDir" After="CheckDataDirectory">DATADIRERROR</Custom> + <Custom Action="ErrorDataDir" After="CheckDataDirectory">DATADIRERROR</Custom> + <Custom Action="CheckInstallDirectory" After="CostFinalize"> + NOT Installed + </Custom> + <Custom Action="ErrorInstallDir" After="CheckInstallDirectory">INSTALLDIRERROR</Custom> <Custom Action="CheckDatabaseProperties" Before="CreateDatabaseCommand">SERVICENAME</Custom> <Custom Action="CreateDatabaseCommand" After="CostFinalize" > <![CDATA[&DBInstance=3 AND NOT !DBInstance=3 AND OLDERVERSIONBEINGUPGRADED=""]]> diff --git a/wsrep-lib b/wsrep-lib -Subproject 6fd1fdf69044bb6a08c488cec52668bbb31dd8a +Subproject edd141127c11d78ef073f9f3ca61708821f20b3 |